0

I have, in models.py:

class Flashcard(models.Model):
    english = models.TextField()
    slavonic = models.TextField()

urls.py references models.py in an attempt to make python manage.py syncdb pick up on models.py:

import models

However, a python manage.py syncdb does not result in the creation of a *_flashcards table:

$ python manage.py syncdb && sqlite3 flashcards.db 
No fixtures found.
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
auth_group                  auth_user_user_permissions
auth_group_permissions      django_admin_log          
auth_message                django_content_type       
auth_permission             django_session            
auth_user                   django_site               
auth_user_groups          
sqlite> 

What should I be doing differently to get a flashcards_flashcards table? The admin interface picks up on it perfectly, up to displaying an "Add entry" page for the model.

Thanks,

0

1 Answer 1

2

You forgot to add your app to INSTALLED_APPS in the settings file, that's why syncdb command is not picking the models defined in that app.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.