diff --git a/base/admin.py b/base/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/base/admin.py +++ b/base/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/comissoes/admin.py b/comissoes/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/comissoes/admin.py +++ b/comissoes/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/lexml/admin.py b/lexml/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/lexml/admin.py +++ b/lexml/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/materia/admin.py b/materia/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/materia/admin.py +++ b/materia/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/norma/admin.py b/norma/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/norma/admin.py +++ b/norma/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/parlamentares/admin.py b/parlamentares/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/parlamentares/admin.py +++ b/parlamentares/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/protocoloadm/admin.py b/protocoloadm/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/protocoloadm/admin.py +++ b/protocoloadm/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/sapl/settings.py b/sapl/settings.py index 321b6d2b6..53a89098a 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -25,7 +25,7 @@ SECRET_KEY = '!9g1-#la+#(oft(v-y1qhy$jk-2$24pdk69#b_jfqyv!*%a_)t' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] # Application definition diff --git a/sessao/admin.py b/sessao/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/sessao/admin.py +++ b/sessao/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model)