Actually it depends on your PYTHONPATH. syncdb scans all modules from 
INSTALLED_APPS looking for models.py in them to populate database. So if you 
access you Entity model (for example at views.py) as 
from directory.models import Entity
then add 'directory' to INSTALLED_APPS.


On Jun 26, 2010, at 1:49 AM, Jonathan Hayward wrote:

> No; that sounds like the issue then?
> 
> If my project directory is named "directory", and I want to access the 
> "Entity" model in "models.py", what do I add to INSTALLED_APPS? I'm guessing 
> something like "directory", but I briefly searched online and couldn't tell.
> 
> On Fri, Jun 25, 2010 at 5:35 PM, Oleg Lomaka <oleg.lom...@gmail.com> wrote:
> 
> Did you add your application to INSTALLED_APPS before running syncdb?
> 
> On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote:
> 
> > P.S. Renaming the (SQLite) database file and running syncdb again produces 
> > (basically) the same behavior. I had to do some initialization things 
> > again, but outside of that I got equivalent behavior to what I pasted below.
> >
> > What I am trying to do is create a few instances of the Entity model 
> > defined in my [directory/]models.py. So far I have managed to get them to 
> > show up as an option to manage in the admin interface, but not yet to save 
> > one.
> >
> > Should it be looking for directory_models_entity instead of 
> > directory_entity? "entity" seems not to be populated; from the command line 
> > sqlite3:
> >
> > 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
> >
> > On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward 
> > <christos.jonathan.hayw...@gmail.com> wrote:
> > I received the error below from the admin interface; I thought it was 
> > because I needed to run a syncdb, but stopping the server, running a 
> > syncdb, and restarting has generated the same error:
> >
> > OperationalError at /admin/directory/entity/
> > no such table: directory_entity
> > Request Method:       GET
> > Request URL:  http://linux:8000/admin/directory/entity/
> > Exception Type:       OperationalError
> > Exception Value:
> > no such table: directory_entity
> > Exception Location:   
> > /usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py in execute, 
> > line 193
> > Python Executable:    /usr/bin/python
> > Python Version:       2.6.5
> > Python Path:  ['/home/jonathan/directory', 
> > '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg', 
> > '/home/jonathan/store/src/satchmo/satchmo/apps', 
> > '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
> >  
> > '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
> >  '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg', 
> > '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', 
> > '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', 
> > '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', 
> > '/usr/lib/python2.6/dist-packages/PIL', 
> > '/usr/lib/python2.6/dist-packages/gst-0.10', 
> > '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', 
> > '/usr/lib/pymodules/python2.6/gtk-2.0', 
> > '/usr/local/lib/python2.6/dist-packages']
> > Server time:  Fri, 25 Jun 2010 14:56:26 -0500
> >
> > I have an Entity class/model defined in my models.py and want to manually 
> > create some dummy data in the table. Any suggestions?
> >
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> 
> -- 
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to