Front-end options for django

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?

1 Like

“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.)

1 Like

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

1 Like

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.

2 Likes

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.

2 Likes

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.

1 Like

As a noob Im just curious why django-unicorn is not being mentioned here?

2 Likes

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!

2 Likes

I wanna add ReactPy here!