django not loading static files on shared hosting

I have not created any django apps and i have created views, models and admin files in the single project folder. This is the first time ive done it this way but when i deploy it its not loading any static files.
directory tree : :

    # own apps #


STATIC_URL = 'static/'
    STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
    STATIC_ROOT = os.path.join(BASE_DIR, 'static')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') :

from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static

from .views import home_view, about_view, study_view, jobs_view, single_view 

urlpatterns = [
    path('',home_view, name='home'),
    path('about/',about_view, name='about'),

    path('study/', study_view, name="study"),
    path('jobs/', jobs_view, name="jobs"),
    path('single/<slug:sid>/', single_view, name="single"),

] + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)

what could be the possible issue here?
should i start an app and use those views, models and admin?
Because there is no problem with other websites that i have deployed (which had seperate apps in them)

1 Like

Sorry it was not Django, i had the files in a wrong directory. Should i remove this post?

last time i faced the same issue, then i solved myself. I did like this: in my file

STATIC_URL = ‘static/’
STATIC_ROOT =“/home/robonaia/public_html/static/”
os.path.join(BASE_DIR, “static”)

use =“/home/robonaia/public_html/static/” your statics files should be on public_html file; and run this command: python collectstatic

hope it will work for you.

you can remove the post. it this is not that or edit the post.