Fueled / django-init

Project template used at Fueled for scaffolding new Django based projects. :dizzy:
Other
189 stars 46 forks source link

feat(async): add uvicorn, asgi, upgrade django=4.1 #473

Closed sun337 closed 1 year ago

sun337 commented 1 year ago

Why was this change necessary?

Current version of django(3.2) doesn't support async tasks.

How does it address the problem?

After upgrading to django>4.1 and running asgi server, the application can run tasks asynchronously.

Are there any side effects?

Uvicorn config --limit-concurrency is not yet supported when running with Gunicorn.

Need to test provisioner scripts before merging

CuriousLearner commented 1 year ago

You may also take a look at this: https://github.com/Fueled/beacon-backend/commit/8f603d8c26cb81ec5454cb5e0aae3e00917665f5#diff-9cc070b76f0e6b43857f4eeedb4eaa88a711fc9e80a5bcad1a7679489cadc6bdR63-R70

and checkout that the nginx settings are in place for uvicorn proxy pass.

CuriousLearner commented 1 year ago

Also, the docs changes can be picked up from here: https://github.com/Fueled/beacon-backend/commit/e3d7d01b85460ffa49962e3ff325b33ae1fc0fe0

theskumar commented 1 year ago

@sun337 Are you still working on it?

what-the-diff[bot] commented 1 year ago

PR Summary

sun337 commented 1 year ago

@sun337 Are you still working on it?

@theskumar The provisioner scripts aren't tested yet. Also I'm thinking to update python to 3.11 in the same PR, thoughts?

CuriousLearner commented 1 year ago

The only thing (and the most critical one) needs to be tested with upgraded Python version is that the uwsgi plugin that is compiled through ansible on configuration task works.

I don't think it should have any other impact.

CuriousLearner commented 1 year ago

Hey @sun337

When you've time, can you pick this up and test to see if this is working fine?