from django.conf.urls import *找不到patterns模块? Django-1.10,python27
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了from django.conf.urls import *找不到patterns模块? Django-1.10,python27相关的知识,希望对你有一定的参考价值。
这个特性在1.9就声明了deprecated. 1.10正式移除了。使用 django 1.10 需要改用 django.conf.urls.url() 示范代码:
from django.conf.urls import urlfrom . import views
urlpatterns = [
url(r'^articles/2003/$', views.special_case_2003),
url(r'^articles/([0-9]4)/$', views.year_archive),
url(r'^articles/([0-9]4)/([0-9]2)/$', views.month_archive),
url(r'^articles/([0-9]4)/([0-9]2)/([0-9]+)/$', views.article_detail),
] 参考技术A
使用 django 1.10 需要改用 django.conf.urls.url() 代码:
12345678910from django.conf.urls import url from . import views urlpatterns = [ url(r'^articles/2003/$', views.special_case_2003), url(r'^articles/([0-9]4)/$', views.year_archive), url(r'^articles/([0-9]4)/([0-9]2)/$', views.month_archive), url(r'^articles/([0-9]4)/([0-9]2)/([0-9]+)/$', views.article_detail),]
一个使用QtXmlPatterns模块读取xml 的例子:
#include <QApplication>
#include <QFile>
#include <QBuffer>
#include <QIODevice>
#include <QtXmlPatterns>
#include <QXmlFormatter>
#include <QLabel>
int main(int argc, char *argv[])
QApplication app(argc, argv);
QFile sourceDocument;
sourceDocument.setFileName("cookbook.xml");
sourceDocument.open(QIODevice::ReadOnly);
QXmlQuery query;
query.bindVariable("inputDocument", &sourceDocument);
//之所以要将绑定 inputDocument 变量,估计是为了把需要查询的 xml 文件设置为可读模式,然后才能 setQuery 查询。
以上是关于from django.conf.urls import *找不到patterns模块? Django-1.10,python27的主要内容,如果未能解决你的问题,请参考以下文章