[Django]-My css and images arent showing in django

2👍

Your static files should be inside YourProject/YourApp/static/pseq.css

and also another issue what i found in your code is that your views.homepage and view.register sharing the same path .It should be like this:

urlpatterns = [
    path("", views.homepage, name="homepage"),
    path("register/", views.register, name='register'),
👤arjun

2👍

By defining STATICFILES_DIRS you’ve instructed Django to copy all the files from that directory to the directory defined by STATIC_ROOT setting when you run python manage.py collectstatic.

So, your css files should be located inside a directory defined in STATICFILES_DIRS where Django development server will find them after python manage.py runserver call. For production you should run collectstatic management command and define STATIC_ROOT too like:

STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, '../../static'))

Leave a comment