Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6777605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:10:03+00:00 2026-05-26T16:10:03+00:00

in views.py I have this: def logout(request,key): auth.logout(request) return HttpResponseRedirect(reverse(‘airAgency.views.index’,args=[key])) in index template i

  • 0

in views.py I have this:

def logout(request,key):
   auth.logout(request)
   return HttpResponseRedirect(reverse('airAgency.views.index',args=[key])) 

in index template i wanna when user click on a link,logout view run:

<a href="{% url airAgency.views.logout %}">logout</a>

I wanna pass key parameter to logout view,Imagine I have an object named agn and it’s WebSite field is going to pass to logout view, s.th like this:

<a href="{% url airAgency.views.logout agn.WebSite %}">

Imagine agn.WebSite has the value of mastane above code cause this error:

Caught NoReverseMatch while rendering: Reverse for 'airAgency.views.logout' with arguments '(u'mastane',)' and keyword arguments '{}' not found.

what’s the right way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:10:04+00:00Added an answer on May 26, 2026 at 4:10 pm

    Caught NoReverseMatch – usually means that the url is being called by incorrect arguments, or that something else is wrong when {% url %} tries to call the url specified.

    You need to define url pattern for that view function to be called in urls.py. And in the url pattern specify a view function.

    urls.py

    url(r'^logout/(?P<key>[a-zA-Z0-9\-]+)/$', "airAgency.views.logout", name="logout"),
    

    index.html

    <a href="{% url logout agn.WebSite %}">
    

    This might not work if you just copy paste it because I don’t know the exact project setup.

    The key is to have urls.py where regex is used to create patterns for how the url looks like, then a view function that needs to be invoked, and finally a name, which you can then use in your templates.

    This is all explained in the basic Django tutorial.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this in my views.py: def announcements(request): return render_to_response('events.html', { 'posts1': Blog.objects.filter(category__title=Announcements) },
In my views.py, i have a snippit of code like this: def clean_post_data(form): for
right now I have this in my controller: def index @votes = Vote.paginate(:page =>
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
I have this in one of my haml views: -form_for :news_item_comment, :url=>{:id => comment.id,
I have this chronic issue with iPhone UI development where views sometimes seem to
I have this: SolutionName: Foo.sln Assembly: Foo.Bar Namespaces are: Foo.Bar.Views Foo.Bar.Model Foo.Bar.BusinessObjects Foo.Bar.Services Should
say I have this $result = mysql_query('SELECT views FROM post ORDER BY views ASC');
I have something like this in one of my views <li <?php $isCurrent ?
All of a sudden in this MVC site I have no views that can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.