0
我一直在跟着本教程在Digital Ocean上部署我的django站點。我剛剛上傳了所有文件,並重新啓動了gunicorn。該網站是給我這個錯誤:Django數字海洋液滴的錯誤
ImportError at/No module named braces.views
這裏是回溯:
Traceback Switch to copy-and-paste view
/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py in inner
response = get_response(request) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in _legacy_get_response
response = self._get_response(request) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in _get_response
resolver_match = resolver.resolve(request.path_info) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py in resolve
for pattern in self.url_patterns: ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/utils/functional.py in __get__
res = instance.__dict__[self.name] = self.func(instance) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/utils/functional.py in __get__
res = instance.__dict__[self.name] = self.func(instance) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py in urlconf_module
return import_module(self.urlconf_name) ...
▶ Local vars
/usr/lib/python2.7/importlib/__init__.py in import_module
__import__(name) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/gevent/builtins.py in __import__
result = _import(*args, **kwargs) ...
▶ Local vars
/home/django/django_project/django_project/urls.py in <module>
from blog import views ...
▶ Local vars
/usr/lib/python2.7/dist-packages/gevent/builtins.py in __import__
result = _import(*args, **kwargs) ...
▶ Local vars
/home/django/django_project/blog/views.py in <module>
from braces.views import SelectRelatedMixin ...
▶ Local vars
/usr/lib/python2.7/dist-packages/gevent/builtins.py in __import__
result = _import(*args, **kwargs) ...
▶ Local vars
我完全不知道這個問題可能是什麼。我在開發應用程序時計算出我的Django問題時表現相當不錯,但現在我正在嘗試部署該網站,並且需要使用活動服務器,我覺得我是從一個平臺開始的......請幫助!
您是否使用gunicorn作爲服務器? –
是的,我相信是這樣,現在我實際上有一個不同的問題,它只是說'502壞的網關',所以我什麼都做不了 – Garrett
我有這個模塊錯誤一次(我只有數字海洋上的液滴) 。該錯誤發生是因爲我沒有將'django-path變量'導出到服務器。另外,由於你的服務器不能正常工作,它顯示出錯誤的網關錯誤。 –