简体   繁体   中英

Error with Digital Ocean Droplet for Django

I have been following along with this tutorial to deploy my django site on Digital Ocean. I have just uploaded all my files and restarted gunicorn. The site is giving my this error:

ImportError at / No module named braces.views

And here is the traceback:

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

I have absolutely no clue what the problem could be. I was doing pretty well with figuring out my Django problem while just developing the app but now that I am trying to deploy the site and having to work with live servers I feel like I am starting from square one... Please help!

我只需要在服务器上运行pip install django-braces

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM