Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fasouto/django-starter-template
Browse files Browse the repository at this point in the history
  • Loading branch information
fasouto committed Dec 5, 2017
2 parents bbfe99c + 3be0018 commit ee438c8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 44 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Fabio Souto
Copyright (c) 2017, Fabio Souto

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: gunicorn --bind 0.0.0.0:${PORT:-8000} -w 3 {{ project_name }}.wsgi
web: gunicorn --bind 0.0.0.0:${PORT:-8000} -w 1 {{ project_name }}.wsgi
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
4 changes: 1 addition & 3 deletions project_name/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
# Fill me with sitemaps
}

admin.autodiscover()

urlpatterns = [
url(r'', include('base.urls')),

# Admin
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/', admin.site.urls),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Sitemap
Expand Down
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ An easy to use project template for Django 2.0 that follows best practices.

## Features ##

- Compatible with python 2.7 and 3.4
- [Django compressor](http://django-compressor.readthedocs.org/en/latest/) to compress JS and CSS and compile LESS/SASS files.
- [Django debug toolbar](http://django-debug-toolbar.readthedocs.org/) enabled for superusers.
- [Argon2](https://docs.djangoproject.com/en/2.0/topics/auth/passwords/#using-argon2-with-django) to hash the passwords
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ certifi==2017.11.5
cffi==1.11.2
chardet==3.0.4
coverage==4.4.2
Django==1.10.7
Django==2.0
django-appconf==1.0.2
django-compressor==2.2
django-debug-toolbar==1.9.1
Expand Down
2 changes: 1 addition & 1 deletion requirements_to_freeze.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Based on http://www.kennethreitz.org/essays/a-better-pip-workflow

django==1.10.7
django==2.0
argon2-cffi

# Templates
Expand Down

0 comments on commit ee438c8

Please sign in to comment.