views:

335

answers:

2

It used to work, and now it doesn't. python manage.py syncdb no longer makes tables for my app.

From settings.py:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'mysite.myapp',
    'django.contrib.admin',
)

What could I be doing wrong? The break appeared to coincide with editing this model in models.py, but that could be total coincidence. I commented out the lines I changed, and it still doesn't work.

class MyUser(models.Model):
    user = models.ForeignKey(User, unique=True)
    takingReqSets = models.ManyToManyField(RequirementSet, blank=True)
    takingTerms = models.ManyToManyField(Term, blank=True)
    takingCourses = models.ManyToManyField(Course, through=TakingCourse, blank=True)
    school = models.ForeignKey(School)
#    minCreditsPerTerm = models.IntegerField(blank=True)
#    maxCreditsPerTerm = models.IntegerField(blank=True)
#    optimalCreditsPerTerm = models.IntegerField(blank=True)

UPDATE:

When I run python manage.py loadddata initial_data, it gives an error:

DeserializationError: Invalid model identifier: myapp.SomeModel

Loading this data had worked fine before. This error is thrown on the very first data object in the data file.

SOLVED:

Fixed by removing this line:

from stringprep import bl
A: 

I'd ber that the SomeModel model you mention above (not necessarily MyUser) has got a problem with it which means it can't be imported by loaddata. If not SomeModel, then a model in the same models.py that SomeModel is defined in.

Have you tried ./manage.py validate ? Even if that says all models are fine, sometimes if there's an error in a models.py of an an app, the entire app becomes 'invisible' to manage.py. I can't say I know why this is the case, but seems to ring a bell.

stevejalim
Validation reports: `0 errors found`. I guess I'll look by hand for other errors.
Rosarch
A: 

for me it says

python manage.py validate
0 errors found

python manage.py loaddata initial_data
No fixtures found.

But still it doesn't creates any tables :( what could be wrong?

I have also added my module in INSTALLED_APPS

learner
Probably better off to supply more information, and open another question.
Rosarch