settings.py 365 B

123456789101112131415
  1. from pathlib import Path
  2. from django.conf import settings
  3. def register_plugin_settings(settings=settings, name='defaults'):
  4. settings.STATICFILES_DIRS += [
  5. str(Path(settings.PACKAGE_DIR) / f'plugins/{name}/static'),
  6. ]
  7. settings.TEMPLATE_DIRS += [
  8. str(Path(settings.PACKAGE_DIR) / f'plugins/{name}/templates'),
  9. ]
  10. print('REGISTERED PLUGIN SETTINGS', name)