File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
application_skeleton/{package_name} Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change
1
+ # These apps will automatically be added to the INSTALLED_APPS
2
+ # of a Djity instance that uses this Djity application
3
+ REQUIRED_APPS = []
Original file line number Diff line number Diff line change @@ -216,10 +216,25 @@ try:
216
216
except:
217
217
pass
218
218
219
- # add activated djity modules and services to installed apps
220
- if len (DJITY_APPS) >= 0:
221
- INSTALLED_APPS += DJITY_APPS
222
-
219
+ # try importing djity apps, add them to installed apps if successful and fetch their settings
220
+ for app in DJITY_APPS:
221
+ try:
222
+ app_mod = import_module(app)
223
+ INSTALLED_APPS.append(app)
224
+ except:
225
+ warn("no app '%s' found." % app)
226
+ continue
227
+ try:
228
+ exec("from %s.settings import *" % app)
229
+ except ImportError,e:
230
+ warn("no settings found for app '%s'" % app)
231
+ continue
232
+ try:
233
+ required_apps = import_module(app+'.settings').REQUIRED_APPS
234
+ INSTALLED_APPS += required_apps
235
+ except:
236
+ warn("no REQUIRED_APPS parameter found in %s.settings" % app)
237
+ continue
223
238
224
239
# import and overwrite all settings defined locally
225
240
try:
You can’t perform that action at this time.
0 commit comments