python - difficulty with search url in django -
i relatively new django , while trying implement search feature in site, having difficulty setting url in urls.py. search url dispatcher looks following:
url(r'search/$','welcome.views.search',name='search'),
also search form has action set 'search'.
there seems no problem search functionality every time repeat search, url looks pretty bad. example:
the above url obtained after trying 4 successive searches.please me out friends.
it seems giving relative path instead of absolute -
so use, href="/search/*
instead of href="search/*
.(replace star paramaters)
also use caret in regex(that stricter regex)
url(r'^search/$','welcome.views.search',name='search'),
instead of
url(r'search/$','welcome.views.search',name='search'),
Comments
Post a Comment