簡體   English   中英

訪問主頁時出現Pythonanywhere錯誤

[英]Pythonanywhere error when accessing the homepage

當我訪問我的主頁(在 Pythonanywhere 上)時出現以下錯誤。 我相信 WSGI 文件中的所有設置都是正確的。 導入錯誤:沒有名為“myproject”的模塊 - 即使該模塊在那里。 這是我必須在某處定義的東西嗎?

錯誤如下:

2020-02-19 02:25:26,696: Error running WSGI application
2020-02-19 02:25:26,697: ImportError: No module named 'myproject'
2020-02-19 02:25:26,697:   File "/var/www/user1_pythonanywhere_com_wsgi.py", line 16, in <module>
2020-02-19 02:25:26,697:     application = get_wsgi_application()
2020-02-19 02:25:26,697: 
2020-02-19 02:25:26,697:   File "/home/user1/.virtualenvs/mysite-virtualenv/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2020-02-19 02:25:26,697:     django.setup(set_prefix=False)
2020-02-19 02:25:26,697: 
2020-02-19 02:25:26,697:   File "/home/user1/.virtualenvs/mysite-virtualenv/lib/python3.5/site-packages/django/__init__.py", line 19, in setup
2020-02-19 02:25:26,698:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2020-02-19 02:25:26,698: 
2020-02-19 02:25:26,698:   File "/home/user1/.virtualenvs/mysite-virtualenv/lib/python3.5/site-packages/django/conf/__init__.py", line 79, in __getattr__
2020-02-19 02:25:26,698:     self._setup(name)
2020-02-19 02:25:26,698: 
2020-02-19 02:25:26,698:   File "/home//.virtualenvs/mysite-virtualenv/lib/python3.5/site-packages/django/conf/__init__.py", line 66, in _setup
2020-02-19 02:25:26,698:     self._wrapped = Settings(settings_module)
2020-02-19 02:25:26,698: 
2020-02-19 02:25:26,699:   File "/home/user1/.virtualenvs/mysite-virtualenv/lib/python3.5/site-packages/django/conf/__init__.py", line 157, in __init__
2020-02-19 02:25:26,699:     mod = importlib.import_module(self.SETTINGS_MODULE)

在 PythonAnywhere 上,就在日志中出現異常之后,有一個指向幫助頁面的鏈接,可引導您調試 Web 應用程序中的導入錯誤。

我想到了。 這是路徑的問題。 我放棄了該應用程序並從頭開始重新創建它。 像魅力一樣工作!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM