Static Files not loading when DEBUG = False

I'm using namecheap shared hosting and I hosted my site using cpanel. My site is working fine but if i made DEBUG = False in project file the static files are not loading. My site url:


# Static files (CSS, JavaScript, Images)
    BASE_DIR / "static",

STATIC_URL = '/static/'
    BASE_DIR / "static",

MEDIA_URL = '/media/' 
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') in project folder


from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('', include('dr_shahida.urls')),

# Configure Admin Titles = "DR. Shahida Begum" = "DR. Shahida Begum" = "Welcome to Admin Dashboard"
handler404 = 'dr_shahida.views.error_404_view' in app folder


from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('', views.index, name='index'),
    path('testimonial/', views.testimonial, name='testimonial'),
    path('contact/',, name='contact'),
    path('blog/',, name='blog'),
    path('blog/post/<int:post_id>', views.blogdetailview, name='blogdetailview'),
    path('set_language/<str:ln>', views.set_lang, name='set_lang'),


if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,

I want my static files to work when DEBUG = False in project file.

Back to Top