Created
November 20, 2013 12:13
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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