Note that there are some explanatory texts on larger screens.

plurals
  1. POpython manage.py syncdb doesn't pull from models.py
    text
    copied!<p>I'm not getting a python manage.py syncdb to create tables for my models; this is apparently because an exception is thrown on attempted import of my models and I am somewhat puzzled by the exception:</p> <pre><code>jhayward@jhayward81QDLD1 ~/project $ python manage.py shell Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01) [GCC 4.3.4 20090804 (release) 1] on cygwin Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) &gt;&gt;&gt; import models Traceback (most recent call last): File "&lt;console&gt;", line 1, in &lt;module&gt; File "/home/jhayward/project/models.py", line 23, in &lt;module&gt; class architecture(models.Model): File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line 48, in __new__ kwargs = {"app_label": model_module.__name__.split('.')[-2]} IndexError: list index out of range &gt;&gt;&gt; </code></pre> <p>Importing models as unadorned django.db.models does not help. The models.py is in the same directory as I'm trying to import from; it doesn't seem to behave any differently when I add the current directory to my PYTHONPATH.</p> <p>What is going on in this error message, and what do I need to do to help it?</p> <p>The basic structure of the models.py is:</p> <pre><code>from django.db import models example_choice = ( (0, u'first choice'), (1, u'second choice'), ) [more such choices] class architecture(models.Model): name = models.TextField(null = True, blank = True) [more such classes, with more fields and some interconnections but no more sophisticated syntax] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload