Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 3.0 support #2352

Closed
wahello opened this issue Dec 6, 2019 · 14 comments · Fixed by #2469
Closed

Django 3.0 support #2352

wahello opened this issue Dec 6, 2019 · 14 comments · Fixed by #2469

Comments

@wahello
Copy link

wahello commented Dec 6, 2019

Django 3.0 support?

when will django 3.0 be supported?

@luzfcb
Copy link
Collaborator

luzfcb commented Dec 6, 2019

Support will be done sometime in the future, when all dependencies have updated support for Django 3.0.

@luzfcb luzfcb added this to the Upgrade to Django 3.0 milestone Dec 6, 2019
@emilepetrone
Copy link
Contributor

emilepetrone commented Dec 13, 2019

Is there a list already of the packages and which have been updated? So we can keep track of which have been which need to be updated and their status.

I'm noticing many packages not in Cookiecutter are updated for 3.0 so it would be good to just have a simple table to keep track for this ticket.

Happy to put this together, but just want to make sure I'm not recreating something that already exists.

@browniebroke
Copy link
Member

Good idea, such table would be very helpful indeed. I don't think anyone is doing it at the moment 👍

@elcolie
Copy link

elcolie commented Dec 22, 2019

@emilepetrone I am about to move to Django manually, but if you have that list please list them here to save up community time

@emilepetrone
Copy link
Contributor

emilepetrone commented Dec 22, 2019

This is the start to organizing the packages, current versions in master, and which version of that package is 3.0 compatible.

When a package has been updated, we just need to add that version into the table.

That way when this PR is created, we can make sure the packages are all updated appropriately.

Link to Gist with the raw markdown

Base.txt

Name Version in Master 3.0 Compatible Version OK
django 2.2.10 3.0
pytz 2019.3 x
python-slugify 4.0.0 x
Pillow 7.0.0 n/a
rcssmin 1.0.6 n/a
argon2-cffi 19.2.0 n/a
whitenoise 5.0.1 5.0
redis 3.4.1 n/a
celery 4.4.0 n/a
django-celery-beat 2.0.0 2.0.0
flower 0.9.3 n/a
django-environ 0.4.5 TODO
django-model-utils 4.0.0 4.0.0
django-allauth 0.41.0 on master, but not in official release yet
django-crispy-forms 1.8.1 1.8.0
django-compressor 2.4 2.4
django-redis 4.11.0 4.11.0
djangorestframework 3.11.0 3.11.0
coreapi 2.3.3 n/a

local.txt

Name Version in Master 3.0 Compatible Version OK
Werkzeug 0.16.0 n/a
ipdb 0.12.3 n/a
Sphinx 2.3.0 n/a
psycopg2 2.8.4 n/a
psycopg2-binary 2.8.4 n/a
mypy 0.761 n/a
pytest 5.3.1 n/a
pytest-sugar 0.9.2 n/a
flake8 3.7.9 n/a
coverage 5.0.3 n/a
black 19.10b0 n/a
pylint-django 2.0.13 n/a
pylint-celery 0.3 n/a
pre-commit 1.20.0 n/a
factory-boy 2.12.0 In Master but not in official release yet
django-debug-toolbar 2.1 2.1
django-extensions 2.2.6 2.2.2
django-coverage-plugin 1.8.0 1.7.0
pytest-django 3.8.0 3.6.0
django-stubs 1.4.0 1.3.0

production.txt

Name Version in Master 3.0 Compatible Version OK
gunicorn 20.0.4 n/a
psycopg2 2.8.3 n/a
Collectfast 1.3.2 1.3.2
sentry-sdk 0.13.5 n/a
django-storages[boto3] 1.9 1.8
django-storages[google] 1.9 1.8
django-anymail[mailgun] 7.0.0 In Master but not in official release yet

@Andrew-Chen-Wang
Copy link
Contributor

Besides Traefik, since Django 3.0 offers async, what service should be setup for Django's asgi for Docker? And should asgi be the default if we offer both Traefik and the asgi server?

@elcolie
Copy link

elcolie commented Feb 13, 2020

@Andrew-Chen-Wang
Let me share my opinion. This is my use case with former Caddy and current Traefik.
(I omit celery others and their required containers for sake of simplicity here, but I always enable them in my compose.yml file)

  • 2 IPs point to single VM
  • Reverse Proxy configured to response between 2 containers

Next project my compose.yml would be like this

  • 3 IPs point to single VM
  • 1 container for wsgi
  • 1 container for Node server Vue, React, Angular, ... etc
  • 1 container for asgi. For django-channels
    In my dream I have 1 another PostGIS database, but unfortunately it is tremendous effort to put in down to Dockerfile I spent 3 days to get outdated version up and running

@Andrew-Chen-Wang
Copy link
Contributor

@elcolie Thanks for your setup! (just went through uvicorn's deployment doc with some benchmarks).

I found this https://www.uvicorn.org/#running-with-gunicorn, but I still stand on having asgi support in docker production be an optional thing rather than immediately implement gunicorn with uvicorn.

@antonagestam
Copy link

@emilepetrone Collectfast officially adds support for Django 3.0 in 1.3.2 released today.

@snmishra
Copy link

django-environ looks dormant. I switched to environs, which has a very similar api (inspired by django-environ)

@browniebroke
Copy link
Member

browniebroke commented Feb 29, 2020

I tried to bump the Django version to see what was broken, and the build is now green, I've opened #2469

These are the libraries where support is not yet official:

  • django-environ: there is a pull request open which adds Django 3.0 to their CI config. Looking at the changes, I don't see any Django specific code changes, they seem mostly about dropping Python 2.
  • django-anymail: it's on master, and the changes to add it are mostly updating the CI config, which indicates the current version should work.
  • django-allauth: again, not officially supported but I was able to update their CI config and get a green build without any code changes.

We should be able to upgrade now, just need to test the generated production app works with various setup.

django-environ looks dormant. I switched to environs, which has a very similar api (inspired by django-environ)

We have -at least- 2 other issues for it: #2291 and #2195, I think we should consider it but it doesn't look like a blocker here.

@browniebroke browniebroke mentioned this issue Feb 29, 2020
3 tasks
@Andrew-Chen-Wang
Copy link
Contributor

Are we adding Uvicorn and the asgi file? This is what I've been following for playing around with web sockets on native Django 3.0:

https://dev.to/jaydenwindle/adding-websockets-to-your-django-app-with-no-extra-dependencies-2f6h

@wadkar
Copy link
Contributor

wadkar commented Apr 6, 2020

@Andrew-Chen-Wang
In my dream I have 1 another PostGIS database, but unfortunately it is tremendous effort to put in down to Dockerfile I spent 3 days to get outdated version up and running

I just swapped FROM postgres:11.3 with FROM postgis/postgis:11-2.5 and it didn't crash. Maybe your dream can come true! If you have a test app for PostGIS can you try it out and let me know? I spent an enormous amount of time as well, but looks like it's working with ubuntu/debian (don't go for alpine).

@Andrew-Chen-Wang
Copy link
Contributor

@wadkar I did get a postgis Docker configuration going by replacing the current postgres manually. Just make sure you include the required libraries in your Dockerfiles, i.e. GEOS, GDAL, PROJ.4 etc. You can use the Debian package website to look all of them up, too.

I also created a PR for the implementation of Uvicorn and Gunicorn at #2506. Also, you need to change the driver. You can do that by doing:

DATABASES["default"]["engine"] = 'django.contrib.gis.db.backends.postgis'

I also didn't use the alpine version as some thing could go wrong without some of the missing packages of Alpine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants