小程序分销

This commit is contained in:
jeremygan2021
2026-02-17 11:32:16 +08:00
parent 315f461a20
commit db401a7103
4 changed files with 29 additions and 3 deletions

View File

@@ -156,6 +156,10 @@ STATICFILES_DIRS = [
BASE_DIR / 'static',
]
# 媒体文件配置
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
# Django REST Framework配置
REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',

View File

@@ -18,3 +18,4 @@ urlpatterns = [
# 静态文件配置(开发环境)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)