tiangolo / uvicorn-gunicorn-docker

Docker image with Uvicorn managed by Gunicorn for high-performance web applications in Python with performance auto-tuning.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django ASGI: How to serve static files with this image

dwjorgeb opened this issue · comments

What is the best way to serve static files while using this image for handling HTTP requests for Django ASGI?

Hi Jorge, I serve static files for Django with whitenoise. Just follow this instructions and add the following to your prestart.sh:

python manage.py collectstatic --noinput

Best,
Friedrich

Hi Jorge, I serve static files for Django with whitenoise. Just follow this instructions and add the following to your prestart.sh:

python manage.py collectstatic --noinput

Best,
Friedrich

Thank you! That worked for static files, but apparently does not work for media files. However, since my system does not rely on many media files, I'll probably use S3 or something like that.

Thanks for the help here @fribor !

If that solves your problem, may we close this issue? @dwjorgeb

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.