How to glue Django and React together?

17 views
Skip to first unread message

Abhiram P

unread,
May 6, 2020, 11:39:43 AM5/6/20
to Django users
I want to use react as front end and Django as back end. And the URL routing must be done by Django. How to do this

Desmond Nyamador

unread,
May 6, 2020, 11:51:34 AM5/6/20
to Django users
Hi, what you're trying to do is called server side rendering. Django does this out of the box with it's templating language , however since you want to use an SPA (React) I suggest you look into Nextjs. It's built like this out of the box.

Aldian Fazrihady

unread,
May 6, 2020, 12:39:06 PM5/6/20
to django...@googlegroups.com
Hi,

I am using that stack for my website aldianfazrihady.com.
It uses these modules:
https://pypi.org/project/django-webpack-loader/

On web browser, open my website, and use developer tools or view source to see how it interacts with django backend. 
I am using django only as API gateway using DRF and only to load simple page that points to JS that will initialize React.
UI rendering is done on web browser side.

On Wed, May 6, 2020 at 6:39 PM Abhiram P <abhir...@gmail.com> wrote:
I want to use react as front end and Django as back end. And the URL routing must be done by Django. How to do this

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0f786aad-14cc-4c45-99a8-8b2b7cf4c1f7%40googlegroups.com.


--
Regards,

Reply all
Reply to author
Forward
0 new messages