无法从django_pagseguro.urls导入pagseguro_urlpatterns

时间:2018-04-30 18:41:35

标签: python django

我使用python 3并安装django-pagseguro。 我试图在python shell中运行命令:

from django_pagseguro.urls import pagseguro_urlpatterns

并收到错误:

>>> from django_pagseguro.urls import pagseguro_urlpatterns
Traceback (most recent call last):
  File "C:\Users\patff\AppData\Local\conda\conda\envs\k36\lib\site-packages\django_pagseguro\urls.py", line 3, in <module>
    from django.conf.urls import patterns, url
ImportError: cannot import name 'patterns'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\patff\AppData\Local\conda\conda\envs\k36\lib\site-packages\django_pagseguro\urls.py", line 5, in <module>
    from django.conf.urls.defaults import patterns, url
ModuleNotFoundError: No module named 'django.conf.urls.defaults'

1 个答案:

答案 0 :(得分:1)

django-paseguro is trying to import patterns,所以它不支持Django 1.10+。失败的导入django.conf.urls.defaults是Django的后备&lt; 1.6。