首页 > 其他 > 详细

django demo

时间:2016-07-16 06:45:23      阅读:165      评论:0      收藏:0      [点我收藏+]

1.

$ django-admin startproject mysite

 2.

$ python manage.py runserver

 3.

$ python manage.py migrate

 4.

$ python manage.py makemigrations polls

 5.

$ python manage.py sqlmigrate polls 0001

 6.

$ python manage.py migrate

 

Migrations are very powerful and let you change your models over time, as you develop your project, without the need to delete your database or tables and make new ones - it specializes in upgrading your database live, without losing data. We’ll cover them in more depth in a later part of the tutorial, but for now, remember the three-step guide to making model changes:

The url() function is passed four arguments, two required: regex and view, and two optional: kwargs, and name. At this point, it’s worth reviewing what these arguments are for.

 

django demo

原文:http://www.cnblogs.com/seemann/p/5675146.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!