Q&A
Djangoを使いwebアプリケーションを作りデプロイしようと思ったのですがrunserverでエラーが出たの解決策を教えてください。
環境
Mac version 10.13
vagrant 2.1.1
CentOS 7.0
python 3.4
Django 2.0.5
vagrant sshをして環境に入り、source bin/activateをしてDjangoにも入り以下のコマンドを打ちました。
python
1python3.4 manage.py runserver
以下がエラーの内容です。よろしくお願いします。
python
1raceback (most recent call last): 2 File "manage.py", line 15, in <module> 3 execute_from_command_line(sys.argv) 4 File "/usr/lib64/python3.4/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line 5 utility.execute() 6 File "/usr/lib64/python3.4/site-packages/django/core/management/__init__.py", line 365, in execute 7 self.fetch_command(subcommand).run_from_argv(self.argv) 8 File "/usr/lib64/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv 9 self.execute(*args, **cmd_options) 10 File "/usr/lib64/python3.4/site-packages/django/core/management/commands/runserver.py", line 61, in execute 11 super().execute(*args, **options) 12 File "/usr/lib64/python3.4/site-packages/django/core/management/base.py", line 335, in execute 13 output = self.handle(*args, **options) 14 File "/usr/lib64/python3.4/site-packages/django/core/management/commands/runserver.py", line 70, in handle 15 if not settings.DEBUG and not settings.ALLOWED_HOSTS: 16 File "/usr/lib64/python3.4/site-packages/django/conf/__init__.py", line 56, in __getattr__ 17 self._setup(name) 18 File "/usr/lib64/python3.4/site-packages/django/conf/__init__.py", line 43, in _setup 19 self._wrapped = Settings(settings_module) 20 File "/usr/lib64/python3.4/site-packages/django/conf/__init__.py", line 125, 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.
回答1件
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2018/06/01 09:00
2018/06/01 09:13
2018/06/03 17:01
2018/06/04 05:03 編集