File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change 1
1
# 主要功能配置介绍:
2
2
3
3
## 缓存:
4
- 缓存默认使用` memcache ` 缓存,如果你没有` memcache ` 环境,则将` settings.py ` 中的` locmemcache ` 改为` default ` ,并删除默认的` default ` 配置即可。
5
- ``` python
6
- CACHES = {
7
- ' default' : {
8
- ' BACKEND' : ' django.core.cache.backends.memcached.MemcachedCache' ,
9
- ' LOCATION' : ' 127.0.0.1:11211' ,
10
- ' KEY_PREFIX' : ' django_test' if TESTING else ' djangoblog' ,
11
- ' TIMEOUT' : 60 * 60 * 10
12
- },
13
- ' locmemcache' : {
14
- ' BACKEND' : ' django.core.cache.backends.locmem.LocMemCache' ,
15
- ' TIMEOUT' : 10800 ,
16
- ' LOCATION' : ' unique-snowflake' ,
17
- }
18
- }
19
- ```
4
+ 缓存默认使用` localmem ` 缓存,如果你有` redis ` 环境,可以设置` DJANGO_REDIS_URL ` 环境变量,则会自动使用该redis来作为缓存,或者你也可以直接修改如下代码来使用。
5
+ https://github.com/liangliangyy/DjangoBlog/blob/ffcb2c3711de805f2067dd3c1c57449cd24d84ee/djangoblog/settings.py#L185-L199
6
+
7
+
20
8
## oauth登录:
21
9
22
10
现在已经支持QQ,微博,Google,GitHub,Facebook登录,需要在其对应的开放平台申请oauth登录权限,然后在
@@ -63,6 +51,7 @@ django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the dja
63
51
```
64
52
可能是因为你的mysql版本低于5.6,需要升级mysql版本>=5.6即可。
65
53
54
+
66
55
django 4.0登录可能会报错CSRF,需要配置下` settings.py ` 中的` CSRF_TRUSTED_ORIGINS `
67
56
68
57
https://github.com/liangliangyy/DjangoBlog/blob/master/djangoblog/settings.py#L39
You can’t perform that action at this time.
0 commit comments