Advertisement
Guest User

Untitled

a guest
May 30th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.52 KB | None | 0 0
  1. """
  2. Django settings for comarket project.
  3.  
  4. Generated by 'django-admin startproject' using Django 1.10.6.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/1.10/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/1.10/ref/settings/
  11. """
  12.  
  13. import os
  14.  
  15. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  16. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  17.  
  18.  
  19. # Quick-start development settings - unsuitable for production
  20. # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
  21.  
  22. # SECURITY WARNING: keep the secret key used in production secret!
  23. SECRET_KEY = ''
  24.  
  25. # SECURITY WARNING: don't run with debug turned on in production!
  26. DEBUG = True
  27.  
  28. ALLOWED_HOSTS = []
  29.  
  30. AUTH_USER_MODEL = 'accounts.User'
  31.  
  32. SITE_ID = 1
  33.  
  34.  
  35. # Application definition
  36.  
  37. INSTALLED_APPS = [
  38.     'django.contrib.admin',
  39.     'django.contrib.auth',
  40.     'django.contrib.contenttypes',
  41.     'django.contrib.sessions',
  42.     'django.contrib.messages',
  43.     'django.contrib.staticfiles',
  44.     'django.contrib.sites',
  45.  
  46.     'social_django',
  47.     'imagekit',
  48.     'haystack',
  49.     'taggit',
  50.  
  51.     'locations',
  52.     'accounts',
  53.     'companies',
  54.     'portfolios',
  55.     'ratings',
  56.     'contact_us',
  57.     'dashboard',
  58. ]
  59.  
  60.  
  61. MIDDLEWARE = [
  62.     'django.middleware.security.SecurityMiddleware',
  63.     'django.contrib.sessions.middleware.SessionMiddleware',
  64.     'django.middleware.common.CommonMiddleware',
  65.     'django.middleware.csrf.CsrfViewMiddleware',
  66.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  67.     'django.contrib.messages.middleware.MessageMiddleware',
  68.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  69. ]
  70.  
  71. ROOT_URLCONF = 'comarket.urls'
  72.  
  73. TEMPLATES = [
  74.     {
  75.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  76.         'DIRS': ['templates'],
  77.         'APP_DIRS': True,
  78.         'OPTIONS': {
  79.             'context_processors': [
  80.                 'django.template.context_processors.debug',
  81.                 'django.template.context_processors.request',
  82.                 'django.contrib.auth.context_processors.auth',
  83.                 'django.contrib.messages.context_processors.messages',
  84.                 'social_django.context_processors.backends',
  85.                 'social_django.context_processors.login_redirect',
  86.             ],
  87.         },
  88.     },
  89. ]
  90.  
  91. AUTHENTICATION_BACKENDS = (
  92.     'social_core.backends.open_id.OpenIdAuth',
  93.     'social_core.backends.google.GoogleOAuth2',
  94.     'social_core.backends.facebook.FacebookOAuth2',
  95.     'social_core.backends.vk.VKOAuth2',
  96.  
  97.     'django.contrib.auth.backends.ModelBackend',
  98. )
  99. SOCIAL_AUTH_PIPELINE = (
  100.     'social_core.pipeline.social_auth.social_details',
  101.     'social_core.pipeline.social_auth.social_uid',
  102.     'social_core.pipeline.social_auth.auth_allowed',
  103.     'social_core.pipeline.social_auth.social_user',
  104.     'social_core.pipeline.user.get_username',
  105.     'accounts.utils.get_email',
  106.     'social_core.pipeline.social_auth.associate_by_email',
  107.     'social_core.pipeline.user.create_user',
  108.     'social_core.pipeline.social_auth.associate_user',
  109.     'social_core.pipeline.social_auth.load_extra_data',
  110.     'social_core.pipeline.user.user_details',
  111. )
  112.  
  113. SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = ''
  114. SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = ''
  115.  
  116. SOCIAL_AUTH_FACEBOOK_KEY = ''
  117. SOCIAL_AUTH_FACEBOOK_SECRET = ''
  118. SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
  119.  
  120. SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
  121. SOCIAL_AUTH_LOGIN_URL = '/'
  122. SOCIAL_AUTH_USER_MODEL = 'accounts.User'
  123.  
  124. SOCIAL_AUTH_VK_OAUTH2_KEY = ''
  125. SOCIAL_AUTH_VK_OAUTH2_SECRET = ''
  126. SOCIAL_AUTH_VK_OAUTH2_SCOPE = ['email']
  127.  
  128. SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {
  129.     'locale': 'en_US',
  130.     'fields': 'id, email, first_name, last_name, gender, link',
  131. }
  132.  
  133.  
  134. WSGI_APPLICATION = 'comarket.wsgi.application'
  135. # Database
  136. # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
  137.  
  138. DATABASES = {
  139.     'default': {
  140.         'ENGINE': 'django.db.backends.sqlite3',
  141.         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  142.     }
  143. }
  144.  
  145. HAYSTACK_CONNECTIONS = {
  146.     'default': {
  147.         'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
  148.         'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
  149.     },
  150. }
  151.  
  152. # HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
  153.  
  154. HAYSTACK_DEFAULT_OPERATOR = 'AND'
  155.  
  156. # Password validation
  157. # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
  158.  
  159. AUTH_PASSWORD_VALIDATORS = [
  160.     {
  161.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  162.     },
  163.     {
  164.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  165.     },
  166.     {
  167.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  168.     },
  169.     {
  170.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  171.     },
  172. ]
  173. # Internationalization
  174. # https://docs.djangoproject.com/en/1.10/topics/i18n/
  175.  
  176. LANGUAGE_CODE = 'en-us'
  177.  
  178. TIME_ZONE = 'UTC'
  179.  
  180. USE_I18N = True
  181.  
  182. USE_L10N = True
  183.  
  184. USE_TZ = True
  185.  
  186.  
  187. # Static files (CSS, JavaScript, Images)
  188. # https://docs.djangoproject.com/en/1.10/howto/static-files/
  189.  
  190. LOGIN_REDIRECT_URL = 'main'
  191. LOGIN_URL = 'login'
  192. STATIC_URL = '/static/'
  193. MEDIA_URL = '/media/'
  194.  
  195. STATICFILES_DIRS = (
  196.     os.path.join(BASE_DIR, 'static'),
  197. )
  198.  
  199. STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
  200.  
  201. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  202.  
  203. TAGGIT_CASE_INSENSITIVE = True
  204.  
  205.  
  206. try:
  207.     from local_settings import *
  208. except ImportError:
  209.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement