2👍
Your problem is the profiles
variable not being defined in production.
There is a code path that doesn’t define your profiles
variable.
Upon closer look, you should be able to why it’s happening.
your qs
may be empty, your assumption that request.method
must be either get or post
might be wrong. (client might send patch, delete request). There could be more reasons…
In any case, your code has holes that doesn’t define profiles
variable, and your production server (or client using the server) is different in a sense that it is going through the different execution path.
You could put a import pdb; pdb.set_trace()
and debug it.
or mentally analyse your code to fix it.
0👍
Put or copy the
paginator = Paginator(profiles,12)
under
profiles = UserProfile.objects.filter(f).order_by(‘-created_at’)
with the same indentation. I think the value of f is not None, and based-on dislayed code, your pagination is outside of the profile_search(), so i think the assignment of profilles failed.
- [Answered ]-Is this sanitizer vulnerable to XSS?
- [Answered ]-Validate multiple related objects through foreign key field in Django ModelForm
- [Answered ]-API monitoring tool
- [Answered ]-Django form wizard validate (clean) form using previous form
- [Answered ]-Django: Slug in Vietnamese working not correctly