我一直试图将我的Django项目首次推向网络,但是我一直收到内部服务器错误,我尝试了从站点周围的解决方案,但是它们无法为我提供帮助。
我的Apache错误日志是:
[Mon Nov 18 12:49:31.996083 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] Traceback (most recent call last):
[Mon Nov 18 12:49:31.996155 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/log_it/wsgi.py", line 16, in <module>
[Mon Nov 18 12:49:31.996159 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] application = get_wsgi_application()
[Mon Nov 18 12:49:31.996165 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/venv/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application [Mon Nov 18 12:49:31.996168 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] django.setup(set_prefix=False)
[Mon Nov 18 12:49:31.996173 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/venv/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
[Mon Nov 18 12:49:31.996176 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Mon Nov 18 12:49:31.996181 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 79, in __getattr__
[Mon Nov 18 12:49:31.996183 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] self._setup(name)
[Mon Nov 18 12:49:31.996188 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 66, in _setup
[Mon Nov 18 12:49:31.996190 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] self._wrapped = Settings(settings_module)
[Mon Nov 18 12:49:31.996195 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 157, in __init__
[Mon Nov 18 12:49:31.996198 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon Nov 18 12:49:31.996203 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
[Mon Nov 18 12:49:31.996205 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Nov 18 12:49:31.996209 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
[Mon Nov 18 12:49:31.996214 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[Mon Nov 18 12:49:31.996219 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[Mon Nov 18 12:49:31.996223 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
[Mon Nov 18 12:49:31.996797 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "<frozen importlib._bootstrap_external>", line 728, in exec_module
[Mon Nov 18 12:49:31.996807 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Mon Nov 18 12:49:31.996812 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/home/ib/personal_project/log_it/settings.py", line 17, in <module>
[Mon Nov 18 12:49:31.996814 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] config = json.load(config_file)
[Mon Nov 18 12:49:31.996819 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/usr/lib/python3.7/json/__init__.py", line 296, in load
[Mon Nov 18 12:49:31.996821 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
[Mon Nov 18 12:49:31.996826 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
[Mon Nov 18 12:49:31.996829 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] return _default_decoder.decode(s)
[Mon Nov 18 12:49:31.996833 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
[Mon Nov 18 12:49:31.996835 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] obj, end = self.raw_decode(s, idx=_w(s, 0).end())
[Mon Nov 18 12:49:31.996840 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode
[Mon Nov 18 12:49:31.996842 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] obj, end = self.scan_once(s, idx)
[Mon Nov 18 12:49:31.996859 2019] [wsgi:error] [pid 2673:tid 140041613797120] [remote 101.165.248.136:53820] json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 1 (char 146)
[Mon Nov 18 12:49:40.205665 2019] [wsgi:error] [pid 2673:tid 140041496299264] [remote 101.165.248.136:53824] mod_wsgi (pid=2673): Failed to exec Python script file '/home/ib/personal_project/log_it/wsgi.py'.
[Mon Nov 18 12:49:40.205711 2019] [wsgi:error] [pid 2673:tid 140041496299264] [remote 101.165.248.136:53824] mod_wsgi (pid=2673): Exception occurred processing WSGI script '/home/ib/personal_project/log_it/wsgi.py'.
如果您需要更多信息,我们将很乐意提供。
编辑
My config.json file (I slightly edited the keys to avoid giving away important info)
{
"SECRET_KEY": "(ff^j*0fiq1ctfh*5&ub^4-",
"EMAIL_USER": "ibyXXX@gmail.com",
"EMAIL_PASS": "akrkdxnz",
}
答案 0 :(得分:0)
JSON文件看起来像Python的字典,但是它有更多受限制的规则。
它不喜欢字典中最后一项后面的,
。它试图在,
之后找到下一个元素,这引起了问题。在最后一项之后删除,
。