16 lines
550 B
Python
16 lines
550 B
Python
from django.apps import AppConfig
|
|
import sys
|
|
|
|
class CoreConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'core'
|
|
|
|
def ready(self):
|
|
if 'runserver' in sys.argv:
|
|
try:
|
|
from django.core.management import call_command
|
|
print("Gemini: Auto-running migrations...")
|
|
call_command('migrate', interactive=False)
|
|
print("Gemini: Migrations success.")
|
|
except Exception as e:
|
|
print(f"Gemini: Migration error: {e}") |