Why we need model on Django ?

 

step01:

create a database name as (django_db) on mysql ...

 

step02:

configure your django to use the mysql ...

vim settings.py

modify the DATABASES item ...

 

step03:

check whether you have install it success ...

python manage.py shell

 

If you just see something  like ( >>> )

mean you have success ...

 

step04:

For use our database,we should create a app

python manage.py startapp books
cd books
tree

 

step05:

vim models.py

 

Write the below code  ...

 

posted @ 2015-07-08 14:34  Landpack  阅读(156)  评论(0编辑  收藏  举报