Skip to content

Commit

Permalink
Static files fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Princekumarofficial committed Aug 20, 2024
1 parent b25c347 commit d9e7372
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions messWebsite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = "/static/"
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
STATIC_ROOT = BASE_DIR / 'staticfiles'
# managing media
CLOUDINARY_STORAGE = {
"CLOUD_NAME": env("CLOUD_NAME"),
Expand Down
6 changes: 4 additions & 2 deletions messWebsite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

from allauth.socialaccount.providers.google.views import oauth2_callback, oauth2_login
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.static import serve

urlpatterns = [
path("admin/doc/", include("django.contrib.admindocs.urls")),
Expand All @@ -31,4 +31,6 @@
path("accounts/google/login/", oauth2_login, name="google_login"),
path("accounts/google/login/callback/", oauth2_callback, name="google_callback"),
path("", include("home.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
path('media/<path:path>/', serve, {'document_root': settings.MEDIA_ROOT}),
path('static/<path:path>/', serve, {'document_root': settings.STATIC_ROOT}),
]

0 comments on commit d9e7372

Please sign in to comment.