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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:44:27+00:00 2026-06-15T18:44:27+00:00

When I try to load urls described in different parts of urlpatterns, it loads

  • 0

When I try to load urls described in different parts of urlpatterns, it loads the same view. Obviously, there is an error in urlpatterns I use but I can’t find it.

Here is the first urls.py file:

urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', home),
url(r'^comments/', include('django.contrib.comments.urls')),
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
    'document_root': settings.MEDIA_ROOT}),
url(r'^episodes/', include('episodes.urls')),
url(r'^news/', news),
url(r'', include('zinnia.urls')),))

And here is urlpatterns in episodes.urls:

urlpatterns = patterns('',
    (r'$', seasons_list),
    (r'(?P<season>\d{1})/$', episodes_by_season),
    (r'(\d{1})/(\d{1})/$', episode),
)

Everytime I try to load url like “/episodes/1” or “/episodes/1/2”, django uses only seasons_list view.

  • 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-15T18:44:28+00:00Added an answer on June 15, 2026 at 6:44 pm

    That’s because all URLs have an end-of-string, hence they always match the first pattern. Add beginning anchors to all of them, since included URLconfs only get the part after the match.

    Whenever Django encounters include() (django.conf.urls.include()), it chops off whatever part of the URL matched up to that point and sends the remaining string to the included URLconf for further processing.

    urlpatterns = patterns('',
        (r'^$', seasons_list),
        (r'^(?P<season>\d{1})/$', episodes_by_season),
        (r'^(\d{1})/(\d{1})/$', episode),
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to load a store, but for some reason I get this error
I try to load a node only to face the EInvalidPointer error on Delphi.
I try to load files in different categories according to theis file name. Till
I was try to load unlimited categories to dropdownlist but I failed. **Categories** ID,
I want to make Friendly URLs, but when I try my PHP code works
I try to use this example to get images urls from http://www.nydailynews.com/cmlink/NYDN.Article.rss but no
When I try to load the following urls in a Webview all i get
I try to load the customview class that is inside my mainclass in xml.
I try to load data into a certain column into a table with the
When I try to load the following page in IE7 & IE8 I receive

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.