apps.py 705 B

123456789101112131415161718192021222324
  1. __package__ = 'archivebox.machine'
  2. from django.apps import AppConfig
  3. class MachineConfig(AppConfig):
  4. default_auto_field = 'django.db.models.BigAutoField'
  5. name = 'archivebox.machine'
  6. label = 'machine' # Explicit label for migrations
  7. verbose_name = 'Machine Info'
  8. def ready(self):
  9. """Import models to register state machines with the registry"""
  10. import sys
  11. # Skip during makemigrations to avoid premature state machine access
  12. if 'makemigrations' not in sys.argv:
  13. from archivebox.machine import models # noqa: F401
  14. def register_admin(admin_site):
  15. from archivebox.machine.admin import register_admin
  16. register_admin(admin_site)