28
loading...
This website collects cookies to deliver better user experience
python manage.py runserver
settings.py
.python manage.py check --deploy
DEBUG = False
. Now that you've done that, if you tried running your server using python manage.py runserver
now, and tried accessing your admin you'll realize that it doesn't load your CSS and you'll be greeted by a screen looking like this:pip install whitenoise
settings.py
. Add the following line to your settings:STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
# ...
]
settings.py
:STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
pip install gunicorn
gunicorn myproject.wsgi
myproject
with your Django project name instead.gunicorn myproject.wsgi --log-level DEBUG --access-logfile path/to/out.log --error-logfile path/to/error.log
path/to/out.log
and path/to/error.log
to actual file paths where you want to store your logs.debug
, you can use several other values such as: