I think the most exciting and flexible way to do things these days is with a collection of microservices. You can do feature work independently, test small isolable units of functionality, and achieve scale.That said, we could use cross-cutting libraries to make microservice implementation easier...
Re: microservices, I think it's much healthier to frame that debate as a matter of tradeoffs rather than one approach being universally better suited than the other.
Add support for multiple-column primary keys https://code.djangoproject.com/ticket/373 Opened 9 years ago
NULL fields and Unique keys https://code.djangoproject.com/ticket/4136 Opened 7 years ago
The ecosystem is great, too. django-rest-framework in particular makes us oh-so-happy.
Not to knock flask/Pyramid/everything else. Pick what your team can be most productive wit. I just think there are less reasons than ever to get too caught up in choice of framework. There are so many great options now.
Absolutely. If you already know one and like it, go forth and hack. If you're not sure, or don't like the one you have, there are tons of great options. Not just Flask/Django/Pyramid either. Tornado, Bottle, CherryPy, Falcon, and more all have dedicated users (some more than others).
Developers tend to get excited building microservices because let's be honest, most of us aren't Ops that have to watch those services 24/7.
During the development of Microservices, everything looks rosy, as things evolved, if the organization does not have the skill-sets and the discipline to maintain these microservices, things fall down pretty quickly.
Take logging as an example, I'm betting that many microservices implementation would find it a wee bit challenging to trace a user transaction end-to-end.
Django has the additional requirement that you think exactly like the designers of the monolithic framework or you will spend a lot of time swimming upstream. Ever tried to integrate Django or Celery into a project whose configuration comes from .ini files or some other method? You end up writing your own configuration layer to get something that Django approves of. Don't even get me started on the ORM -- why does it even exist when we have SQLAlchemy?
In the end, convention over configuration (just put your files in the magic locations, for example) is just another term for developer arrogance: of course my way is natural and everyone will want to think like me! With something like Pyramid I never find myself following a debugger down into the guts to understand why it is or isn't doing something -- I have to do this all the time with Django because some piece of magic isn't working as advertised.
Ultimately, something like Django is concerned with "how can I make it work?" What professional engineers should be concerned with are questions like "what happens when it doesn't work?" and "will someone else be able to understand this?" With Django, what happens when it doesn't work is you find yourself about 13 levels deep in the stack looking at some wrapper class in this giant framework. If you do have to get into a Pyramid component, most of them are actually just individual projects, a single developer can understand the whole thing.
The entire work of engineering is to make it work, without also making it comprehensible to others and easily serviceable -- and do it fast. Picking Django because it makes it easy to start a new project is just satisfying one of those, unless you really understand deeply the bowels of the framework or expect to hire someone who does.
With respect to "Will someone else understand the code" - Having trained few engineers to use Django, the main issue always has been correct decomposition of the entire webapp into different submodules or Django "apps" - If the project has been properly modularized, then it is easy to find problems or add functionality.
In short, imho writing good serviceable code does not depend upon the framework - it depends upon the team :)
This is really the best summary. It comes down to what your individual team can be more productive with. If it's Django, use Django. If it's Flask, use Flask.
> Don't even get me started on the ORM -- why does it even exist when we have SQLAlchemy?
There was a time when I thought much the same. But now I am glad for Django's more simple ORM. I've ended up liking ORMs less and less in general. If I'm going to use one, it's only going to be for the more simple queries. For this kind of case, Django's ORM really shines. Even our less technical staffers can get a copy of the DB and run some business analytics queries themselves.
For anything else, I'd much rather write the SQL myself. It's not difficult, and you are going to do better than the ORM could. Additionally, no ORM is going to have 100% support for every feature Postgres or MySQL offers. For example, we've made great use of Common Table Expressions.
> With Django, what happens when it doesn't work is you find yourself about 13 levels deep in the stack looking at some wrapper class in this giant framework. If you do have to get into a Pyramid component, most of them are actually just individual projects, a single developer can understand the whole thing.
Conversely, having a bunch of projects to track and update means breakages can occur in many different places for any given combination of versions.
In practice, we haven't found Django to be difficult to run. Quite the opposite, really. It's a cohesive unit. If you run into an issue, you are going to find lots of mailing list/bug tracker posts walking you through the solution in most cases.
I'm doing exactly that in my current project. It wasn't so bad, just a couple lines in settings.py. ConfigParser FTW!
> In the end, convention over configuration (just put your files in the magic locations, for example) is just another term for developer arrogance: of course my way is natural and everyone will want to think like me!
I'd argue that Flask or Pyramid encourage a form of that too, just in a different place. Yes the Django devs have decided where you should put many of the things, but if someone new comes to your project already knowing Django they'll know where to look for things, whereas a Flask or Pyramid project may have its own idiosyncratic layout.
You need not be afraid to use SQL when you need to do something more advanced. You don't need to feel dirty about it. Postgres in particular can do many more things than any ORM is going to be able to cover 100%. Sometimes you can flat out do something much more efficiently than the ORM can with a simple SQL statement.
If you follow this line of thinking, I'm not sure there's a great reason to bother wedging SQLAlchemy into Django, if I'm just going to end up dropping down into SQL for the more advanced queries.
Of course, portability could be more of a concern if you are writing something that you are going to let customers run on their own hardware/environment. Though even then, I'm not sure I'd want to have to deal with supporting customers using every DB server that Django supports...
* Email backend: https://docs.djangoproject.com/en/dev/topics/email/#defining...
* User model: https://docs.djangoproject.com/en/1.7/topics/auth/customizin...
* Authentication backend: https://docs.djangoproject.com/en/1.7/topics/auth/customizin...
* Databases
Django makes is very easy to write
* Views which extend from generic CBV and only need you to customize your CBV
* Custom template tags
* Wonderful admin pages: Its amazing what you can do with just Inline, list_display, list_search, list_filter etc. If you are willing to read through a bit of ModelAdmin class, then you will see it has nearly all hook points over ridable, though some it could do with a bit of documentation around ModelAdmin hook points.
When people say that `Django is not known about it's 'overridability'.`, they need to back it up with more data, because that not true at all, at least in 1.7