sqlite3 table not found

26 views
Skip to first unread message

jjander...@gmail.com

unread,
May 21, 2017, 11:49:36 AM5/21/17
to Django users

Hi,

I'm fairly new to Django and I'm very much still in the learning process.



I'm using Django 1.10.3 on a project and have just added some new models. When I run the server and enter a URL to visit one of my views, I get an error, an excerpt of which is shown below:

File "/home/jja/testenv3.5/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: siggy_siggytemplate

I would like to look at the SQL tables and it looks like 'python manage.py sql' is a command that could do the job, but whichh is no longer available. Is this correct?

Is there an alternative command that I can run?\

I would like to look at the tables to see if I can figure out why the table 'siggy_siggytemplate' was not generated. BTW, my project is 'siggy' and my model is 'SiggyTemplate' so I think this would cause generation of the table

'siggy_siggytemplate'.

Jim Anderson

James Schneider

unread,
May 21, 2017, 12:03:42 PM5/21/17
to django...@googlegroups.com


On May 21, 2017 8:49 AM, <jjander...@gmail.com> wrote:

Hi,

I'm fairly new to Django and I'm very much still in the learning process.



I'm using Django 1.10.3 on a project and have just added some new models. When I run the server and enter a URL to visit one of my views, I get an error, an excerpt of which is shown below:

File "/home/jja/testenv3.5/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: siggy_siggytemplate

I would like to look at the SQL tables and it looks like 'python manage.py sql' is a command that could do the job, but whichh is no longer available. Is this correct?

Is there an alternative command that I can run?\

I believe you're looking for the 'dbshell' command, which will open the sqlite shell for you.


I would like to look at the tables to see if I can figure out why the table 'siggy_siggytemplate' was not generated. BTW, my project is 'siggy' and my model is 'SiggyTemplate' so I think this would cause generation of the table

'siggy_siggytemplate'.

Did you run the 'makemigrations' and 'migrate' commands? That pair of commands will apply your changes to the DB schema.

-James

jjander...@gmail.com

unread,
May 22, 2017, 1:58:50 PM5/22/17
to Django users

James,

I will read up on dbshell and give it a try. Thanks for the pointer.

Yes, I ran both 'makemigrations' and 'migrate' prior to posting.

If I can figure out how to close out the thread, I will.

Jim A.
Reply all
Reply to author
Forward
0 new messages