Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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__)))
- ALLOWED_HOSTS = ['localhost', '127.0.0.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',
- 'shop',
- 'favourites',
- 'customuser',
- 'contact',
- 'orders',
- 'cart',
- 'social_django',
- 'debug_toolbar',
- ]
- MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'whitenoise.middleware.WhiteNoiseMiddleware',
- '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',
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- ]
- ROOT_URLCONF = 'flowers_shop.urls'
- import os
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- SECRET_KEY = '3xw$wnvhaby0#(olv@o%-78r-w00@p1!k^v3@f23qy()cgenqn'
- DEBUG = False
- ALLOWED_HOSTS = ['localhost', '127.0.0.1']
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
- }
- }
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, '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',
- ],
- },
- },
- ]
- WSGI_APPLICATION = 'flowers_shop.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
- # Password validation
- # https://docs.djangoproject.com/en/3.0/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/3.0/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/3.0/howto/static-files/
- STATIC_ROOT = os.path.join(BASE_DIR, 'static')
- STATIC_URL = '/static/'
- MEDIA_URL = '/media/'
- MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
- AUTH_USER_MODEL = 'customuser.CustomUser'
- CELERY_BROKER_URL = 'redis://localhost:6379'
- CELERY_RESULT_BACKEND = 'redis://localhost:6379'
- CELERY_ACCEPT_CONTENT = ['application/json']
- CELERY_RESULT_SERIALIZER = 'json'
- CELERY_TASK_SERIALIZER = 'json'
- EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
- EMAIL_USE_TLS = True
- EMAIL_HOST = 'smtp.gmail.com'
- EMAIL_HOST_USER = 'romansashaproject@gmail.com'
- EMAIL_HOST_PASSWORD = 'adminadmin12345'
- EMAIL_PORT = 587
- LOGIN_URL = 'login'
- LOGIN_REDIRECT_URL = 'shop'
- LOGOUT_URL = 'logout'
- LOGOUT_REDIRECT_URL = 'login'
- SITE_ID = 1
- AUTHENTICATION_BACKENDS = [
- 'django.contrib.auth.backends.ModelBackend',
- 'customuser.authentication.EmailAuthBackend',
- 'social_core.backends.vk.VKOAuth2',
- 'social_core.backends.google.GoogleOAuth2',
- 'social_core.backends.facebook.FacebookOAuth2',
- ]
- SOCIAL_AUTH_VK_OAUTH2_KEY = '7495940' # VK App id
- SOCIAL_AUTH_VK_OAUTH2_SECRET = 'JYjpA1jqsYpgoZ0GtJxx' # VK App Secret
- SOCIAL_AUTH_VK_OAUTH2_SCOPE = ['email']
- SOCIAL_AUTH_FACEBOOK_KEY = '274540583911031' # Facebook App ID
- SOCIAL_AUTH_FACEBOOK_SECRET = '3f3e813f737a85f2bbaa821401380da9' # Facebook App Secret
- SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
- DEBUG_TOOLBAR_PATCH_SETTINGS = False
- INTERNAL_IPS = ('127.0.0.1',)
Add Comment
Please, Sign In to add comment