Advertisement
Guest User

django allauth settings

a guest
Aug 29th, 2014
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.95 KB | None | 0 0
  1. """
  2. Django settings for seven project.
  3.  
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/dev/topics/settings/
  6.  
  7. For the full list of settings and their values, see
  8. https://docs.djangoproject.com/en/dev/ref/settings/
  9. """
  10.  
  11. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  12. import os
  13. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  14.  
  15.  
  16. # Quick-start development settings - unsuitable for production
  17. # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
  18.  
  19. # SECURITY WARNING: keep the secret key used in production secret!
  20. SECRET_KEY = 'em3s&20x$!&q!7k6*3(1m6d%-zwzb9)iqrvqd%sphhe_tm@4%6'
  21.  
  22. # SECURITY WARNING: don't run with debug turned on in production!
  23. DEBUG = True
  24.  
  25. TEMPLATE_DEBUG = True
  26.  
  27. ALLOWED_HOSTS = []
  28.  
  29.  
  30. # Application definition
  31.  
  32. INSTALLED_APPS = (
  33.     'django.contrib.admin',
  34.     'django.contrib.auth',
  35.     'django.contrib.contenttypes',
  36.     'django.contrib.sessions',
  37.     'django.contrib.messages',
  38.     'django.contrib.staticfiles',
  39.     'django.contrib.sites',
  40.     'profiles',
  41.     'allauth',
  42.     'allauth.account',
  43.     #'allauth.socialaccount',
  44.     #'allauth.socialaccount.providers.facebook',
  45. )
  46.  
  47. SITE_ID = 1
  48.  
  49. LOGIN_URL = "/accounts/login/"
  50.  
  51. LOGIN_REDIRECT_URL = "/"
  52.  
  53. ACCOUNT_AUTHENTICATION_METHOD = "username_email"
  54. ACCOUNT_CONFIRM_EMAIL_ON_GET = False
  55. ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = LOGIN_URL
  56. ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = LOGIN_REDIRECT_URL
  57. ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 10
  58. ACCOUNT_EMAIL_REQUIRED = True
  59. ACCOUNT_EMAIL_VERIFICATION = None
  60. ACCOUNT_EMAIL_SUBJECT_PREFIX = "Subject is: "
  61. ACCOUNT_LOGOUT_ON_GET = True
  62. ACCOUNT_LOGOUT_REDIRECT_URL = LOGIN_URL
  63. ACCOUNT_SIGNUP_FORM_CLASS = None
  64. ACCOUNT_SIGNUP_PASSWORD_VERIFICATION =True
  65. ACCOUNT_UNIQUE_EMAIL = True
  66. ACCOUNT_USER_MODEL_USERNAME_FIELD ="username"
  67. ACCOUNT_USER_MODEL_EMAIL_FIELD = "email"
  68.  
  69. ACCOUNT_USERNAME_MIN_LENGTH =4
  70. ACCOUNT_USERNAME_REQUIRED =True
  71. ACCOUNT_PASSWORD_INPUT_RENDER_VALUE =False
  72. ACCOUNT_PASSWORD_MIN_LENGTH =6
  73. ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION =True
  74.  
  75. MIDDLEWARE_CLASSES = (
  76.     'django.contrib.sessions.middleware.SessionMiddleware',
  77.     'django.middleware.common.CommonMiddleware',
  78.     'django.middleware.csrf.CsrfViewMiddleware',
  79.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  80.     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  81.     'django.contrib.messages.middleware.MessageMiddleware',
  82.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  83. )
  84.  
  85. ROOT_URLCONF = 'seven.urls'
  86.  
  87. WSGI_APPLICATION = 'seven.wsgi.application'
  88.  
  89.  
  90. # Database
  91. # https://docs.djangoproject.com/en/dev/ref/settings/#databases
  92.  
  93. DATABASES = {
  94.     'default': {
  95.         'ENGINE': 'django.db.backends.sqlite3',
  96.         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  97.     }
  98. }
  99.  
  100. # Internationalization
  101. # https://docs.djangoproject.com/en/dev/topics/i18n/
  102.  
  103. LANGUAGE_CODE = 'en-us'
  104.  
  105. TIME_ZONE = 'UTC'
  106.  
  107. USE_I18N = True
  108.  
  109. USE_L10N = True
  110.  
  111. USE_TZ = True
  112.  
  113. TEMPLATE_CONTEXT_PROCESSORS =(
  114.     "django.contrib.auth.context_processors.auth",
  115.     "django.core.context_processors.debug",
  116.     "django.core.context_processors.i18n",
  117.     "django.core.context_processors.media",
  118.     "django.core.context_processors.static",
  119.     "django.core.context_processors.tz",
  120.     "django.contrib.messages.context_processors.messages",
  121.     "django.core.context_processors.request",
  122.     "allauth.account.context_processors.account",
  123.     #"allauth.socialaccount.context_processors.socialaccount",
  124.     )
  125.  
  126. AUTHENTICATION_BACKENDS = (
  127.     # Needed to login by username in Django admin, regardless of `allauth`
  128.     "django.contrib.auth.backends.ModelBackend",
  129.  
  130.     # `allauth` specific authentication methods, such as login by e-mail
  131.     "allauth.account.auth_backends.AuthenticationBackend",
  132. )
  133.  
  134.  
  135. # Static files (CSS, JavaScript, Images)
  136. # https://docs.djangoproject.com/en/dev/howto/static-files/
  137.  
  138. STATIC_URL = '/static/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement