ImportError: cannot import name patterns

前端 未结 3 2067
迷失自我
迷失自我 2020-12-17 09:13

Python Version: 2.7.5

Django Version: 1.10

When I type nohup python manage.py runserver 0.0.0.0:9001 it shows

相关标签:
3条回答
  • 2020-12-17 09:51

    I ran into this error when trying to install Django-Guardian. Instead of downgrading Django, you can install the latest version of Django-Guardian. Try,

    pip install 'django-guardian>=1.4.6'
    

    This resolved the issue for me.

    0 讨论(0)
  • 2020-12-17 09:55

    The use of patterns is deprecated in Django1.10. Therefore do not import 'patterns' and your url pattern should be as follows:

    from django.conf.urls import include, url
    
    urlpatterns=[
        url(r'^admin/', include(admin.site.urls)),
        url(........),
    ]
    
    0 讨论(0)
  • 2020-12-17 09:56

    Use of patterns is deprecated since django 1.8. See docs. You can use plain lists now.

    0 讨论(0)
提交回复
热议问题