Skip to content

Instantly share code, notes, and snippets.

@guyjacks
Created August 31, 2017 17:38
Show Gist options
  • Select an option

  • Save guyjacks/c044b26f05870a4a5236c6472ae0f075 to your computer and use it in GitHub Desktop.

Select an option

Save guyjacks/c044b26f05870a4a5236c6472ae0f075 to your computer and use it in GitHub Desktop.
...
# APP CONFIGURATION
# ------------------------------------------------------------------------------
DJANGO_APPS = [
# Default Django apps:
'django.contrib.auth',
'django.contrib.sites',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Useful template tags:
# 'django.contrib.humanize',
# Admin
'django.contrib.admin',
]
THIRD_PARTY_APPS = [
'crispy_forms', # Form layouts
'tinymce',
'allauth', # registration
'allauth.account', # registration
'allauth.socialaccount', # registration
#'allauth.socialaccount.providers.facebook',
]
# Apps specific for this project go here.
LOCAL_APPS = [
# custom users app
'one_raft_first_site.users.apps.UsersConfig',
# Your stuff: custom apps go here
'one_raft_first_site.impact',
'one_raft_first_site.locations',
'one_raft_first_site.organizations',
'one_raft_first_site.cart',
]
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
# MIDDLEWARE CONFIGURATION
# ------------------------------------------------------------------------------
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
# MIGRATIONS CONFIGURATION
# ------------------------------------------------------------------------------
MIGRATION_MODULES = {
'sites': 'one_raft_first_site.contrib.sites.migrations'
}
...
# AUTHENTICATION CONFIGURATION
# ------------------------------------------------------------------------------
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
]
# Replace username with email
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_SIGNUP_FORM_CLASS = 'one_raft_first_site.users.forms.SignupForm'
ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', True)
ACCOUNT_ADAPTER = 'one_raft_first_site.users.adapters.AccountAdapter'
SOCIALACCOUNT_ADAPTER = 'one_raft_first_site.users.adapters.SocialAccountAdapter'
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment