gpt4 book ai didi

python - 无法从 django_pagseguro.urls 导入 pagseguro_urlpatterns

转载 作者:行者123 更新时间:2023-12-01 09:29:14 26 4
gpt4 key购买 nike

我使用 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'

最佳答案

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

关于python - 无法从 django_pagseguro.urls 导入 pagseguro_urlpatterns,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50106372/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com