mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
bitbake: toaster: automatically enable applications
We automatically enable local applications in INSTALLED_APPS based on detecting a models.py or views.py file. This allows Toaster extensibility by adding applications, without having to edit configuration files. (Bitbake rev: 05b246095d161143ca2ebc126d9e70d198ab8bb8) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5790b60d00
commit
c35b678053
@@ -243,6 +243,15 @@ INSTALLED_APPS = (
|
|||||||
'bldcontrol',
|
'bldcontrol',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# We automatically detect and install applications here if
|
||||||
|
# they have a 'models.py' or 'views.py' file
|
||||||
|
import os
|
||||||
|
currentdir = os.path.dirname(__file__)
|
||||||
|
for t in os.walk(os.path.dirname(currentdir)):
|
||||||
|
modulename = os.path.basename(t[0])
|
||||||
|
if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS:
|
||||||
|
INSTALLED_APPS.append(modulename)
|
||||||
|
|
||||||
# A sample logging configuration. The only tangible logging
|
# A sample logging configuration. The only tangible logging
|
||||||
# performed by this configuration is to send an email to
|
# performed by this configuration is to send an email to
|
||||||
# the site admins on every HTTP 500 error when DEBUG=False.
|
# the site admins on every HTTP 500 error when DEBUG=False.
|
||||||
|
|||||||
Reference in New Issue
Block a user