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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:31:31+00:00 2026-06-11T05:31:31+00:00

I have a project whose root url conf content is : from django.conf.urls import

  • 0

I have a project whose root url conf content is :

 from django.conf.urls import patterns, include, url
import funnytest
urlpatterns = patterns(
url(r'^funnytest/', include('funnytest.urls')),
url(r'^helloworld/', funnytest.views.hello),
)

funnytest is an app of this project ,In funnytest I write a module urls.py to configure request of this app :

from django.conf.urls import patterns, include, url
from views import *
urlpatterns = patterns(
url(r'^hello/$', hello),
)

AS I visit localhost/funnytest/hello/ there return a dispath error which say that there has no such pattern

While I visit localhost/helloworld , it works well.

为什么呢,应该如何配置~

  • 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-11T05:31:33+00:00Added an answer on June 11, 2026 at 5:31 am

    If you look at the definition of the patterns function:

    def patterns(prefix, *args):
        pattern_list = []
        for t in args:
            if isinstance(t, (list, tuple)):
                t = url(prefix=prefix, *t)
            elif isinstance(t, RegexURLPattern):
                t.add_prefix(prefix)
            pattern_list.append(t)
        return pattern_list
    

    You’ll see that patterns takes an argument ‘prefix’ before the list of url patterns.

    Try the following in both files: Add an empty string as the first argument to patterns.

    from django.conf.urls import patterns, include, url
    import funnytest
    urlpatterns = patterns(
        '',
        url(r'^funnytest/', include('funnytest.urls')),
        url(r'^helloworld/', funnytest.views.hello),
    )
    
    from django.conf.urls import patterns, include, url
    from views import *
    urlpatterns = patterns(
        '',
        url(r'^hello/$', hello),
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have project Emle in Launchpad . I set it to import from emle.svn.sourceforge.net
I have a project in mind whose main selling point would be very good
I have a rather large project whose Installer is written using NSIS. My problem
I have a URL that is like the following: http://www.example.com/client/project/subdirectory/value/ I would like like
I have a project whose a pro application target. I want to make a
I have a Project object whose only parameter(besides :id) is :project_name. The child of
I have an open-source project ( here ) whose documentation is currently in French.
I want to have an array that is accessible throughout my Objective-C project whose
I have project asp.net with namespace test and I'm using resources (files Resource.resx and
I have project I want to upgrade to .Net4 and it use BackgroundCopyManager.dll. Anyone

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.