Cannot import name patterns workaround for Django integrated Djangoueditor

Source: Internet
Author: User

Follow the 2.8.1 integrated djangoueditor editor for the Django Development Content management System (next day), prompting you to download the configuration after Https://github.com/zhangfisher/DjangoUeditor:

Importerror:cannot Import Name Patterns
In Baidu know to find https://zhidao.baidu.com/question/940615682979643572.html

"This feature declares deprecated. 1.10 officially removed in 1.9. Use Django 1.10 to switch to Django.conf.urls.url () "

Without checking the official documentation, bloggers use the Django version 1.10.5

Modify the urls.py file in the Djangoueditor directory to:

#coding: Utf-8 from
Django import VERSION
if Version[0:2]> (1,9): From
    django.conf.urls import URL
Elif version[0:2]> (1,3): from
    django.conf.urls import patterns, url-
else:
    from Django.conf.urls.defaults import patterns, url from the Views

import Get_ueditor_controller

if version[0:2]> ( 1,9):
	urlpatterns = [
	    url (R ' ^controller/$ ', Get_ueditor_controller)
	]
else:
	urlpatterns = Patterns (',
	    url (r ' ^controller/$ ', Get_ueditor_controller)
	)
can be used normally.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.