Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. """
  2. Django settings for myproject project.
  3.  
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.8/topics/settings/
  6.  
  7. For the full list of settings and their values, see
  8. https://docs.djangoproject.com/en/1.8/ref/settings/
  9. """
  10.  
  11. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  12. import os
  13. DJ_PROJECT_DIR = os.path.dirname(__file__)
  14. BASE_DIR = os.path.dirname(DJ_PROJECT_DIR)
  15. WSGI_DIR = os.path.dirname(BASE_DIR)
  16. REPO_DIR = os.path.dirname(WSGI_DIR)
  17. DATA_DIR = os.environ.get('OPENSHIFT_DATA_DIR', BASE_DIR)
  18.  
  19. import sys
  20. sys.path.append(os.path.join(REPO_DIR, 'libs'))
  21. import secrets
  22. SECRETS = secrets.getter(os.path.join(DATA_DIR, 'secrets.json'))
  23.  
  24. # Quick-start development settings - unsuitable for production
  25. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  26.  
  27. # SECURITY WARNING: keep the secret key used in production secret!
  28. SECRET_KEY = SECRETS['secret_key']
  29.  
  30. # SECURITY WARNING: don't run with debug turned on in production!
  31. DEBUG = os.environ.get('DEBUG') == 'True'
  32.  
  33. from socket import gethostname
  34. ALLOWED_HOSTS = [
  35. gethostname(), # For internal OpenShift load balancer security purposes.
  36. os.environ.get('OPENSHIFT_APP_DNS'), # Dynamically map to the OpenShift gear name.
  37. #'example.com', # First DNS alias (set up in the app)
  38. #'www.example.com', # Second DNS alias (set up in the app)
  39. ]
  40.  
  41. EMAIL_HOST = 'smtp.gmail.com'
  42. EMAIL_HOST_USER = 'majorkeyeecs@gmail.com'
  43. EMAIL_HOST_PASSWORD = 'shakeelali'
  44. EMAIL_PORT = 587
  45. EMAIL_USE_TLS = True
  46.  
  47. # Application definition
  48.  
  49. INSTALLED_APPS = (
  50. 'store',
  51. 'django.contrib.admin',
  52. 'django.contrib.auth',
  53. 'django.contrib.contenttypes',
  54. 'django.contrib.sessions',
  55. 'django.contrib.messages',
  56. 'django.contrib.staticfiles',
  57. 'rest_framework',
  58. )
  59.  
  60. MIDDLEWARE_CLASSES = (
  61. 'django.contrib.sessions.middleware.SessionMiddleware',
  62. 'django.middleware.common.CommonMiddleware',
  63. 'django.middleware.csrf.CsrfViewMiddleware',
  64. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  65. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  66. 'django.contrib.messages.middleware.MessageMiddleware',
  67. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  68. )
  69.  
  70. # GETTING-STARTED: change 'myproject' to your project name:
  71. ROOT_URLCONF = 'webgroup.urls'
  72.  
  73. TEMPLATES = [
  74. {
  75. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  76. 'DIRS': [],
  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. ],
  85. },
  86. },
  87. ]
  88.  
  89. WSGI_APPLICATION = 'webgroup.wsgi.application'
  90.  
  91.  
  92. # Database
  93. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  94.  
  95. DATABASES = {
  96. 'default': {
  97. 'ENGINE': 'django.db.backends.sqlite3',
  98. # GETTING-STARTED: change 'db.sqlite3' to your sqlite3 database:
  99. 'NAME': os.path.join(DATA_DIR, 'db.sqlite3'),
  100. }
  101. }
  102.  
  103. # Internationalization
  104. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  105.  
  106. LANGUAGE_CODE = 'en-us'
  107.  
  108. TIME_ZONE = 'UTC'
  109.  
  110. USE_I18N = True
  111.  
  112. USE_L10N = True
  113.  
  114. USE_TZ = True
  115.  
  116.  
  117. # Static files (CSS, JavaScript, Images)
  118. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  119.  
  120. STATIC_URL = '/static/'
  121. STATIC_ROOT = os.path.join(WSGI_DIR, 'static')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement