小编Wat*_*tch的帖子

Django-'模块'对象不可调用

我正在尝试使用django从数据库提供图像,但是当我添加时

+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Run Code Online (Sandbox Code Playgroud)

到我的urlpatterns我收到此错误:/:模块对象处的TypeError无法调用

这是回溯:

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  35.             response = get_response(request)

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  113.         resolver_match = resolver.resolve(request.path_info)

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/urls/resolvers.py" in resolve
  494.             for pattern in self.url_patterns:

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/utils/functional.py" in __get__
  36.         res = instance.__dict__[self.name] = self.func(instance)

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/urls/resolvers.py" in url_patterns
  536.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/utils/functional.py" in __get__
  36.         res = instance.__dict__[self.name] = self.func(instance)

File "/home/watch/Documents/projects/herokuapp/venv/lib/python3.6/site-packages/django/urls/resolvers.py" in urlconf_module
  529.             return import_module(self.urlconf_name)

File "/usr/lib/python3.6/importlib/__init__.py" in import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>" …
Run Code Online (Sandbox Code Playgroud)

python django heroku

0
推荐指数
1
解决办法
1716
查看次数

标签 统计

django ×1

heroku ×1

python ×1