3 ms·
If you want to use Python then use Django. As with any framework, it can be hard to work around but Django gives you the most options to work around the framewo
by cyberpanther 10y ago
If you want to use Python then use Django. As with any framework, it can be hard to work around but Django gives you the most options to work around the framework than any other framework I've found.
Normally, if you are having a hard time with Django its because you're trying to work around it the wrong way. This takes time to learn but Django can be really elegant to work around and with.
The second option is Flask or Tornado which are pretty great too. Both would give you more freedom but also less structure. I find it better to have the structure because unless your an experienced engineer your Flask or Tornado project will turn messy quick. Django projects can turn messy too, but at least there is a more training and protocols for people to follow.
I use Flask/Tornado if I want to use Python and I know my project is a small service and will probably not get big.
I use Django if I want to use Python and I know the project will grow over time or I need features from the start like a database, migrations, cache, etc.
- odonnellryan 10y agoMy test for using Django is similar to yours: If I think the project will best be represented with more than one "app" then I will use Django. If not, I'll use Flask. App can be an API + another part of the site, for example.
- NumberCruncher 10y ago>>Django gives you the most options to work around the framework So Django stands in my way and its' advantage is that it is easy the work around it?
- kej 10y agoMore like, every framework will sometimes get in your way, but it's easier to work around Django when needed than some others.
- tedmiston 10y agoNo, I think you're misinterpreting the comment. Django guides you the right way and how it guides you works most of the time. However, when you do hit the edge, Django's very well written docs and thoughtfully designed architecture guide you in building around its limitations. For example, if you want to swap in Jinja over Django templates or SQLAlchemy over Django ORM. Really needing to do so is still the exception to the norm, but just know that Django does more here than most other frameworks. If you are interested in understanding this a little deeper, I highly recommend picking up the Two Scoops book [1]. [1]: https://www.twoscoopspress.com/products/two-scoops-of-django-1-8 https://www.twoscoopspress.com/products/two-scoops-of-django...
- idw 10y agoI second the Two Scoops book. Django documentation is excellent (try the tutorial if you want a quick sense of django). Two Scoops help you understand why to do things in particular ways and make good design choices within all the things django can do.
- someotheridiot 10y agoAgreed. I've been using Django for only a little while, and sometimes find it quite frustrating. Then something finally makes sense and I realise I've been doing it wrong and the proper way makes everything soooo easy. The trick is to know when you're doing it the wrong way which isn't always apparent.