· 7 years ago · Apr 12, 2018, 10:30 AM
1Traceback (most recent call last):
2 File "manage.py", line 10, in <module>
3 execute_from_command_line(sys.argv)
4 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
5 utility.execute()
6 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
7 self.fetch_command(subcommand).run_from_argv(self.argv)
8 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
9 self.execute(*args, **cmd_options)
10 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 61, in execute
11 super(Command, self).execute(*args, **options)
12 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
13 output = self.handle(*args, **options)
14 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 72, in handle
15 if not settings.DEBUG and not settings.ALLOWED_HOSTS:
16 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
17 self._setup(name)
18 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
19 self._wrapped = Settings(settings_module)
20 File "/Users/jeetpatel/final-tribute/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 129, in __init__
21 raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
22django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
23
24import os
25import smtplib
26
27BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
28SITE_NAME = 'final-tribute'
29
30# Allow all host headers
31ALLOWED_HOSTS = []
32
33# AUTH_PROFILE_MODULE = 'profiles.Profile'
34LOGIN_REDIRECT_URL = '/profiles/'
35LOGIN_URL = '/'
36
37ADMINS = (
38 ('Ab Rao', 'abc@abc.in')
39)
40
41MANAGERS = ADMINS
42
43# Quick-start development settings - unsuitable for production
44# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
45
46# Application definition
47
48DJANGO_APPS = (
49 'django.contrib.admin',
50 'django.contrib.auth',
51 'django.contrib.contenttypes',
52 'django.contrib.sessions',
53 'django.contrib.messages',
54 'django.contrib.staticfiles',
55 'django.contrib.postgres',
56 # 'social.apps.django_app.default',
57)
58
59THIRD_PARTY_APPS = (
60 'rest_framework',
61 'rest_framework.authtoken',
62 'social.apps.django_app.default',
63 'micawber.contrib.mcdjango',
64 'paypal.standard.ipn',
65 # 'django_extensions',
66 # 'storages',
67)
68
69LOCAL_APPS = (
70 'core',
71 'login',
72 'profiles',
73 'tributes',
74 'testimonials',
75 'anecdotes',
76 'family_tree',
77 'timeline',
78 'gallery',
79 'general',
80 'customauth',
81 'myapp'
82)
83
84INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
85
86MIDDLEWARE_CLASSES = (
87 'django.middleware.security.SecurityMiddleware',
88 'whitenoise.middleware.WhiteNoiseMiddleware',
89 'django.contrib.sessions.middleware.SessionMiddleware',
90 'django.middleware.common.CommonMiddleware',
91 'django.middleware.csrf.CsrfViewMiddleware',
92 'django.contrib.auth.middleware.AuthenticationMiddleware',
93 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
94 'django.contrib.messages.middleware.MessageMiddleware',
95 'django.middleware.clickjacking.XFrameOptionsMiddleware',
96 'core.get_username.RequestMiddleware'
97)
98
99ROOT_URLCONF = 'ft.urls'
100HOST_URL = os.environ.get('HOST_URL')
101WSGI_APPLICATION = 'ft.wsgi.application'
102AUTH_USER_MODEL = 'customauth.User'
103
104TEMPLATES = [
105 {
106 'BACKEND': 'django.template.backends.django.DjangoTemplates',
107 'DIRS': [os.path.join(BASE_DIR, 'templates'), ],
108 'APP_DIRS': True,
109 'OPTIONS': {
110 'context_processors': [
111 'django.template.context_processors.debug',
112 'django.template.context_processors.request',
113 'django.contrib.auth.context_processors.auth',
114 'django.contrib.messages.context_processors.messages',
115 ],
116 },
117 },
118]
119
120# -------------------------------------------------------
121#
122# Settings to be set in local/prod/staging setting files
123#
124# --------------------------------------------------------
125SECRET_KEY = "foo"
126DEBUG = False
127DATABASES = {
128 #'default': {
129 # 'ENGINE': 'django.db.backends.mysql',
130 # 'NAME': 'db',
131 # 'USER': 'user',
132 #'PASSWORD': 'db_user',
133 #'HOST': 'localhost',
134 #'PORT': '3306',
135 }
136}
137
138PAYPAL_TEST = True
139
140# AWS Settings
141AWS_QUERYSTRING_AUTH = False
142AWS_ACCESS_KEY_ID = ""
143AWS_SECRET_ACCESS_KEY = ""
144AWS_STORAGE_BUCKET_NAME = 'finaltribute-dev'
145MEDIA_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
146DEFAULT_FILE_STORAGE = "storages.backends.s3boto.S3BotoStorage"
147# --------------------------------------------------------
148
149# Internationalization
150# https://docs.djangoproject.com/en/1.8/topics/i18n/
151
152LANGUAGE_CODE = 'en-us'
153TIME_ZONE = 'Asia/Kolkata'
154USE_I18N = True
155USE_L10N = True
156USE_TZ = True
157
158# Honor the 'X-Forwarded-Proto' header for request.is_secure()
159SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
160
161# Static files (CSS, JavaScript, Images)
162# https://docs.djangoproject.com/en/1.7/howto/static-files/
163
164STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')
165STATIC_URL = '/static/'
166#MEDIA_ROOT = os.path.join(BASE_DIR, 'media_root')
167STATICFILES_DIRS = [
168 os.path.join(BASE_DIR, 'static')
169]
170
171
172# Rest framework settings
173REST_FRAMEWORK = {
174 'PAGINATE_BY': 10,
175 'PAGINATE_BY_PARAM': 'page_size',
176 'MAX_PAGINATE_BY': 100,
177 'DEFAULT_AUTHENTICATION_CLASSES': (
178 'rest_framework.authentication.SessionAuthentication',
179 'rest_framework.authentication.BasicAuthentication',
180 ),
181 'DEFAULT_PERMISSION_CLASSES': (
182 'rest_framework.permissions.IsAdminUser',
183 ),
184 'DEFAULT_FILTER_BACKENDS': (
185 'rest_framework.filters.DjangoFilterBackend',
186 ),
187}
188
189# temp <- FIXME this needs to go into local/prod/staging files.
190EMAIL_USE_TLS = True
191EMAIL_HOST = os.environ.get('EMAIL_HOST')
192EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
193EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
194EMAIL_PORT = os.environ.get('EMAIL_PORT')
195BASIC_WWW_AUTHENTICATION_USERNAME = "ftwalla"
196BASIC_WWW_AUTHENTICATION_PASSWORD = "ftwalla"
197BASIC_WWW_AUTHENTICATION = True
198
199from __future__ import absolute_import
200
201#!/usr/bin/env python
202import os
203import sys
204
205if __name__ == "__main__":
206
207 from django.core.management import execute_from_command_line
208
209 execute_from_command_line(sys.argv)