我正在尝试为我的研究创建一个Facebook提取器。为了这个目的我尝试了很多库,但是找不到一个例子。最后我已经达到了这个repository,我猜是我在找的东西。ImportError:无法在django应用程序中导入名称模式
但问题是,当我跑了,我凸轮跨以下错误E:
Performing system checks...
Unhandled exception in thread started by <function wrapper at 0x0000000004540518>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
self.check(display_num_errors=True)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Python27\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Python27\lib\site-packages\django\core\checks\urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "C:\Python27\lib\site-packages\django\core\checks\urls.py", line 26, in check_resolver
return check_method()
File "C:\Python27\lib\site-packages\django\urls\resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "C:\Python27\lib\site-packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Python27\lib\site-packages\django\urls\resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Python27\lib\site-packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Python27\lib\site-packages\django\urls\resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Users\lenovo-pc\Desktop\psa-allauth-master\example\urls.py", line 1, in <module>
from django.conf.urls import patterns, include, url
ImportError: cannot import name patterns
我感到相当这个错误感到困惑,因为我遇到它的第一次。告诉我我能做些什么来改进代码?我使用Django 1.11.5
和Python 2.7.2
。也没有关于社交认证的Django 1.11.5
的例子,所以任何人都可以帮助我。这将是一个很大的帮助。 如果我删除pattern
我得到以下错误:
File "C:\Python27\lib\site-packages\django\conf\urls\__init__.py", line 85, in url
raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().
导入错误是[此问题]的重复(https://stackoverflow.com/questions/38786036/importerror-cannot-import-name-patterns)。一旦你删除了导入,'视图必须是可调用的或者列表/元组'错误是[this one]的重复(https://stackoverflow.com/questions/38744285/django-urls-error-view - 必须是可调用的或列表中的元组) – Alasdair