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
- TestSettingsManager: temporarily change settings for tests by carljm 4 years, 9 months ago
- Serve static media files from app/media subdirectory by adamlofts 4 years, 9 months ago
- Dynamically change admin widgets at runtime by davisd 3 years, 1 month ago
- decorator for method attribute assignment by freality 3 years, 6 months ago
- Automagically import settings from installed applications by jezdez 5 years, 3 months ago
Comments
It's perfect that we can receive the mortgage loans and this opens new opportunities.
#