Jelajahi Sumber

Fix Le Static Files

Colin Powell 2 tahun lalu
induk
melakukan
ee232aa103

File diff ditekan karena terlalu besar
+ 11 - 0
vrobbler/apps/scrobbles/static/css/bootstrap.min.css


+ 0 - 0
vrobbler/static/images/apple-touch-icon.png → vrobbler/apps/scrobbles/static/images/apple-touch-icon.png


+ 0 - 0
vrobbler/static/images/favicon.ico → vrobbler/apps/scrobbles/static/images/favicon.ico


+ 1 - 2
vrobbler/settings.py

@@ -231,11 +231,10 @@ USE_TZ = True
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/3.1/howto/static-files/
 
-STATIC_URL = "static/"
+STATIC_URL = "/static/"
 STATIC_ROOT = os.getenv(
     "VROBBLER_STATIC_ROOT", os.path.join(PROJECT_ROOT, "static")
 )
-
 MEDIA_URL = "/media/"
 MEDIA_ROOT = os.getenv(
     "VROBBLER_MEDIA_ROOT", os.path.join(PROJECT_ROOT, "media")

+ 1 - 0
vrobbler/templates/base.html

@@ -10,6 +10,7 @@
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <link rel="shortcut icon" type="image/png" href="{% static 'images/favicon.ico' %}"/>
         <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
+        <link href="{% static 'css/bootstrap.min.css'  %}" rel="stylesheet">
         <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" crossorigin="anonymous"></script>
         <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
         <script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>

+ 1 - 12
vrobbler/urls.py

@@ -1,10 +1,8 @@
-import scrobbles.views as scrobbles_views
-from django.conf import settings
-from django.conf.urls.static import static
 from django.contrib import admin
 from django.urls import include, path
 from rest_framework import routers
 
+import vrobbler.apps.scrobbles.views as scrobbles_views
 from vrobbler.apps.books.api.views import AuthorViewSet, BookViewSet
 from vrobbler.apps.music import urls as music_urls
 from vrobbler.apps.music.api.views import (
@@ -23,7 +21,6 @@ from vrobbler.apps.scrobbles.api.views import (
 from vrobbler.apps.sports.api.views import (
     LeagueViewSet,
     PlayerViewSet,
-    RoundViewSet,
     SeasonViewSet,
     SportEventViewSet,
     SportViewSet,
@@ -65,11 +62,3 @@ urlpatterns = [
         "", scrobbles_views.RecentScrobbleList.as_view(), name="vrobbler-home"
     ),
 ]
-
-if settings.DEBUG:
-    urlpatterns += static(
-        settings.MEDIA_URL, document_root=settings.MEDIA_ROOT
-    )
-    urlpatterns += static(
-        settings.STATIC_URL, document_root=settings.STATIC_ROOT
-    )

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini