Browse Source

change static url

ilya_shyian 2 years ago
parent
commit
b85e6197c4
2 changed files with 4 additions and 4 deletions
  1. 2 2
      store_back/settings.py
  2. 2 2
      store_back/urls.py

+ 2 - 2
store_back/settings.py

@@ -137,10 +137,10 @@ DATABASES = {
 # https://docs.djangoproject.com/en/4.0/howto/static-files/
 
 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
-STATIC_URL = '/static/'
+STATIC_URL = 'api/static/'
 
 MEDIA_ROOT = os.path.join(BASE_DIR, 'media').replace('\\', '/')
-MEDIA_URL = '/media/'
+MEDIA_URL = 'api/media/'
 
 
 # Default primary key field type

+ 2 - 2
store_back/urls.py

@@ -13,10 +13,10 @@ urlpatterns = [
     path('api/', include('goods.urls')),
     path('api/', include('orders.urls')),
     path('api/', include('categories.urls')),
-    path('upload/',image_upsert),
+    path('api/upload/',image_upsert),
     path('api/auth/',include('authAPI.urls')),
     path('api/admin/', admin.site.urls),
-    path('graphql/',csrf_exempt(GraphQLView.as_view(
+    path('api/graphql/',csrf_exempt(GraphQLView.as_view(
         graphiql=True,
         schema = schema
     )))