[Django]-Can we create apps with twisted python as django…?

2👍

I have not really used Twisted (Only looked into it abit when i had one idea), but – You do not find the things you are looking for because they are not there. Django is web framework while Twisted, as they on their site are saying “Twisted is an event-driven networking engine written in Python and licensed under the open source”

So basically you can catch requests with twisted web, but you do not have that whole MVC that django offers.

There are other questions about using them together (using django and twisted together), but why would you do that? What are you looking to gain? Asynchronous non-blocking functions/snippets? Why not use celery then… instead of twisted.

4👍

I congratulate you on your choice to learn Twisted.
Here are the key differences you should be aware about.

Django is a Web CMS (Content Management System) created especially for sites building. It’s super good for fast site’s creation. But it’s threaded, that means it’s not so good in supporting of high loads.

Twisted excels in scalability and high loads support. It’s powerful asynchronous framework for any (all) kind of network development. Being asynchronous it’s super performant. Youtube was written on twisted-like pythonic framework called Medusa. You might want to read more about comparisons of threaded vs asynchronous programming methods.

So yes, you can obviously implement your site’s backend with Twisted, but keep in mind that Twisted is a little bit more of low level framework compared to Django (thought more flexible) and it requires a bit more of knowledge about network programming than Django.

To get started with Twisted and to get familiar yourself with asynchronous programming approach, I would recommend to go through this book.

It helped me a lot when I started to learn Twisted.
Also there is a comprehensive documentation with a lot of code samples that, as for me, is very similar to one that Django has 😉

Leave a comment