刚学 Django 安装
http://www.cnblogs.com/vamei/p/3531740.html 这篇文章里操作的
我执行完$python
manage.py migrate 之后 终端这样显示
`vagrant@Vbox-5-0-6:~/mysite$ python
manage.py migrate
/usr/lib/python2.7/dist-packages/
pkg_resources.py:1031: UserWarning: /home/vagrant/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)`
`/home/vagrant/mysite/mysite/
urls.py:36: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got mysite.views.first_page). Pass the callable instead.
url(r'^$', 'mysite.views.first_page'),`
`/home/vagrant/mysite/west/
urls.py:4: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got west.views.first_page). Pass the callable instead.
url(r'^$', 'west.views.first_page'),`
`/home/vagrant/mysite/west/
urls.py:4: RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.
url(r'^$', 'west.views.first_page'),`
`/home/vagrant/mysite/mysite/
urls.py:37: RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.
url(r'^west/', include('west.urls')),`
`Operations to perform:
Apply all migrations: admin, contenttypes, auth, sessions
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying sessions.0001_initial... OK`
我看字面意思是 我这种 url()写法在 Django 1.10 中不支持了 而且会被移除
那请问 正确的写法是什么 谢谢
urls.py 我这里这样写的
‘ from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'mysite.views.first_page'),
url(r'^west/', include('west.urls')),
)‘
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.