Skip to content

Instantly share code, notes, and snippets.

@rvause
Created November 20, 2013 12:13
Show Gist options
  • Select an option

  • Save rvause/7562194 to your computer and use it in GitHub Desktop.

Select an option

Save rvause/7562194 to your computer and use it in GitHub Desktop.
Snippet to add an app's models to Django admin site with no further configuration.
from unipath import Path
from django.contrib import admin
from django.db.models.loading import get_app, get_models
path = Path(__file__)
admin.site.register(get_models(get_app(path.parent.name)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment