Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Django settings for comarket project.
- Generated by 'django-admin startproject' using Django 1.10.6.
- For more information on this file, see
- https://docs.djangoproject.com/en/1.10/topics/settings/
- For the full list of settings and their values, see
- https://docs.djangoproject.com/en/1.10/ref/settings/
- """
- import os
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
- # SECURITY WARNING: keep the secret key used in production secret!
- SECRET_KEY = ''
- # SECURITY WARNING: don't run with debug turned on in production!
- DEBUG = True
- ALLOWED_HOSTS = []
- AUTH_USER_MODEL = 'accounts.User'
- SITE_ID = 1
- # Application definition
- INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'django.contrib.sites',
- 'social_django',
- 'imagekit',
- 'haystack',
- 'taggit',
- 'locations',
- 'accounts',
- 'companies',
- 'portfolios',
- 'ratings',
- 'contact_us',
- 'dashboard',
- ]
- 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',
- ]
- ROOT_URLCONF = 'comarket.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': ['templates'],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- 'social_django.context_processors.backends',
- 'social_django.context_processors.login_redirect',
- ],
- },
- },
- ]
- AUTHENTICATION_BACKENDS = (
- 'social_core.backends.open_id.OpenIdAuth',
- 'social_core.backends.google.GoogleOAuth2',
- 'social_core.backends.facebook.FacebookOAuth2',
- 'social_core.backends.vk.VKOAuth2',
- 'django.contrib.auth.backends.ModelBackend',
- )
- SOCIAL_AUTH_PIPELINE = (
- 'social_core.pipeline.social_auth.social_details',
- 'social_core.pipeline.social_auth.social_uid',
- 'social_core.pipeline.social_auth.auth_allowed',
- 'social_core.pipeline.social_auth.social_user',
- 'social_core.pipeline.user.get_username',
- 'accounts.utils.get_email',
- 'social_core.pipeline.social_auth.associate_by_email',
- 'social_core.pipeline.user.create_user',
- 'social_core.pipeline.social_auth.associate_user',
- 'social_core.pipeline.social_auth.load_extra_data',
- 'social_core.pipeline.user.user_details',
- )
- SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = ''
- SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = ''
- SOCIAL_AUTH_FACEBOOK_KEY = ''
- SOCIAL_AUTH_FACEBOOK_SECRET = ''
- SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
- SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
- SOCIAL_AUTH_LOGIN_URL = '/'
- SOCIAL_AUTH_USER_MODEL = 'accounts.User'
- SOCIAL_AUTH_VK_OAUTH2_KEY = ''
- SOCIAL_AUTH_VK_OAUTH2_SECRET = ''
- SOCIAL_AUTH_VK_OAUTH2_SCOPE = ['email']
- SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {
- 'locale': 'en_US',
- 'fields': 'id, email, first_name, last_name, gender, link',
- }
- WSGI_APPLICATION = 'comarket.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
- }
- }
- HAYSTACK_CONNECTIONS = {
- 'default': {
- 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
- 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
- },
- }
- # HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
- HAYSTACK_DEFAULT_OPERATOR = 'AND'
- # Password validation
- # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
- AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
- ]
- # Internationalization
- # https://docs.djangoproject.com/en/1.10/topics/i18n/
- LANGUAGE_CODE = 'en-us'
- TIME_ZONE = 'UTC'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.10/howto/static-files/
- LOGIN_REDIRECT_URL = 'main'
- LOGIN_URL = 'login'
- STATIC_URL = '/static/'
- MEDIA_URL = '/media/'
- STATICFILES_DIRS = (
- os.path.join(BASE_DIR, 'static'),
- )
- STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
- MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
- TAGGIT_CASE_INSENSITIVE = True
- try:
- from local_settings import *
- except ImportError:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement