Django admin register all models in admin interface

Normally it is really annoying, that you have to name all the models that you want to add to your admin site in Django in So I just wrote a little script that imports all of them. With some checks. You just need to edit the imports and you will have all the models in your admin front-end.

from django.contrib import admin
from models import *

import models
import inspect
from django.db.models.base import ModelBase

from django.contrib.admin.sites import AlreadyRegistered

for name, obj in inspect.getmembers(models ):
    if inspect.isclass(obj):
        if isinstance(obj, ModelBase):
            if not obj._meta.abstract:
                except AlreadyRegistered:

 just change:

from models import *

import models


inspect.getmembers(models )

and you are ready to go :)

Security = 0 in

So I was just playing around with the addon builder from mozilla when I noticed a number in the URL that looked like it was the project number. So my Project is located at:

The funny thing is, that you can see this without authenticating in any way or form. So I thought, "is this true for everything that is done here?" And yes it is, so you can just change the number and look at any project. See all the files and history. As an example:

will show you everything.

So as everything you write here is public.

And the id is auto-increment so I can just loop through all the files and see what they might contain.