update pour les medias
This commit is contained in:
parent
dac999196c
commit
cad5114de8
@ -44,7 +44,7 @@ CORS_ALLOWED_ORIGINS = [
|
||||
"http://localhost:5173",
|
||||
'http://127.0.0.1:5173',
|
||||
'http://192.168.1.35:5173',
|
||||
'https://mybooklist.guams.fr'
|
||||
'https://mybooklist.guams.fr',
|
||||
'https://mybooklist-api.guams.fr'
|
||||
]
|
||||
|
||||
|
||||
@ -16,7 +16,8 @@ Including another URLconf
|
||||
"""
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path, re_path
|
||||
from django.views.static import serve
|
||||
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
|
||||
|
||||
from api import settings
|
||||
@ -33,4 +34,8 @@ urlpatterns = [
|
||||
path('api/users/<int:user_id>', views.find_user_by_id, name='user-detail'),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
urlpatterns += [
|
||||
re_path(r'^media/(?P<path>.*)$', serve, {
|
||||
'document_root': settings.MEDIA_ROOT,
|
||||
}),
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user