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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:11:02+00:00 2026-06-06T18:11:02+00:00

I am using django 1.4 and Python 2.7. I just have a simple requirement

  • 0

I am using django 1.4 and Python 2.7.

I just have a simple requirement where I have to add a new URL to the django admin app. I know how to add URLs which are for the custom apps but am unable figure out how to add URLs which are of the admin app. Please guide me through this.

Basically the full URL should be something like admin/my_url.

UPDATE

I want a way after which I can as well reverse map the URL using admin.

  • 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-06T18:11:03+00:00Added an answer on June 6, 2026 at 6:11 pm

    +1 for Jingo’s answer to your original question. With your clarifying comment to the answer in mind:
    Such a URL is not “independent of the apps”, it is a URL for the app “admin”.

    Adding a URL to the admin site is similar to ModelAdmin, by overriding get_urls():
    https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-views-to-admin-sites

    EDIT:

    https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.AdminSite

    is an admin site, by default “the” admin site is instantiated as “django.contrib.admin.site” (and then e.g. your ModelAdmin’s are registered against that). So you can subclass AdminSite for your own MyAdminSite and re-define get_urls() there:

    from django.contrib.admin import AdminSite
    
    class MyAdminSite(AdminSite):
        def get_urls():
            ...
    
    
    ...
    my_admin_site = MyAdminSite()
    ...
    my_admin_site.register(MyModel, MyModelAdmin)
    

    Make sure you use my_admin_site in urls.py instead now:
    https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf

    Regarding the actual contents of get_urls(),see
    https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_urls
    (of course calling super() of MyAdminSite). Also note the convenient “admin_view” wrapper mentioned there.

    P.S.: In theory, you could also just define get_urls() and then monkeypatch the default admin site so that it uses your get_urls() but I don’t know if that would actually work – you’d probably have to monkeypatch right after its “first” import…

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

Sidebar

Related Questions

I have made an online gallery using Python and Django. I've just started to
I have a simple blog application written in Python, using Django. I use Git
I'm new to Python, and I'm using Google App Engine to build a simple
I'm fairly new to both Django and Python. This is my first time using
I have just spotted that something is wrong with my django-admin.py command. I checked
Pretty simple. I have a Python list that I am passing to a Django
I currently have a simple model defined, with a photoupload feature using django thumbnails
I have a Django app we're attempting to deploy to a Tomcat server, using
I have just installed South (0.7.3, python-2.6) and successfully completed the tutorial using the
New to python and django. Using the forms module and going through the errors

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.