teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

settings.pyの内容を記載

2018/12/26 16:22

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -64,6 +64,143 @@
64
64
  =========================== 1 error in 0.55 seconds ===========================
65
65
  Process finished with exit code 0
66
66
 
67
+ # settings.py
68
+ ```python
69
+ # -*- coding: utf-8 -*-
70
+
71
+ import os
72
+ from django.core.mail import send_mail
73
+
74
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
75
+
76
+ SECRET_KEY = 'secret'
77
+
78
+ DEBUG = True
79
+
80
+ ALLOWED_HOSTS = ['127.0.0.1', 'test.com']
81
+
82
+ EMAIL_HOST = 'localhost'
83
+ EMAIL_PORT = 1025
84
+
85
+ INSTALLED_APPS = [
86
+ 'jet',
87
+ 'app.apps.AppConfig',
88
+ 'django.contrib.admin',
89
+ 'django.contrib.auth',
90
+ 'django.contrib.contenttypes',
91
+ 'django.contrib.sessions',
92
+ 'django.contrib.messages',
93
+ 'django.contrib.staticfiles',
94
+ 'django.contrib.sites',
95
+ 'django.contrib.sitemaps',
96
+ 'social.apps.django_app.default',
97
+ 'django_extensions',
98
+ 'social_django',
99
+ 'import_export',
100
+ 'bootstrap_toolkit',
101
+ 'django.contrib.humanize',
102
+ ]
103
+
104
+ SITE_ID = 1
105
+
106
+ LOCALE_PATHS = [
107
+ os.path.join(BASE_DIR, 'locale'),
108
+ ]
109
+
110
+ MIDDLEWARE = [
111
+ 'django.middleware.security.SecurityMiddleware',
112
+ 'django.contrib.sessions.middleware.SessionMiddleware',
113
+ 'django.middleware.locale.LocaleMiddleware',
114
+ 'django.middleware.common.CommonMiddleware',
115
+ 'django.middleware.csrf.CsrfViewMiddleware',
116
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
117
+ 'django.contrib.messages.middleware.MessageMiddleware',
118
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
119
+ ]
120
+
121
+ if DEBUG:
122
+ INTERNAL_IPS = ('127.0.0.1',)
123
+ MIDDLEWARE += (
124
+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
125
+ )
126
+
127
+ INSTALLED_APPS += (
128
+ 'debug_toolbar',
129
+ )
130
+ DEBUG_TOOLBAR_PANELS = [
131
+ 'debug_toolbar.panels.versions.VersionsPanel',
132
+ 'debug_toolbar.panels.timer.TimerPanel',
133
+ 'debug_toolbar.panels.settings.SettingsPanel',
134
+ 'debug_toolbar.panels.headers.HeadersPanel',
135
+ 'debug_toolbar.panels.request.RequestPanel',
136
+ 'debug_toolbar.panels.sql.SQLPanel',
137
+ 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
138
+ 'debug_toolbar.panels.templates.TemplatesPanel',
139
+ 'debug_toolbar.panels.cache.CachePanel',
140
+ 'debug_toolbar.panels.signals.SignalsPanel',
141
+ 'debug_toolbar.panels.logging.LoggingPanel',
142
+ 'debug_toolbar.panels.redirects.RedirectsPanel',
143
+ ]
144
+
145
+ DEBUG_TOOLBAR_CONFIG = {
146
+ 'INTERCEPT_REDIRECTS': False,
147
+ }
148
+
149
+ ROOT_URLCONF = 'project.urls'
150
+
151
+ TEMPLATES = [
152
+ {
153
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
154
+ 'DIRS': [],
155
+ 'APP_DIRS': True,
156
+ 'OPTIONS': {
157
+ 'context_processors': [
158
+ 'django.template.context_processors.debug',
159
+ 'django.template.context_processors.request',
160
+ 'django.contrib.auth.context_processors.auth',
161
+ 'django.contrib.messages.context_processors.messages',
162
+ 'social.apps.django_app.context_processors.backends',
163
+ 'social.apps.django_app.context_processors.login_redirect',
164
+ 'django.template.context_processors.static',
165
+ ],
166
+ },
167
+ },
168
+ ]
169
+
170
+ AUTHENTICATION_BACKENDS = (
171
+ 'social_core.backends.facebook.FacebookOAuth2',
172
+ 'django.contrib.auth.backends.ModelBackend',
173
+ )
174
+
175
+ LOGIN_REDIRECT_URL = '/'
176
+ AUTH_USER_MODEL = 'app.CustomUser'
177
+
178
+ WSGI_APPLICATION = 'project.wsgi.application'
179
+
180
+ DATABASES = {
181
+ }
182
+ }
183
+
184
+ LANGUAGE_CODE = 'en-us'
185
+
186
+ TIME_ZONE = 'Asia/Tokyo'
187
+
188
+ USE_I18N = True
189
+
190
+ USE_L10N = True
191
+
192
+ USE_TZ = False
193
+
194
+ STATIC_URL = '/static/'
195
+
196
+ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
197
+ MEDIA_URL = '/media/'
198
+
199
+ STATIC_ROOT = os.path.join(BASE_DIR, "/app/static/")
200
+
201
+ ```
202
+
203
+
67
204
  どこの設定を直せばよいか、手掛かりが分からず困っております。
68
205
  お気づきの点があれば、ご教示頂ければ幸いです。
69
206
  よろしくお願い致します。