From dcbe9c2f5279a15adccbe0270708bb2c27dac8d2 Mon Sep 17 00:00:00 2001 From: Priyatham Sai Chand Date: Sat, 16 Jan 2021 09:15:13 +0530 Subject: [PATCH] static file dir --- commerce/settings.py | 19 ++++++++----------- staticfiles/style.css | 0 2 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 staticfiles/style.css diff --git a/commerce/settings.py b/commerce/settings.py index 89fa8e2..c1c0e71 100644 --- a/commerce/settings.py +++ b/commerce/settings.py @@ -11,9 +11,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os -import django_heroku -# Activate Django-Heroku. -django_heroku.settings(locals()) + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -44,9 +42,6 @@ INSTALLED_APPS = [ ] MIDDLEWARE = [ - # Simplified static file serving. - # https://warehouse.python.org/project/whitenoise/ - 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -125,17 +120,19 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ -STATIC_URL = '/static/' MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'auctions/static'), -] +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') +STATIC_URL = '/static/' -STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' +# Extra places for collectstatic to find static files. +STATICFILES_DIRS = ( + os.path.join(BASE_DIR, 'static'), +) +STATICFILES_STORAGE = 'storages.backends.azure_storage.AzureStorage' DEFAULT_FILE_STORAGE = 'storages.backends.azure_storage.AzureStorage' AZURE_ACCOUNT_NAME = 'auctionimages' AZURE_ACCOUNT_KEY = '3W/fel22r8ExgQMDr8KOxxklp80/slPtAznb+G1Hkq0DWuX2bOIXnQMpgmU/BIJdIWnbDsgMr2SbC5l9qfJJ6g==' diff --git a/staticfiles/style.css b/staticfiles/style.css new file mode 100644 index 0000000..e69de29