Browse Source

Add whitenoise for static file handling

tags/3-hours
Alireza Savand 1 year ago
parent
commit
4026b222cb
2 changed files with 3 additions and 4 deletions
  1. 2
    4
      pmap/settings.py
  2. 1
    0
      requirements.txt

+ 2
- 4
pmap/settings.py View File

@@ -48,6 +48,7 @@ INSTALLED_APPS = [

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@@ -105,13 +106,9 @@ AUTH_PASSWORD_VALIDATORS = [
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


@@ -119,3 +116,4 @@ USE_TZ = True
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

+ 1
- 0
requirements.txt View File

@@ -5,3 +5,4 @@ dj-database-url==0.5.0
psycopg2-binary==2.7.4
gunicorn==19.8.1
gevent==1.3.1
whitenoise==3.3.1

Loading…
Cancel
Save