[Solved]-Can you use Python for both front end and back end using Django framework?


No, python can’t be used in frontend.

You need frontend technologies like html, css, javascript, jQuery etc…
for frontend.

Python can be used as scripting language in backend.


As others already said, basically you can’t use Python at the front-end. You can use Django Template Language or something like Jinja2 in your templates, but generally speaking these engines run on your server, not in the browser.

Actually, you can use Python to write the code, that runs in the browser, using transpilers like Transcrypt. But I don’t recommend you to do such a thing on a real project because of raising complexity and difference between these two languages. The only advantage would be that you can use one language to write both front-end and back-end. But the complexity of supporting this code will not worth it.


Its true that you can do something interesting with Django template system. but like @Astik said you cant replace javascript in front end. Personally I don’t use javascript for some Django projects because I don’t need it, but there are many situation that I have to. However that depends about your project is going to work.

Something better than Django templates system is jinja2 read more about it maybe help you

Leave a comment