Guest User

Untitled

a guest
Nov 24th, 2017
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty
  2.  
  3. export MYPROJECT_SECRET_KEY="very_long_fake_key"
  4.  
  5. #mod_wsgi
  6. LoadModule wsgi_module modules/mod_wsgi.so
  7.  
  8. WSGIScriptAlias / /home/shgr/projects/autozap/autozap/wsgi.py
  9. WSGIPythonHome /home/shgr/.virtualenvs/autozap
  10. WSGIPythonPath /home/shgr/projects/autozap/
  11.  
  12. <Directory /home/shgr/projects/autozap/autozap>
  13. <Files wsgi.py>
  14. Require all granted
  15. </Files>
  16. </Directory>
  17.  
  18. Alias /robots.txt /home/shgr/projects/autozap/static/robots.txt
  19. #Alias /favicon.ico /home/shgr/projects/autozap/favicon.ico
  20.  
  21. Alias /media/ /home/shgr/projects/autozap/media/
  22. Alias /static/ /home/shgr/projects/autozap/static/
  23.  
  24. <Directory /home/shgr/projects/autozap/static>
  25. Require all granted
  26. </Directory>
  27.  
  28. <Directory /home/shgr/projects/autozap/media>
  29. Require all granted
  30. </Directory>
  31.  
  32. #import_files
  33. Alias /import_files /home/shgr/projects/autozap/webdata/import_files
  34. <Directory /home/shgr/projects/autozap/webdata/import_files>
  35. Require all granted
  36. </Directory>
  37.  
  38. import os
  39.  
  40. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  41. BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
  42. REACT_APP_DIR = os.path.join(BASE_DIR, 'frontend')
  43.  
  44. # Quick-start development settings - unsuitable for production
  45. # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
  46.  
  47. # SECURITY WARNING: keep the secret key used in production secret!
  48. #SECRET_KEY = os.environ.get("AUTOZAP_SECRET_KEY")
  49. SECRET_KEY = "$hg@z4nus7^6!s7d-ku4ahjew_@!+&u1+*s7sq1--fake-fake"
  50.  
  51. # SECURITY WARNING: don't run with debug turned on in production!
  52. DEBUG = False
  53.  
  54. # Application definition
  55.  
  56. INSTALLED_APPS = [
  57. 'django.contrib.admin',
  58. 'django.contrib.auth',
  59. 'django.contrib.contenttypes',
  60. 'django.contrib.sessions',
  61. 'django.contrib.messages',
  62. 'rest_framework',
  63. 'website',
  64. ]
  65. # 'django.middleware.csrf.CsrfViewMiddleware'
  66. MIDDLEWARE = [
  67. 'django.middleware.security.SecurityMiddleware',
  68. 'django.contrib.sessions.middleware.SessionMiddleware',
  69. 'django.middleware.common.CommonMiddleware',
  70. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  71. 'django.contrib.messages.middleware.MessageMiddleware',
  72. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  73. ]
  74.  
  75. ROOT_URLCONF = 'autozap.urls'
  76.  
  77. TEMPLATES = [
  78. {
  79. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  80. 'DIRS': [],
  81. 'APP_DIRS': True,
  82. 'OPTIONS': {
  83. 'context_processors': [
  84. 'django.template.context_processors.debug',
  85. 'django.template.context_processors.request',
  86. 'django.contrib.auth.context_processors.auth',
  87. 'django.contrib.messages.context_processors.messages'
  88. ],
  89. },
  90. },
  91. ]
  92.  
  93. WSGI_APPLICATION = 'autozap.wsgi.application'
  94.  
  95.  
  96. # Password validation
  97. # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
  98.  
  99. AUTH_PASSWORD_VALIDATORS = [
  100. {
  101. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  102. },
  103. {
  104. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  105. },
  106. {
  107. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  108. },
  109. {
  110. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  111. },
  112. ]
  113.  
  114. # Internationalization
  115. # https://docs.djangoproject.com/en/1.11/topics/i18n/
  116.  
  117. LANGUAGE_CODE = 'ru-ru'
  118.  
  119. TIME_ZONE = 'Asia/Krasnoyarsk'
  120.  
  121. USE_I18N = True
  122.  
  123. USE_L10N = True
  124.  
  125. USE_TZ = True
  126.  
  127. # Static files (CSS, JavaScript, Images)
  128. # https://docs.djangoproject.com/en/1.11/howto/static-files/
  129.  
  130. STATIC_URL = '/static/'
  131.  
  132. STATIC_ROOT = 'static'
  133.  
  134. REST_FRAMEWORK = {
  135. 'UPLOADED_FILES_USE_URL': False
  136. }
  137.  
  138. from autozap.settings.base import *
  139.  
  140. import os
  141.  
  142. # Quick-start development settings - unsuitable for production
  143. # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
  144.  
  145. # SECURITY WARNING: keep the secret key used in production secret!
  146.  
  147. # SECURITY WARNING: don't run with debug turned on in production!
  148. DEBUG = False
  149.  
  150. ALLOWED_HOSTS = [
  151. 'fake.com',
  152. 'localhost',
  153. ]
  154.  
  155. #send_mail
  156. EMAIL_HOST = 'smtp.yandex.ru'
  157. EMAIL_PORT = 465
  158. EMAIL_HOST_USER = "fake@yandex.ru"
  159. EMAIL_USE_SSL = True
  160. EMAIL_HOST_PASSWORD = "fakefake"
  161.  
  162.  
  163. # Database
  164. # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
  165.  
  166.  
  167. DATABASES = {
  168. 'default': {
  169. 'ENGINE': 'django.db.backends.mysql',
  170. 'NAME': 'autozap',
  171. 'USER': 'root',
  172. 'PASSWORD': 'fake-fake',
  173. 'HOST': 'localhost',
  174. 'PORT': '3307',
  175. 'sql_mode': 'STRICT_TRANS_TABLES',
  176. }
  177. }
  178.  
  179. from autozap.settings.base import *
  180.  
  181. import os
  182.  
  183. DEBUG=True
  184.  
  185. ALLOWED_HOSTS = [
  186. 'localhost'
  187. ]
  188.  
  189. INSTALLED_APPS += [
  190. 'django.contrib.staticfiles'
  191. ]
  192.  
  193.  
  194. DATABASES = {
  195. 'default': {
  196. 'ENGINE': 'django.db.backends.mysql',
  197. 'NAME': 'autozap',
  198. 'USER': 'fake',
  199. 'PASSWORD': 'fakfake',
  200. 'HOST': 'localhost',
  201. 'PORT': '',
  202. 'sql_mode': 'STRICT_TRANS_TABLES',
  203. }
  204. }
  205.  
  206. #send_mail
  207. EMAIL_HOST = 'smtp.yandex.ru'
  208. EMAIL_PORT = 465
  209. EMAIL_HOST_USER = "fake@yandex.ru"
  210. EMAIL_USE_SSL = True
  211. EMAIL_HOST_PASSWORD = "fakfake"
  212.  
  213. STATICFILES_DIRS = [
  214. os.path.join(REACT_APP_DIR, 'build', 'static')
  215. ]
Add Comment
Please, Sign In to add comment