????django??????????дMYSQL????????models.py?ж????model???????? python manage.py syncdb ??????????????????????????????????

class Publisher(models.Model):
name = models.CharField(max_length = 30)
address = models.CharField(max_length = 50)
city = models.CharField(max_length = 60)
state_province = models.CharField(max_length = 60)
country = models.CharField(max_length = 50)
website = models.URLField()
class Author(models.Model):
first_name = models.CharField(max_length = 30)
last_name = models.CharField(max_length = 40)
email = models.EmailField()
class Book(models.Model):
title = models.CharField(max_length = 50)
authors = models.ManyToManyField(Author)
publisher = models.ForeignKey(Publisher)
publish_date = models.DateField()

???????????????????MSQ???????????????????????????DJANGO???????SAE?????????????
????1. ????e?? SAE ????
????2. settings.py ?м??????′???

if True:
from sae._restful_mysql import monkey
monkey.patch()
MYSQL_HOST_M = 'w.rdc.sae.sina.com.cn'
MYSQL_PORT = '3307'
MYSQL_USER = 'APP_ACCESS'
MYSQL_PASS = 'APP_SECRET'
MYSQL_DB   = 'app_APP_NAME'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql'??
'NAME': MYSQL_DB??
'USER': MYSQL_USER??
'PASSWORD': MYSQL_PASS??
'HOST': MYSQL_HOST_M??
'PORT': MYSQL_PORT??
}
}

???????У? APP_ACCESS?? APP_SECRET?? APP_NAME ????sae????????????????????????????????????? sync db ????
???????????? True ??? False