Grafik model gösterimi için django uzantıları kullanıyorum. Bu komutu çalıştırırken:Hata: django.core.exceptions.ImproperlyConfigured
$ ./manage.py graph_models -a -g -o my.png
Hata:
django.core.exceptions.ImproperlyConfigured: App with label braces is missing a models.py module.
Projem yapısı:
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 modeller/abc.py: peşin
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)
Teşekkür
Hangi sürümü Django kullanıyorsunuz? 'Parantez' nereden geliyor? Gerçek kodunuzun yerine "app1" ve "app2" gibi adların kullanılması daha kafa karıştırıcı olur. – Alasdair