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 8988229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:58:18+00:00 2026-06-15T21:58:18+00:00

I’m trying to make a view redirect to another view so user’s can’t access

  • 0

I’m trying to make a view redirect to another view so user’s can’t access it without a condition being met. In this case, a successful password change. I also want to achieve this using HttpResponseRedirect.

Now, I’ve never used reverse before, but I figured that this is the way to do that. Problem is that I can’t get reverse to work. I get the following error:

ViewDoesNotExist at /account/password/
Could not import findadownload.main.views.foo. View does not exist in module findadownload.main.views.

# URLS

from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings


#SANDY
from findadownload.sandy.views import *


#TRIVIARIA
from findadownload.trivia.views import *
from findadownload.accounts.views import *


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'findadownload.main.views.presidium_home', name='presidium_home'),
    (r'^web/$', 'findadownload.main.views.web'),
    (r'^web/developers/$', sandy_developers),


    #SANDY (for findadownload!)
    (r'^get/sandy/$', get_sandy),
    (r'^get/sandy/download/$', get_sandy_download),
    (r'^sandy/register/$', sandy_registration),
    (r'^sandy/complete/$', sandy_complete),
    (r'^web/shared/$', sandy_shared_files),
    (r'^web/remove/all/$', sandy_remove_all),
    (r'^web/remove/(?P<file_id>\w+)/$', sandy_remove_file),
    (r'^about/$', 'findadownload.main.views.about'),
    (r'^pytech/$', 'findadownload.main.views.pytech'), 
    (r'^pytech/aboutus$', 'findadownload.main.views.pytech_about'),
    (r'^pytech/services$', 'findadownload.main.views.pytech_services'),
    (r'^pytech/support$', 'findadownload.main.views.pytech_support'),
    (r'^pytech/contactus$', 'findadownload.main.views.pytech_contact'),
    (r'^pytech/sitemap$', 'findadownload.main.views.pytech_sitemap'),
    (r'^pytech/search/$', 'findadownload.main.views.pytech_search'),
    (r'^presidium', 'findadownload.main.views.presidium_home'),


    #TRIVIARIA
    (r'^register/$', register),
    (r'^login/$', login_view, {'template': 'trivia/registration/login.html'}),
    (r'^logout/$', logout_view),
    (r'^trivia/$', submit_question, {'template': 'trivia/trivia_questions.html'}),
    (r'^challenges/$', submit_question, {'template': 'trivia/trivia_challenges.html'}),
    (r'^question/thanks/$', question_thanks),
    (r'^question/answer/$', submit_answer),
    (r'^question/answer/result/(\d+)/(.*)/$', answer_result),
    (r'^question/answer/challenge/$', challenge_answer),
    (r'^account/$', upload_avatar),
    (r'^account/password/$', password_change),
    url(r'^account/password/success/$', 'findadownload.accounts.views.password_success'),
    (r'^(?P<username>\w+)/$', view_user_profile, {'template': 'trivia/trivia_view_user_questions.html'}),
    (r'^(?P<username>\w+)/trivia/$', view_user_profile, {'template': 'trivia/trivia_view_user_questions.html'}),
    (r'^(?P<username>\w+)/challenges/$', view_user_profile, {'template': 'trivia/trivia_view_user_challenges.html'}),




    #FILE SHARING
    (r'^web/share/(?P<file_id>\w+)/$', sandy_download),
    (r'^web/report/(?P<file_id>\w+)/$', sandy_file_report),
    (r'^web/like/(?P<file_id>\w+)/$', like_download),
    #OTHER
    (r'^web/profile/$', 'findadownload.main.views.web_profile'),
    (r'^web/edit/$', 'findadownload.main.views.web_edit'),
    (r'^trivia/$', 'findadownload.main.views.trivia_home', {'template': 'trivia/registration/index.html'}),
    (r'^web/get/$', 'findadownload.main.views.web_get'),
    (r'^web/progress/$', 'findadownload.main.views.web_progress'),
    (r'^web/foo/$', 'findadownload.main.views.foo'),
    (r'^web/search/$', 'findadownload.main.views.web_search'),
    (r'^web/logout/$', 'findadownload.main.views.web_logout'),
    (r'^web/resend/$', 'findadownload.main.views.web_resend'),
    (r'^web/home/$', 'findadownload.main.views.web_home'),
    (r'^web/history/$', 'findadownload.main.views.web_history'),
    (r'^web/verify/(?P<link>\w+)/$', 'findadownload.main.views.web_activate'),
    (r'^web/help/(?P<username>\w+)/$', 'findadownload.main.views.web_help'),
    (r'^web/welcome/(?P<username>\w+)/$', 'findadownload.main.views.welcome'),
    (r'^web/terms/$', 'findadownload.main.views.web_terms'),
    (r'^web/privacy/$', 'findadownload.main.views.web_privacy'),
    (r'^web/signup/$', 'findadownload.main.views.web_signup'),
    (r'^web/login/$', 'findadownload.main.views.web_login'),
    (r'^test$', 'findadownload.main.views.test'),
    # url(r'^findadownload/', include('findadownload.foo.urls')),


    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)


if 1:
    urlpatterns += patterns('',
        url(r'^uploads/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
            'show_indexes': True,
        }),
   )




urlpatterns += staticfiles_urlpatterns()



    # VIEWS

    from django.http import HttpResponse, HttpResponseRedirect
    from django.shortcuts import render_to_response
    from findadownload.accounts.forms import *
    from django.contrib.auth.models import User
    from django.contrib import auth
    from findadownload.accounts.models import *
    from django.core.urlresolvers import reverse
    from findadownload.trivia.models import *


    def password_success(request):
        return render_to_response('trivia/trivia_password_success.html')

    def password_change(request):
        if request.user.is_authenticated():
            # if for is submitted
            if request.method == 'POST':
                form = PasswordForm(user=request.user, data=request.POST)
                # for the avatar part
                if form.is_valid():
                    cd = form.cleaned_data
                    request.user.set_password(cd['confirm_password'])
                    request.user.save()`enter code here`
                    # redirect to profile page after POST
                    return HttpResponseRedirect(reverse('findadownload.accounts.views.password_success'))
            else:
                form = PasswordForm(user=request.user)

            # render empty form
            return render_to_response('trivia/trivia_password_change.html', {'form': form},
                                      context_instance=RequestContext(request))
        else:
            return HttpResponseRedirect('/login/?next=%s' % request.path)
  • 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-06-15T21:58:19+00:00Added an answer on June 15, 2026 at 9:58 pm

    You have to specify name kwargs in you url, in this case :

    url(r'^account/password/success/$', 'findadownload.accounts.views.password_success', name = 'password_success')
    

    Then use reverse like this :

    return HttpResponseRedirect(reverse('password_success'))
    

    What you pass in reverse is the name kwarg on urlpatterns.

    EDIT:

    Can i see the rest of your urls.py. I think the problem is not on reverse, because Django can’t find view named foo.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.