I am trying to make a query system for my website, i think the best way and the most compact would be to assign search variable using url pattern.
So for example, i want to search objects of model
for query in User.objects.all():
if q in query: # < We somehow need to get data of 'q'.
You can capture named strings from URLs like this:
urlpatterns = [ url(r'^blog/page(?P<num>[0-9]+)/$', views.page), ]
def page(request, num="1"):