Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

for django in sae

Project Description
#django-sae

[![PyPI version](https://badge.fury.io/py/django-sae.png)](http://badge.fury.io/py/django-sae)

用于新浪云平台SAE

### 扩展命令
* compress_site_packages:压缩 site_packages
* upgrade_requirements:更新requirements.txt中所有依赖的库
* sae_migrate:切换到SAE数据库,并进行migrate操作

使用sae_migrate等与数据库相关的扩展命令时,请手工获取SAE数据库的相关常数,如MYSQL_DB、MYSQL_USER、MYSQL_PASS等,并在settings中对DATABASES进行修改。

### 数据库
如需数据库读写操作分离,请在settings中进行设置(示例如下):
```python
from sae.const import MYSQL_HOST, MYSQL_HOST_S, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': MYSQL_DB,
'USER': MYSQL_USER,
'PASSWORD': MYSQL_PASS,
'HOST': MYSQL_HOST,
'PORT': MYSQL_PORT,
'OPTIONS': {'init_command': "SET storage_engine=MYISAM;"},
},
'slave': {
'ENGINE': 'django.db.backends.mysql',
'NAME': MYSQL_DB,
'USER': MYSQL_USER,
'PASSWORD': MYSQL_PASS,
'HOST': MYSQL_HOST_S,
'PORT': MYSQL_PORT,
'OPTIONS': {'init_command': "SET storage_engine=MYISAM;"},
},
}
DATABASE_ROUTERS = ['django_sae.db.routers.MasterSlaveRouter']
```

### 缓存
使用 SAE Memcache 服务时,请在settings中进行设置(示例如下):
```python
CACHES={
'default': {
'BACKEND': 'django_sae.cache.backends.SaePyLibMCCache',
}
}
```

### 日志
使用日志过滤器RequireInSAE和RequireNotInSAE时,请在settings中进行设置(示例如下):
```python
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'filters': {
'require_in_sae': {
'()': 'django_sae.utils.log.RequireInSAE',
},
'require_not_in_sae': {
'()': 'django_sae.utils.log.RequireNotInSAE',
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'filters': [ 'require_in_sae'],
},
},
'loggers': {
'django': {
'handlers': ['console'],
},
}
}
```



.. :changelog:

Release History
---------------

0.2.1 (2014-06-27)
++++++++++++++++++

- 删除模块:http(Django1.7已支持JsonResponse)
- 修改设置:LANGUAGE_CODE为zh-hans(zh-cn从1.9版本后弃用)

0.2.0 (2014-05-17)
++++++++++++++++++

- 修改扩展命令:sae_migrate(使用Django1.7自带的migrate命令)
- 删除扩展命令:sae_syncdb(Django1.7已移除syncdb命令)

0.1.23 (2014-03-21)
++++++++++++++++++

- 添加日志过滤器:RequireInSAE,RequireNotInSAE

0.1.21 (2014-03-20)
++++++++++++++++++

- 删除扩展命令:sae_schemamigration(因为此命令不需要链接SAE数据库)

0.1.18 (2014-03-19)
++++++++++++++++++

- 添加扩展命令:upgrade_requirements

0.1.13 (2014-03-18)
++++++++++++++++++

- 重命名扩展命令: updatepackages -> compress_site_packages,
- 添加扩展命令:sae_migrate, sae_schemamigration, sae_syncdb

0.1.11 (2014-03-17)
++++++++++++++++++

- commands(扩展命令): updatepackages(更新依赖库并压缩为site-packages.zip)

0.1.1 (2014-03-16)
++++++++++++++++++

- patches: 自动设置
- conf: SAE平台的默认设置

0.1.0 (2014-03-15)
++++++++++++++++++

- db: 通用模型和读写分离
- cache: 缓存模型
- utils: 时间戳模块和装饰模块
- tasks: 用于执行任务
Release History

Release History

This version
History Node

0.2.1

History Node

0.2.0

History Node

0.1.30

History Node

0.1.29

History Node

0.1.27

History Node

0.1.26

History Node

0.1.25

History Node

0.1.24

History Node

0.1.23

History Node

0.1.22

History Node

0.1.21

History Node

0.1.20

History Node

0.1.19

History Node

0.1.18

History Node

0.1.17

History Node

0.1.16

History Node

0.1.15

History Node

0.1.14

History Node

0.1.13

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-sae-0.2.1.zip (31.2 kB) Copy SHA256 Checksum SHA256 Source Jun 27, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting