SAE python django ????????????
???????????? ???????[ 2014/2/12 9:08:54 ] ????????MYSQL ?????
????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
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11