我已将该项目从其GitHub存储库中撤出:CGS Portal
我还安装了运行该项目所需的所有软件包,但是该项目无法成功运行。
Error Stack :
<br>python manage.py
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 317, in execute
settings.INSTALLED_APPS
File "C:\ProgramData\Anaconda3\lib\site-packages\django\conf\__init__.py", line 56, in __getattr__
self._setup(name)
File "C:\ProgramData\Anaconda3\lib\site-packages\django\conf\__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "C:\ProgramData\Anaconda3\lib\site-packages\django\conf\__init__.py", line 106, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\chandan\Documents\GGS-portal-master\school\settings.py", line 25, in <module>
SECRET_KEY = config('SECRET_KEY')
File "C:\ProgramData\Anaconda3\lib\site-packages\decouple.py", line 197, in __call__
return self.config(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\decouple.py", line 85, in __call__
return self.get(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\decouple.py", line 70, in get
raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))
decouple.UndefinedValueError: SECRET_KEY not found. Declare it as envvar or define a default value.
答案 0 :(得分:1)
确认您已安装Django,并确认您实际上是在参考设置文件。
在Venv中执行pip freeze
以确认已安装Django
确保启动时不必显式调用设置文件
python manage.py runserver --settings=yourproj.settings.production