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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:24:04+00:00 2026-05-29T11:24:04+00:00

In my project I have one app which have its own urls.py like this

  • 0

In my project I have one app which have its own urls.py like this

urlpatterns = patterns('',
(r'^(?P<language>\w+)/$', 'MainSite.views.home_page'),)

(above file is in my application )

I am trying include this file in main(project’s) urls.py
like this :

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'', include('myproject.MainSite.urls')),
    url(r'^admin/', include(admin.site.urls)),
)

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

but after this I can able to call the MainSite’s (app’s) view but my admin url is not working
I tried

urlpatterns = patterns('',
        (r'^$', include('myproject.MainSite.urls')),
        url(r'^admin/', include(admin.site.urls)),
    )

but after this this makes admin work but my app’s view won’t get called,
how do I solve this.

  • 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-05-29T11:24:05+00:00Added an answer on May 29, 2026 at 11:24 am

    You’re including your views at the root level. Since it comes before the urlpattern for the admin, the first urlpattern catches everything, so nothing is ever passed to the admin views.

    The simplest fix is to simply reverse the order:

    urlpatterns = patterns('',
        url(r'^admin/', include(admin.site.urls)),
        (r'', include('myproject.MainSite.urls')),
    )
    

    Then, your views will only catch anything the admin doesn’t.

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

Sidebar

Related Questions

in my project i have one registration form which is developed in C#.net.to this
I have one project which has RIAService with entity framework that is referenced to
I have one main project and another project which is added as a subprojects.
I have a website project which includes several assemblies which are built separately. One
I have a django project with various apps, which are completely independent. I'd like
I have worked a bit with Django and I quite like its project/applications model
In my project I have one table with 24*6*300 cells on one page (it's
I have one project inside that I have SqlServerFunctions in test.cs file. code: [Microsoft.SqlServer.Server.SqlFunction]
I have one project with is developed in Php and javascript. How to open
I currently have one project that currently contains multiple packages. These packages make up

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.