apps.py 622 B

1234567891011121314151617181920
  1. __package__ = 'archivebox.core'
  2. from django.apps import AppConfig
  3. class CoreConfig(AppConfig):
  4. name = 'archivebox.core'
  5. label = 'core'
  6. def ready(self):
  7. """Register the archivebox.core.admin_site as the main django admin site"""
  8. import sys
  9. from archivebox.core.admin_site import register_admin_site
  10. register_admin_site()
  11. # Import models to register state machines with the registry
  12. # Skip during makemigrations to avoid premature state machine access
  13. if 'makemigrations' not in sys.argv:
  14. from archivebox.core import models # noqa: F401