Skip to content

Instantly share code, notes, and snippets.

@python-consulting
Created October 20, 2016 16:23
Show Gist options
  • Save python-consulting/1a9dd5d1fa59a7c1ff5fde9b71e46e7f to your computer and use it in GitHub Desktop.
Save python-consulting/1a9dd5d1fa59a7c1ff5fde9b71e46e7f to your computer and use it in GitHub Desktop.
Django dynamic import of model from app
from django.apps import apps
app_config = apps.get_app_config('mainApp')
LogLine = app_config.get_model('ModelName')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment