Assuming your project structure is as follows:
# home/settings.py# ...# Add your app to the list of INSTALLED_APPSINSTALLED_APPS = [# ...'your_django_app',# ...]# ...# Static files (CSS, JavaScript, Images)STATIC_URL = "/static/"STATICFILES_DIRS = [os.path.join(BASE_DIR, "your_django_app", "static")]# ...
- Verify the static file configurations: In the settings.py, ensure that you have the correct static file settings.
# home/settings.py# ...# Add your app's template directoryTEMPLATES = [{"BACKEND": "django.template.backends.django.DjangoTemplates","DIRS": [os.path.join(BASE_DIR, "index", "templates")],"APP_DIRS": True,"OPTIONS": {"context_processors": [# ...],},},]# ...# Static files (CSS, JavaScript, Images)STATIC_URL = "/static/"STATICFILES_DIRS = [os.path.join(BASE_DIR, "index", "templates", "static")]# ...
- Check the development server logs: When you run the development server (python manage.py runserver), check the console output for any error messages or warnings related to static files. Make sure there are no 404 errors for the style.css file.
- Verify the app is added to INSTALLED_APPS: Ensure that your app (index) is included in the INSTALLED_APPS list in your settings.py file:
after then run your program.

