0

I am using django-extensions for graph-model representation. When running this command:

 $ ./manage.py graph_models -a -g -o my.png

Error:

django.core.exceptions.ImproperlyConfigured: App with label braces is missing a models.py module.

My Project structure:

Project
        app1
            models
                 abc.py
                 xyz.py
                 __init__.py
             urls.py
             admin.py
             views.py
             __init__.py
       app2
            models
                 abc1.py
                 xyz1.py
                 __init__.py
             urls.py
             admin.py
             views.py
             __init__.py

My models/abc.py:

class Abc(AbstractBaseUser):

MALE = "M"
FEMALE = "F"

SEX_CHOICES = [
    (MALE, "Male"),
    (FEMALE, "Female"),
]

SEX_CHOICES_AND_BLANK = [('', 'Select Gender')] + SEX_CHOICES


email = models.EmailField(_('Email Address'), max_length=70, unique=True)
first_name = models.CharField(_('First Name'), max_length=30)
last_name = models.CharField(_('Last Name'), max_length=30)
username = models.CharField(_('username'), max_length=70, unique=True)
gender = models.CharField(_("Gender"), max_length=1, choices=SEX_CHOICES, blank=True)
contact_number = models.CharField(
    _("Contact Number"),
    max_length=15,
    blank=True,
    validators=[
        RegexValidator(r'^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$')
    ])

# Profile extras
image = ImageFileField(upload_to=get_upload_file_name, blank=True, default='user-default.png')
about = models.TextField(_("about me"), blank=True)

Thanks in Advance

Insane Skull
  • 9,220
  • 9
  • 44
  • 63
user2553017
  • 372
  • 6
  • 21
  • Which version of Django are you using? Where is `braces` coming from? Using names like `app1` and `app2` instead of your actual code makes it more confusing. – Alasdair Mar 29 '16 at 08:51

1 Answers1

0

Have you imported all your models in models' init.py? It is required to import all the models in models' init.py like given in this answer.. If it is not imported, django-extensions won't be able to get all the models.

Community
  • 1
  • 1
Mohammad Mustaqeem
  • 1,034
  • 5
  • 9