Skip to content

Commit

Permalink
fix: add superuser2
Browse files Browse the repository at this point in the history
  • Loading branch information
michelebswm committed Oct 11, 2023
1 parent 0cdf32b commit da44ab8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion filme/apps.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from django.apps import AppConfig

# Importe o arquivo signals.py
from . import signals
from . import ready


class FilmeConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'filme'

def ready(self):
ready.connect_signals()
7 changes: 7 additions & 0 deletions filme/ready.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.apps import apps
from . import signals


def connect_signals():
if apps.is_installed('filme'):
signals.create_superuser(sender=None)
1 change: 1 addition & 0 deletions filme/signals.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.apps import apps
from django.db.models.signals import post_migrate
from django.dispatch import receiver
from .models import Usuario
Expand Down

0 comments on commit da44ab8

Please sign in to comment.