Django — Registering Multiple Admin Sites

To register multiple admin sites with Django, import AdminSite from django.contrib.admin.sites

Instantiate the class and you have your new admin site that you can import anywhere and register the urls for.

Note that the register function is directly in the AdminSite, it is not AdminSite().site.register but AdminSite().register

#!admin.py
from django.contrib.admin.sites import AdminSite

my_new_admin = AdminSite(name='My New Admin')

my_new_admin.index_template = "myadmin/index.html"

#!urls.py
from myproject.admin import my_new_admin

(r'^my_new_admin/(*.)', my_new_admin.root)

#!model admin.py
from my_admin import my_new_admin
my_new_admin.register(MyClass)

15 Comments

  1. myself says:

    Hm, saved myself…

  2. amomyshadway says:

    hi

  3. Angie says:

    I would like to thank you for the efforts you’ve put in writing this blog. I am hoping to see the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now πŸ˜‰

  4. Mason says:

    Hello my loved one! I want to say that this article is amazing, nice written and include approximately all significant infos. I’d like to see extra posts like this .

  5. Candy says:

    I rarely comment, however I browsed some responses on Django. I actually do have 2 questions for you if you do not mind. Is it simply me or does it look like a few of these remarks look like they are coming from brain dead individuals? πŸ˜› And, if you are writing on additional online social sites, I would like to follow everything new you have to post. Would you list of all of your public pages like your twitter feed, Facebook page or linkedin profile?

  6. Lawerence says:

    What’s up everyone, it’s my first go to see at this website, and post is really fruitful for me, keep up posting these types of posts.

  7. Filomena says:

    I am sure this article has touched all the internet viewers, its really really nice article on building up new webpage.

  8. Kattie says:

    What’s up to all, since I am actually eager of reading this website’s post to be updated on a regular basis. It consists of pleasant data.

  9. Lindsey says:

    It is not my first time to pay a quick visit this web page, i am browsing this website dailly and obtain fastidious data from here all the time.

  10. Olen says:

    And single colored dress is recommended for plus size women, because it can make one look taller. It’s extremely important that you look around to locate a dress like this. These dresses are available in many different designs and cuts that can make accentuate your figure and make you the most eye-catching lady at your social gathering.

  11. Valentin says:

    If you have accounts in any, or all of these IM clients, you’ll want to have Meebo IM on your Android phone. Targets of the Anti-excess Website Optimization Update. One reason why the numbers have grown so quickly is because Google doesn’t have an approval system like Apple does with their app store.

  12. Augustina says:

    Quality content is the secret to invite the people to go to see the website, that’s what this web site is providing.

  13. Dulcie says:

    Its not my first time to pay a visit this web site, i am browsing this web page dailly and get nice information from here all the time.

Leave a Comment