1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from django.db import models
from django.utils import importlib
# get the installed models.py from the installed app
app = models.get_app("myapp")
# import the views from the same app
views = importlib.import_module(app.__name__[:-6] + "views")
# import templatetags from the same app
mytemplatetags = importlib.import_module(app.__name__[:-6] + "templatetags.mytemplatetags")
# import any other module from the same app
myothermodule = importlib.import_module(app.__name__[:-6] + "myothermodule")
|
More like this
- Dynamically change admin widgets at runtime by davisd 2 years, 1 month ago
- dynamic model graph by findlay 4 years ago
- TestSettingsManager: temporarily change settings for tests by carljm 3 years, 8 months ago
- Upload progress handler using cache framework by ebartels 4 years, 1 month ago
- Automagically import settings from installed applications by jezdez 4 years, 3 months ago
Comments
It's perfect that we can receive the mortgage loans and this opens new opportunities.
#