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, 10 months ago
- module_from_path by simon 5 years, 1 month ago
- Conditional url pattern include by zbyte64 2 years, 10 months ago
- djangopath: conveniently set sys.path and DJANGO_SETTINGS_MODULE by alia_khouri 4 years, 10 months ago
Comments
It's perfect that we can receive the mortgage loans and this opens new opportunities.
#