all django
This commit is contained in:
parent
6d7f38ee11
commit
d219c41bd9
|
@ -62,7 +62,7 @@ ROOT_URLCONF = 'server.urls'
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [],
|
'DIRS': ['dist'],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
|
@ -124,6 +124,7 @@ CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||||
|
STATICFILES_DIRS =[os.path.join(BASE_DIR, 'dist/static')]
|
||||||
|
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
|
|
|
@ -23,19 +23,22 @@ from rest_framework_simplejwt.views import (TokenObtainPairView,
|
||||||
TokenRefreshView)
|
TokenRefreshView)
|
||||||
|
|
||||||
from apps.system.views import FileViewSet, LogoutView, Login2View
|
from apps.system.views import FileViewSet, LogoutView, Login2View
|
||||||
|
from django.views.generic.base import TemplateView
|
||||||
router = routers.DefaultRouter()
|
router = routers.DefaultRouter()
|
||||||
router.register('file', FileViewSet, basename="file")
|
router.register('file', FileViewSet, basename="file")
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('', TemplateView.as_view(template_name="index.html")),
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
||||||
path('token2/', Login2View.as_view(), name='token_obtain_2'),
|
path('api/token2/', Login2View.as_view(), name='token_obtain_2'),
|
||||||
path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
||||||
path('token/black/', LogoutView.as_view(), name='token_black'),
|
path('api/token/black/', LogoutView.as_view(), name='token_black'),
|
||||||
path('system/', include('apps.system.urls')),
|
path('api/system/', include('apps.system.urls')),
|
||||||
path('ability/', include('apps.ability.urls')),
|
path('api/ability/', include('apps.ability.urls')),
|
||||||
path('docs/', include_docs_urls(title="接口文档",
|
path('api/docs/', include_docs_urls(title="接口文档",
|
||||||
authentication_classes=[], permission_classes=[])),
|
authentication_classes=[], permission_classes=[])),
|
||||||
path('', include(router.urls)),
|
path('api/', include(router.urls)),
|
||||||
|
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue