Here’s the Deal
Slant is powered by a community that helps you make informed decisions. Tell us what you’re passionate about to get your personalized feed and help others.
Just a few lines of code can instruct Django to create all the tables and fields required in your database automatically. Schemas are managed with "migrations", that are also created automatically, and can be rolled out from your development box and implemented on production systems with just a single command. This performs any database changes required, from table creation, indexes, renaming fields, and pre-populating initial data. Each migration builds on the previous migrations, so you can trace the evolution of your data and even recreate the layout of your database at any point in the lifecycle of your application. See More
Django was first released in 2005, it has had a lot of time to mature and become better with each release. It also has by far the largest community out of all python frameworks who have continuously over the years built and maintained many powerful plugins. See More
A Django process is set up so it's handed a single request, generates a response in its entirety, and returns it before taking on the next request. While this is fine for many document-based sites, it does limit the scope of what you might want to do with a more ambitious web application. It doesn't take too long to run in to the limitations. Want to return a response to the browser and then send off a batch of e-mail notifications? Nope, you can't do things after the response, the user's going to have to wait for that email traffic to complete before they get their HTTP response. Want to hold open a connection to the browser to send an event stream, like chat messages or world updates from a multiplayer game? Considering our Django processes take ~80 MB RAM, you can't really afford to dedicate an entire process to every user. No websockets for you. Your process is waiting on something else, like a complicated database query or a third-party API? Okay, that's fine, but it's just going to idle there, those resources (i.e. all the program code and state that's already been loaded into memory) can't be used to serve other requests in the meantime. This means for even very modest levels of traffic you need multiple django processes running and a layer in front directing requests between them. The common answer to "how do I do things outside the request cycle" is "use Celery", but that introduces a whole mess of infrastructure (you need an external message queue server) and interprocess communication complexity. There are some benefits to distributing load that way, but it makes things that might otherwise have been handled in-process much more complicated. (This argument is common to all synchronous (blocking) frameworks. WSGI is a blocking interface.) See More
The official Django documentation is probably some of the best around. Well written, thorough and they explain every little detail of the framework. Django is also a very popular tool, with an extensive community and a lot of experienced developers that have been using it for years. This means that there are a lot of guides and tutorials out there for new and experienced developers alike. See More
Given a GET request for /topics/426/viewpoints/1/sections/create, how does Django decide which bit of Python code is invoked to handle it? It compares the request path to your giant pile of regular expressions. And then if there's some other regular expression starts matching /top and all your requests for /topics/ start going there, good luck figuring out why. You won't be informed of any conflict until you notice you seem to be getting the wrong pages back. The structure of URL paths is almost universally hierarchal. There is no call to have anything as ridiculously flexible (and notoriously hard-to-read) as regular expressions to organize request routing. See More
Django supports Object-Relational Mapping. With models defined as Python classes which are actually subclasses of Django's django.db.models.Model. Each attribute of the model is then represented as a database field. Queries are lazily executed and Django gives developers an automatically-generated database-access API. See More
For beginners Django is a bad idea, following books and tutorials newbies will learn only Django and its specific APis instead of learn how the things really works in a web environment. Example: You can follow a tutorial about Django Forms and you learn how Django Forms API works, but you don't learn how web forms works and you will get lost when need to work in another environment or solve difficult problems. See More
If you make a typo in a template variable, or change a view so that variable is no longer passed to the template, you won't get an error message pointing out that something has gone wrong. That reference will just be treated as if it is an empty string instead. There is a way to configure this, but since so many templates have been written assuming this behavior, nobody ever enables template errors because it would break so much of the existing support tools (e.g. the built-in admin interface). See More
Flask is very easy to get up and going, with vanilla HTML or with bootstrap pieces. It doesn't take much lines of python to load Flask to get headers working, etc, and since it's all modular you don't have to have something you don't want in your application. Each module within Flask works very well, and is extremely good on bandwidth and CPU usage. See More
Even though it's pretty minimalistic out of the box, Flask still provides the necessary tools to build a quick prototype for a web app right after a fresh install. With all the main components pretty much packed in the flask package, building a simple web app in a single Python file is as easy as it gets. See More
The choice of not having an ORM, but instead choosing one suited to the task, gives developers who use Flask a great deal of flexibility. Another area where Flask gives a lot of options to developers is the templating. They can use Jinja2, Flask's default templating language or choose from a number of different templating languages they desire. See More
Flask is one of the most popular Python web frameworks, if not the most popular one. As such, there's plenty of guides, tutorials, and libraries available for it. A large number of important Python libraries, such as SQLAlchemy have libraries for Flask, which add valuable bindings to make the development process and the integration between these libraries and Flask as easy as possible. See More
Help millions of people make better decisions.
Each month, over 2.8 million people use Slant to find the best products and share their knowledge. Pick the tags you’re passionate about to get a personalized feed and begin contributing your knowledge.