6👍
It looks like the error is occurring with
<a href="{% url 'profile' post.author.username %}">
Make sure that each of these posts
that you are looping through actually has an author and that each author has a username. Django won’t be able to properly construct the url if post.author.username
is None
.
1👍
in this url : path("profile/str:name/", views.profile, name="profile")
do you have an view called profile?
and what does name in str:name refer to? username maybe? or author
you need to provide more details,
- [Django]-Two or More Django Projects in Same Droplet via Subdomain
- [Django]-Error running WSGI application , ModuleNotFoundError: No module named 'mysite'
- [Django]-ConnectionRefusedError in dJango rest api while registration process
- [Django]-Running django application via SSH on Windows
0👍
Maybe you need to check your admin panel if there is a post without author that’s probably the problem
0👍
NoReverseMatch at / Reverse for ‘profile’ with arguments ‘(”,)’ not found. 1 pattern(s) tried: [‘profile/(?P[^/]+)/$’]
It’s means something missing in database thats you are working for in loops .Django won’t be able to properly construct the url if somthing is blank. First go to the Django admit panel and find whats are missing.Example:Author,User,Admin etc.
- [Django]-Running django application via SSH on Windows
- [Django]-'ascii' codec can't decode byte 0xe2 in position 5367: ordinal not in range(128)
- [Django]-Csrf issue from node js to django
- [Django]-Is there a framework like now.js for Django?
- [Django]-Django(Python) AttributeError: 'NoneType' object has no attribute 'split'
0👍
If you define a post without assigning a profile (owner) to it, you get this error. in other words, something that Django wants (in your database) is blank!
You must go to the admin panel and check all posts that are defined, None of them should be without an owner.
- [Django]-Django middleware to determine user's group in a session
- [Django]-How to get module variable in function from another module?