(to make it easier you just need to have these in your requirements.txt
and pip install them as well ):
django
gunicorn
packaging
whitenoise
Then to run server, guicorn
is used for it:
gunicorn -w 4 <site_name>.wsgi:application
<site_name>
- is name of main folder in your project !
- Add this in
<site_name>/settings.py
:
MIDDLEWARE = [
'whitenoise.middleware.WhiteNoiseMiddleware',
# ... all your other middleware
]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
...
# and also set this as well.
DEBUG = True
ALLOWED_HOSTS = ['*']
Top comments (0)