python连接MySQL

Mysql

http://mysql-python.sourceforge.net/MySQLdb.html   MySQLdb User's Guide

 


Project

创建django project

 

python manage.py shell 
>>> from django.db import connection
>>> cursor = connection.cursor()

 

django-admin.py startproject mysite .

 

   python manage.py startapp books

 

t 写道
MIDDLEWARE_CLASSES = (
#'django.contrib.messages.middleware.MessageMiddleware',
)

INSTALLED_APPS = (
'deploy.deployapp'
)
 
python manage.py validate

 

python manage.py sqlall **

 

python manage.py syncdb

 

Admin

   python manage.py createsuperuser

 

# Include these import statements...
from django.contrib import admin
admin.autodiscover()


# And include this URLpattern...
urlpatterns = patterns('',
# ...
(r'^admin/', include(admin.site.urls)),
# ...
)

 

你可能感兴趣的:(html,.net,mysql,python,django)