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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:45:49+00:00 2026-06-13T15:45:49+00:00

I have a view that either displays a form or a ‘thank you’ page

  • 0

I have a view that either displays a form or a ‘thank you’ page (if the form submission was successful). I am using redirect with a url that I have tested working to display the thank-you page.

def form8(request):
    form = UserInfoForm(request.POST or None)
    if form.is_valid():
        form.save()
        return redirect('/sjwork/thanks')
    return render(request, 'form8.html', {'form': form})

However, when the form is successfully submitted django give the error:

ViewDoesNotExist at /sjwork/form8
Could not import views. Error was: No module named views

As said, I can go to localhost:8000/sjwork/thanks directly and it displays the thank-you page. According to documentation I can use a hard-coded url like this. I tried alternatives, too (giving the view, using a full url like http://google.com) – nothing works. I must be missing something basic here. Would appreciate if someone can explain what is going on here. Thanks.

The app ‘sjwork’ has the following in its urls.py:

url(r'^$', 'views.home', name='home'),
url(r'^thanks$', 'sjwork.views.thanks'),
url(r'^form8$', 'sjwork.views.form8', name='form8'),

whereas the project urls.py contains:

url(r'^sjwork/', include('formtest.sjwork.urls')),
  • 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-13T15:45:50+00:00Added an answer on June 13, 2026 at 3:45 pm

    Looks like error is related to this pattern.

    url(r'^$', 'views.home', name='home'),
    

    Try removing it and try again.
    Also, Could you include your import statements in your question.

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

Sidebar

Related Questions

I have a view that renders a list elements using the following template :
I have multiple Controller objects that either execute some script and then redirect to
I have a jsp as my view, which displays a form for adding a
I have a view that displays some movie data. I thought that it might
Let's say you have a form with a component that displays data from a
I am beginner in rails. I have view that i try to print inside
I have a view that has a column to make it sortable. When clicking
I have a view that shows user profile fields in a tabular format. There
I have a view that is used in a UINavigationController and and is automatically
I have a View that is basically setup like this: <Grid> <ViewBox> <Grid> <ItemsControl

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.