Django 3.0 alpha 1 released
djangoproject.com
djangoproject.com
With Django 3.0 alpha there is an issue with orm which is still not async, so not sure how mixing async code with sync code will behave.
Personally I haven't moved to any async framework in Python for project which need db access until the database adapters like psycopg and orm like sqlalchemy support them completely.
Now a days since most of my startup work involves developing REST API using Python backend without worrying about templates prefer micro framework like Flask [1], bottle [2], web.py [3], Pyramid [4], TurboGears 2 [5], cherrypy [6] etc.
For async might use uvloop based micro framework like sanic [7], quart [8], or starlette [9] vibora [10] etc.
These days in development we try to use these framework more like a library than framework per se. The difference is using them as library our code call library code and it's inline with one of the zen of python "Explicit is better than implicit".
[1] https://palletsprojects.com/p/flask/
[7] https://github.com/huge-success/sanic
[8] https://pgjones.gitlab.io/quart/
[10] https://vibora.io/
I believe there are safeguards in place to be sure you don't accidentally do this.
"Note that as a side-effect of this change, Django is now aware of asynchronous event loops and will block you calling code marked as “async unsafe” - such as ORM operations - from an asynchronous context. If you were using Django from async code before, this may trigger if you were doing it incorrectly. If you see a SynchronousOnlyOperation error, then closely examine your code and move any database operations to be in a synchronous child thread."
I have not had a chance to play with ASGI yet. I'm not a fan of async as a paradigm, but it has a small number of use cases where it excels. I think it will always be problematic when you need heavy database access (like in most django apps), but where it does fit it can be a very handy tool.
About the only nitpick I can think of is that dealing with large streams of data (say a user-agent uploading a big file) without either the web server / or the WSGI side of things reading the whole thing into memory or buffering it on disk can be a pain.
Moving from django 1/python 2.7 was quite painful but possible and now they're suggesting that third party developers stop supporting django 2.2? It was released in April this year!
I know I'm not using any new django features that weren't there in 1.0. I imagine most django users are the same. I'd love to just have a LTS with security updates and conservative non-breaking changes.
Prior to 2.2, so they encourage keeping support for the Django 2.2 LTS.
The current LTS (1.11) ends in April 2020, which gives you a little more than 6 months to upgrade current projects to 2.2.
But I strongly recommend you update ASAP, as v1.4 is likely to be riddled with security holes...
Your best option is to go to this page to understand the upgrade process, https://docs.djangoproject.com/en/2.2/howto/upgrade-version/
All information you need to upgrade is on that page, read it carefully.
/home/cody/.virtualenvs/37/lib/python3.7/site-packages/django/db/models/sql/compiler.py:1030: RemovedInDjango30Warning: Remove the context parameter from MultiSelectField.from_db_value(). Support for it will be removed in Django 3.0.
RemovedInDjango30Warning,
/home/cody/.virtualenvs/37/lib/python3.7/site-packages/django/db/models/sql/compiler.py:1030: RemovedInDjango30Warning: Remove the context parameter from MultiSelectField.from_db_value(). Support for it will be removed in Django 3.0.
RemovedInDjango30Warning, python -Wa -Wignore::DeprecationWarning
The above, however, will ignore all DeprecationWarning warnings. You can further filter this ignore if you know the module where the warning originates: https://docs.python.org/3/library/warnings.html#describing-w...Alternatively, if you find a package import is causing this warning, you can wrap the import in a context manager that ignores the warning:
import warnings
from django.utils.deprecation import RemovedInDjango30Warning
with warnings.catch_warnings():
warnings.simplefilter("ignore", RemovedInDjango30Warning)
import MODULEIs there a plan to stop requiring jQuery?
I also thought we would've been better off without jQuery until I started receiving calls that multiple users with different browsers had problems with the app... and telling the users to update would either need approval from the IT department or the user refuses because it'd break compatibility with existing legacy apps that they also use. Having jQuery is just a cheap price to pay.
Ideally I would love everyone to be on the latest browser and that companies moved out of said legacy apps or at least invested in improving them...
I'm currently supporting two major business applications built on Django (custom ERP/CRM software) and the speed with which our teams can develop new features is astounding.
The cost of maintenance is very high in the Python/Django stack those days!
True, but the community has done a great job managing this over a long period of time. It's most costly if you haven't been investing along the way.
It seems that there are very few breaking changes in Django 3 that will be relevant for application developers. Third-party packages poking around in Django's internals might have a slightly harder time, but it still seems very managable.
Code is alive and needs maintenance. Period. You cannot expect simultaneously a modern framework with eternal backwards compatibility and security gaps.