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'),
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'))
- [Django]-Django REST framework nested serializer and POST nested JSON with files
- [Django]-How do I get a default Value for a Field that usually increments in Django?
- [Django]-Django postgres full text search in reverse related models
- [Django]-How to lock access to django redis cache
Source:stackexchange.com