Skip to content

Commit

Permalink
Change setting urls to django 2
Browse files Browse the repository at this point in the history
  • Loading branch information
fasouto committed Dec 5, 2017
1 parent bc9ac14 commit d7f1e8d
Showing 1 changed file with 27 additions and 36 deletions.
63 changes: 27 additions & 36 deletions project_name/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@


# SITE SETTINGS
# https://docs.djangoproject.com/en/1.10/ref/settings/#site-id
# https://docs.djangoproject.com/en/2.0/ref/settings/#site-id
SITE_ID = 1

# https://docs.djangoproject.com/en/1.10/ref/settings/#allowed-hosts
# https://docs.djangoproject.com/en/2.0/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []

# https://docs.djangoproject.com/en/1.10/ref/settings/#installed-apps
# https://docs.djangoproject.com/en/2.0/ref/settings/#installed-apps
INSTALLED_APPS = [
# Django apps
'django.contrib.admin',
Expand All @@ -51,76 +51,67 @@
'base',
]

# https://docs.djangoproject.com/en/1.10/topics/auth/passwords/#using-argon2-with-django
PASSWORD_HASHERS = (
# https://docs.djangoproject.com/en/2.0/topics/auth/passwords/#using-argon2-with-django
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
)
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
]

# DEBUG SETTINGS
# https://docs.djangoproject.com/en/1.10/ref/settings/#debug
# https://docs.djangoproject.com/en/2.0/ref/settings/#debug
DEBUG = False

# https://docs.djangoproject.com/en/1.10/ref/settings/#internal-ips
# https://docs.djangoproject.com/en/2.0/ref/settings/#internal-ips
INTERNAL_IPS = ('127.0.0.1')

# LOCALE SETTINGS
# Local time zone for this installation.
# https://docs.djangoproject.com/en/1.10/ref/settings/#time-zone
TIME_ZONE = 'America/Los_Angeles'
# https://docs.djangoproject.com/en/2.0/ref/settings/#time-zone
TIME_ZONE = 'UTC'

# https://docs.djangoproject.com/en/1.10/ref/settings/#language-code
# https://docs.djangoproject.com/en/2.0/ref/settings/#language-code
LANGUAGE_CODE = 'en-us'

# https://docs.djangoproject.com/en/1.10/ref/settings/#use-i18n
# https://docs.djangoproject.com/en/2.0/ref/settings/#use-i18n
USE_I18N = True

# https://docs.djangoproject.com/en/1.10/ref/settings/#use-l10n
USE_L10N = True
# https://docs.djangoproject.com/en/2.0/ref/settings/#use-l10n
USE_L10N = False

# https://docs.djangoproject.com/en/1.10/ref/settings/#use-tz
USE_TZ = True
# https://docs.djangoproject.com/en/2.0/ref/settings/#use-tz
USE_TZ = False


# MEDIA AND STATIC SETTINGS
# Absolute filesystem path to the directory that will hold user-uploaded files.
# https://docs.djangoproject.com/en/1.10/ref/settings/#media-root
# https://docs.djangoproject.com/en/2.0/ref/settings/#media-root
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'public/media')

# URL that handles the media served from MEDIA_ROOT. Use a trailing slash.
# https://docs.djangoproject.com/en/1.10/ref/settings/#media-url
# https://docs.djangoproject.com/en/2.0/ref/settings/#media-url
MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# https://docs.djangoproject.com/en/1.10/ref/settings/#static-root
# https://docs.djangoproject.com/en/2.0/ref/settings/#static-root
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'public/static')

# URL prefix for static files.
# https://docs.djangoproject.com/en/1.10/ref/settings/#static-url
# https://docs.djangoproject.com/en/2.0/ref/settings/#static-url
STATIC_URL = '/static/'

# Additional locations of static files
# https://docs.djangoproject.com/en/1.10/ref/settings/#staticfiles-dirs
# https://docs.djangoproject.com/en/2.0/ref/settings/#staticfiles-dirs
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

# https://docs.djangoproject.com/en/1.10/ref/contrib/staticfiles/#staticfiles-finders
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

# TEMPLATE SETTINGS
# https://docs.djangoproject.com/en/1.10/ref/settings/#templates
# https://docs.djangoproject.com/en/2.0/ref/settings/#templates
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand All @@ -140,12 +131,12 @@


# URL SETTINGS
# https://docs.djangoproject.com/en/1.10/ref/settings/#root-urlconf.
# https://docs.djangoproject.com/en/2.0/ref/settings/#root-urlconf.
ROOT_URLCONF = '{{ project_name }}.urls'


# MIDDLEWARE SETTINGS
# See: https://docs.djangoproject.com/en/1.10/ref/settings/#middleware
# See: https://docs.djangoproject.com/en/2.0/ref/settings/#middleware
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
Expand All @@ -157,7 +148,7 @@
]

# LOGGING
# https://docs.djangoproject.com/en/1.10/topics/logging/
# https://docs.djangoproject.com/en/2.0/topics/logging/
LOGGING = {
'version': 1,
'loggers': {
Expand Down

0 comments on commit d7f1e8d

Please sign in to comment.