· 9 years ago · Mar 24, 2017, 05:52 PM
1"""
2Django settings for myproject project.
3
4For more information on this file, see
5https://docs.djangoproject.com/en/1.8/topics/settings/
6
7For the full list of settings and their values, see
8https://docs.djangoproject.com/en/1.8/ref/settings/
9"""
10
11# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12import os
13DJ_PROJECT_DIR = os.path.dirname(__file__)
14BASE_DIR = os.path.dirname(DJ_PROJECT_DIR)
15WSGI_DIR = os.path.dirname(BASE_DIR)
16REPO_DIR = os.path.dirname(WSGI_DIR)
17DATA_DIR = os.environ.get('OPENSHIFT_DATA_DIR', BASE_DIR)
18
19import sys
20sys.path.append(os.path.join(REPO_DIR, 'libs'))
21import secrets
22SECRETS = 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!
28SECRET_KEY = SECRETS['secret_key']
29
30# SECURITY WARNING: don't run with debug turned on in production!
31DEBUG = os.environ.get('DEBUG') == 'True'
32
33from socket import gethostname
34ALLOWED_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
41EMAIL_HOST = 'smtp.gmail.com'
42EMAIL_HOST_USER = 'majorkeyeecs@gmail.com'
43EMAIL_HOST_PASSWORD = 'shakeelali'
44EMAIL_PORT = 587
45EMAIL_USE_TLS = True
46
47# Application definition
48
49INSTALLED_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
60MIDDLEWARE_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:
71ROOT_URLCONF = 'webgroup.urls'
72
73TEMPLATES = [
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
89WSGI_APPLICATION = 'webgroup.wsgi.application'
90
91
92# Database
93# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
94
95DATABASES = {
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
106LANGUAGE_CODE = 'en-us'
107
108TIME_ZONE = 'UTC'
109
110USE_I18N = True
111
112USE_L10N = True
113
114USE_TZ = True
115
116
117# Static files (CSS, JavaScript, Images)
118# https://docs.djangoproject.com/en/1.8/howto/static-files/
119
120STATIC_URL = '/static/'
121STATIC_ROOT = os.path.join(WSGI_DIR, 'static')