|
55 | 55 | TEMPLATES = [ |
56 | 56 | { |
57 | 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
58 | | - 'DIRS': [os.path.join(BASE_DIR, 'templates')], |
| 58 | + 'DIRS': [os.path.join(BASE_DIR, '..', "web", "dist")], |
59 | 59 | 'APP_DIRS': True, |
60 | 60 | 'OPTIONS': { |
61 | 61 | 'context_processors': [ |
|
74 | 74 | MIDDLEWARE = [ |
75 | 75 | 'corsheaders.middleware.CorsMiddleware', |
76 | 76 | 'django.middleware.security.SecurityMiddleware', |
| 77 | + 'whitenoise.middleware.WhiteNoiseMiddleware', |
77 | 78 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
78 | 79 | 'django.middleware.csrf.CsrfViewMiddleware', |
79 | 80 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
89 | 90 | WSGI_APPLICATION = 'api.wsgi.application' |
90 | 91 |
|
91 | 92 | INSTALLED_APPS = ( |
| 93 | + 'whitenoise.runserver_nostatic', |
92 | 94 | 'django.contrib.admin', |
93 | 95 | 'django.contrib.auth', |
94 | 96 | 'django.contrib.contenttypes', |
95 | 97 | 'django.contrib.sessions', |
96 | 98 | 'django.contrib.messages', |
97 | | - 'django.contrib.staticfiles', |
98 | 99 | 'django.contrib.humanize', |
99 | 100 | # Third-party apps |
100 | 101 | 'corsheaders', |
|
343 | 344 |
|
344 | 345 | # Static files (CSS, JavaScript, Images) |
345 | 346 | # https://docs.djangoproject.com/en/2.2/howto/static-files/ |
346 | | -STATIC_URL = '/static/' |
347 | | -STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'static')) |
| 347 | +STATIC_URL = '/assets/' |
| 348 | +#STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'static')) |
| 349 | +STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', 'web', 'dist', 'assets')) |
| 350 | +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' |
348 | 351 |
|
349 | 352 | # see: https://django-oauth-toolkit.readthedocs.io/en/latest/oidc.html?highlight=oidc.key#creating-rsa-private-key # noqa |
350 | 353 | with open('/var/run/secrets/drycc/passport/oidc-rsa-private-key') as f: |
|
0 commit comments