diff --git a/documents/常用命令.md b/documents/常用命令.md index e3d1a5f..ca63ecf 100644 --- a/documents/常用命令.md +++ b/documents/常用命令.md @@ -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 +``` + ## 启动 ``` diff --git a/project/settings.py b/project/settings.py index 25fc7d2..1e0ac02 100644 --- a/project/settings.py +++ b/project/settings.py @@ -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/