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

  • Home
  • SEARCH
  • 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 8066349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:57:33+00:00 2026-06-05T11:57:33+00:00

I am currently working my way through the Django Tutorial (Step 3) and am

  • 0

I am currently working my way through the Django Tutorial (Step 3) and am stuck at the part with “Decoupling the URLconfs”.

What I try to do is to set up one URL-Pattern that catches lnadmin/, to redirect to the django admin, and eventually another catch-all that redirects to other patterns included from another file.

Here’s my mysite/urls.py:

from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',

url(r'^lnadmin/', include(admin.site.urls)), #match admin
url(r'^test/', include('lnapp.urls')), #match test, should be a catch-all later
)

and here’s the lnapp/urls.py, which is supposed to match hash/(anything)/:

from django.conf.urls import patterns, include, url

urlpatterns = patterns('lnapp.views',
    url(r'^hash/(?P<hash>.+)/$', 'hash'), #match part to load from hash
)

I had this pattern in the main url.py before, and it worked as intended.
What’s happening now is that when I open (mydomain)/lnadmin/, it tries to access lnapp.views.hash (Could not import lnapp.views.hash, as no view is defined yet).

This doesn’t make any sense to me, as lnadmin/ should be matched by the first pattern, and /lnadmin/ doesn’t match test/hash/(anything)/. As soon as I comment out the one url in lnapp/urls.py, it redirects to the admin, as intended.

Swapping both urls in the main url.py has no effect.

  • 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-05T11:57:37+00:00Added an answer on June 5, 2026 at 11:57 am

    The answer to my own question is: you have to define a view even for the unmatched urls, or else it will fail.

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

Sidebar

Related Questions

I'm currently working my way through the MVC Music Store tutorial. I'm stuck on
I am currently working through the tutorial on Django's website. Upon completing the following
I'm currently working my way through 'Spring in Action'. Being stuck starting with the
I am working my way through a Yii tutorial book and am currently learning
I'm currently working my way through Accelerated C++ and just came across this in
I'm currently working my way through the learning curve that is LINQ and I
I'm currently working my way through http://www.railstutorial.org/ It uses Rspec along with a TDD
I'm currently working my way through this book: http://www1.idc.ac.il/tecs/ I'm currently on a section
I'm currently working my way through Code Complete and the word interface keeps popping
I'm currently working my way through various Rails tutorials, but all seem to recommend

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.