Skip to content

Commit 01197e9

Browse files
committed
updated collectstatic settings
1 parent 26df875 commit 01197e9

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

gettingstarted/settings.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1717
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
18+
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
1819

1920

2021
# Quick-start development settings - unsuitable for production
@@ -82,6 +83,24 @@
8283
}
8384
}
8485

86+
# Password validation
87+
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
88+
89+
AUTH_PASSWORD_VALIDATORS = [
90+
{
91+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
92+
},
93+
{
94+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
95+
},
96+
{
97+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
98+
},
99+
{
100+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
101+
},
102+
]
103+
85104
# Internationalization
86105
# https://docs.djangoproject.com/en/1.8/topics/i18n/
87106

@@ -106,11 +125,12 @@
106125
# https://docs.djangoproject.com/en/1.8/howto/static-files/
107126

108127
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
109-
STATIC_ROOT = 'staticfiles'
128+
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
110129
STATIC_URL = '/static/'
111130

131+
# Extra places for collectstatic to find static files.
112132
STATICFILES_DIRS = (
113-
os.path.join(BASE_DIR, 'static'),
133+
os.path.join(PROJECT_ROOT, 'static'),
114134
)
115135

116136
# Simplified static file serving.

0 commit comments

Comments
 (0)