I develop backend with django. But now I want to develop frontend also. Is django is the best option for this or do I need to study react or angular to connect with django?
âBestâ is a relative term and can only be addressed within the context of a specific application.
There are some applications where the standard Django environment is best.
There are some applications where HTMX is best.
There are some applications where Django with Vue / React / Angular /etc are best.
There are some applications where Django / Django Rest Framework with Vue / React / Angular / etc are best.
There are some applications ⌠(anyway, you get the idea).
Do you need to study Vue / React / Angular to connect with Django? No. Iâve been working with Django consistently for more than 8 years now and have never used any of them. They would provide zero value for the applications I build.
(Note: if you can, meaning the âpencilâ icon appears next to the title at the top of the thread, it would be nice if you corrected the typo in the title.)
The only front-end I know is html. I checked Google and all of them are saying Javascript is important for front-end. So front end by django is using python or javascript? Iâm a starter so I changed the term into âsimpleâ rather than âbestâ.
I can recommend going to freecodecamp online. They have a lot of great content if you want to try and learn
The precise answer to your question is actually âbothâ and âneitherâ.
In all cases, regardless of what technologies you use, the âfront-endâ is a combination of HTML and JavaScript that runs in the browser.
Django works by creating (as necessary) and sending HTML from the server to the browser. That HTML may include or contain references to other files containing JavaScript.
When you use something like Vue (etc), youâre adding Vueâs JavaScript to the response you are sending from the server. Those Vue modules are then doing work for you that you may have otherwise had to do yourself in Django (or write your own JavaScript to do the same things).
The question isnât âwhat is the front-end usingâ, itâs âwhat is generating the html that the user is seeingâ. When youâre creating the front end only using Django, you and Django are creating all the HTML that will eventually be seen by the user. When you add something like Vue into the mix, youâre adding another program that will generate HTML - affecting what is visible in the browser.
Therefore, if youâre looking for âeasiest to learnâ, starting out with just Django is the best place to start. You can add features and functionality later as desired.
Some great answers on this thread. I just wanted to call out HTMX as a nice solution that plays very nicely with Django and can provide a lot of what react/angular might do on the front end, but let you work almost entirely in Django templates.
Django is primarily a web development framework ,but it has basic frontend capabilities .However, for more complex frontend development, it is recommended to use a dedicated frontend framework like React, Angular, or Vue.
As a noob Im just curious why django-unicorn is not being mentioned here?
Have you guys checked out this guide? It seems pretty interesting! To be honest, I havenât had the chance to go through it thoroughly yet, except for Part 1 and Part 5. I was particularly intrigued by Part 5 because I wanted to learn about HTMX as a JavaScript-free front-end solution. Itâs promising to hear advice from someone who has been a Django developer for over 10 years. I still havenât found the time to dive deep into learning JavaScript and all its complexities, but Iâm curious to know if this resource is worth adding to my âlearn laterâ list. I would appreciate advice from experts who have checked it out. Let me know your thoughts!
I wanna add ReactPy here!
I am no expert, but I do use Saas Pegasus which is connected to the guide. I dont use the whole thing on every project and I love how I can pick and choose.