Advertisement
Rabin_BK

Untitled

Aug 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.62 KB | None | 0 0
  1. """
  2. Django settings for Mysite project.
  3.  
  4. Generated by 'django-admin startproject' using Django 1.8.7.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/1.8/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/1.8/ref/settings/
  11. """
  12.  
  13. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  14. import os
  15.  
  16. BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  17.  
  18.  
  19.  
  20. # Quick-start development settings - unsuitable for production
  21. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  22.  
  23. # SECURITY WARNING: keep the secret key used in production secret!
  24. #SECRET_KEY = '0&s2)q+5*cdbk#ni_d0)#5ec7dz(!@ij+0t3(nq9894xoli_h8'
  25. SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', '0&s2)q+5*cdbk#ni_d0)#5ec7dz(!@ij+0t3(nq9894xoli_h8')
  26.  
  27. # SECURITY WARNING: don't run with debug turned on in production!
  28. #DEBUG = False
  29. DEBUG = bool(os.environ.get('DJANGO_DEBUG', False))
  30. ALLOWED_HOSTS = ['bytesnepal.herokuapp.com','*']
  31.  
  32.  
  33. # Application definition
  34.  
  35. INSTALLED_APPS = (
  36.     'whitenoise.runserver_nostatic',
  37.     'django.contrib.admin',
  38.     'django.contrib.auth',
  39.     'django.contrib.contenttypes',
  40.     'django.contrib.sessions',
  41.     'django.contrib.messages',
  42.     'django.contrib.staticfiles',
  43.     'ckeditor',
  44.     'Mysite'    
  45. )
  46.  
  47. MIDDLEWARE_CLASSES = (
  48.     'django.middleware.security.SecurityMiddleware',
  49.     'whitenoise.middleware.WhiteNoiseMiddleware',
  50.     'django.contrib.sessions.middleware.SessionMiddleware',
  51.     'django.middleware.common.CommonMiddleware',
  52.     'django.middleware.csrf.CsrfViewMiddleware',
  53.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  54.     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  55.     'django.contrib.messages.middleware.MessageMiddleware',
  56.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  57.     'django.middleware.security.SecurityMiddleware',
  58. )
  59.  
  60. ROOT_URLCONF = 'Mysite.urls'
  61.  
  62. TEMPLATES = [
  63.     {
  64.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  65.         'DIRS': [os.path.join(BASE_DIR,'Mysite/templates')],
  66.         'APP_DIRS': True,
  67.         'OPTIONS': {
  68.             'context_processors': [
  69.                 'django.template.context_processors.debug',
  70.                 'django.template.context_processors.request',
  71.                 'django.contrib.auth.context_processors.auth',
  72.                 'django.contrib.messages.context_processors.messages',
  73.             ],
  74.         },
  75.     },
  76. ]
  77.  
  78. WSGI_APPLICATION = 'Mysite.wsgi.application'
  79.  
  80.  
  81. # Database
  82. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  83.  
  84. DATABASES = {
  85.     'default': {
  86.         'ENGINE': 'django.db.backends.sqlite3',
  87.         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  88.     }
  89. }
  90. import dj_database_url
  91. db_from_env = dj_database_url.config()
  92. DATABASES['default'].update(db_from_env)
  93. DATABASES['default']['CONN_MAX_AGE'] = 500
  94.  
  95.  
  96. # Internationalization
  97. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  98.  
  99.  
  100. LANGUAGE_CODE = 'en-us'
  101.  
  102. TIME_ZONE = 'UTC'
  103.  
  104. USE_I18N = True
  105.  
  106. USE_L10N = True
  107.  
  108. USE_TZ = True
  109.  
  110.  
  111. # Static files (CSS, JavaScript, Images)
  112. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  113.  
  114. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  115. STATICFILES_DIRS = (
  116.     os.path.join(os.path.normpath(BASE_DIR)),
  117. )
  118. STATIC_URL = '/static/'
  119.  
  120. MEDIA_URL = '/media/'
  121. CKEDITOR_UPLOAD_PATH = "uploads/"
  122.  
  123. STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  124. CKEDITOR_CONFIGS = {
  125.     'default': {
  126.         'toolbar': None,
  127.         'width': '100%',
  128.         'indent': False,
  129.     }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement