#3 Setting up Media and Static root

This commit is contained in:
reverend 2022-12-18 09:22:44 +01:00
parent 02512c1677
commit 5342e62bcb
2 changed files with 7 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
django_web_galleries/media/*

View File

@ -37,6 +37,8 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'responsive_images',
'web_galleries',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -115,9 +117,13 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/ # https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_ROOT = BASE_DIR / 'static'
STATIC_URL = 'static/' STATIC_URL = 'static/'
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
MEDIA_ROOT = BASE_DIR / 'media'
MEDIA_URL = 'media/'