Skip to content

Commit

Permalink
Static files fix (#71)
Browse files Browse the repository at this point in the history
* Static files fix

* update

* update

* update
  • Loading branch information
Princekumarofficial authored Aug 20, 2024
1 parent b25c347 commit 85b572f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion messWebsite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = os.path.join(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 85b572f

Please sign in to comment.