Frond-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?

“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

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.

1 Like

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.