feat: 权限, 用户, 角色

This commit is contained in:
Czw 2021-11-08 17:40:10 +08:00
parent 5068d99c43
commit 8403fb89ea
2 changed files with 19 additions and 0 deletions

View file

@ -8,6 +8,14 @@ http://127.0.0.1:8000/api/schema/redoc/
http://127.0.0.1:8000/api/
```
## 构建
```
python manage.py makemigrations
python manage.py migrate
python manage.py shell_plus
```
## 启动
```

View file

@ -154,6 +154,17 @@ MEDIA_ROOT = BASE_DIR / 'media'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Django REST framework
# https://www.django-rest-framework.org/
REST_FRAMEWORK = {
'DATETIME_FORMAT': "%Y-%m-%d %H:%M:%S",
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
'DEFAULT_AUTHENTICATION_CLASSES': ['extensions.authentications.BaseAuthentication'],
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
}
# Simple JWT
# https://django-rest-framework-simplejwt.readthedocs.io/en/latest/