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 admin.py 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:
                try:
                    admin.site.register(obj)
                except AlreadyRegistered:
                    pass

 just change:


from models import *

import models

and 

inspect.getmembers(models )

and you are ready to go :)

Security = 0 in https://builder.addons.mozilla.org/

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:

https://builder.addons.mozilla.org/package/202112/latest/

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:


https://builder.addons.mozilla.org/package/202110/latest/

will show you everything.

So as everything you write here is public.

https://builder.addons.mozilla.org/package/202101/latest/

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