Django Tutorial 1.1: Viewing SQLite3 tables

7,961 views
Skip to first unread message

wormser17

unread,
Jan 7, 2010, 6:50:08 PM1/7/10
to Django users
Hello. First, some quick context about my approach (I am not a
programmer):

This is the directory where I installed Django: /Library/Python/2.6/
site-packages/django
This is my project directory: /Users/mlooby/Sites/mysite

Situation
1) I created a SQLite3 database, named "project.db," by editing
settings.py with the following:

DATABASE_ENGINE = 'django.db.backends.sqlite3'
DATABASE_NAME = '/Users/mlooby/Sites/mysite/project.db'

2) I created tables for the apps under INSTALLED_APPS by running:

python manage.py syncdb

3) Next, I created my superuser account.

4) The tutorial then states the following:

"If you're interested, run the command-line client for your database
and type \dt (PostgreSQL), SHOW TABLES; (MySQL), or .schema(SQLite) to
display the tables Django created."


My Issue: I cannot get SQLite to display the tables that Django just
created after entering/running the following in a new Terminal shell:

mlooby$ sqlite3
SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema
sqlite> .schema;
unknown command or invalid arguments: "schema;". Enter ".help" for
help
sqlite> .schema project.db
sqlite> .schema project
sqlite> .schema project;
sqlite>

I've reviewed www.sqlite.com and some related Google Groups, but my
searches were fruitless. Does anyone know why I can't get SQLite to
display the tables?

Finally, please let me know if I've omitted any information that would
help identify the issue.

Thank you.

Justin Steward

unread,
Jan 7, 2010, 7:23:03 PM1/7/10
to django...@googlegroups.com
On Fri, Jan 8, 2010 at 10:50 AM, wormser17 <matt....@gmail.com> wrote:
>        mlooby$ sqlite3
>        SQLite version 3.6.12
>        Enter ".help" for instructions
>        Enter SQL statements terminated with a ";"
>        sqlite> .schema
>        sqlite> .schema;
>        unknown command or invalid arguments:  "schema;". Enter ".help" for
> help
>        sqlite> .schema project.db
>        sqlite> .schema project
>        sqlite> .schema project;
>        sqlite>

Try this:
$ sqlite3 /path/to/db

~Justin

bedros

unread,
Jan 8, 2010, 2:46:00 PM1/8/10
to Django users

I use Firefox extension SQLite Manager

https://addons.mozilla.org/en-US/firefox/addon/5817

select connect database from database menu and pick your sqlite file
and you're set to go.

Regards,

Bedros

On Jan 7, 4:23 pm, Justin Steward <althalu...@gmail.com> wrote:

roberto

unread,
Jan 8, 2010, 3:47:17 PM1/8/10
to Django users
I think there is a plugin for firefox called "SQLite manager" that is
a big help to do simple stuff with sqlite db.
Let me know if you need some directions to use it.
Good luck

wormser17

unread,
Jan 8, 2010, 6:44:24 PM1/8/10
to Django users
Bedros and Roberto,

Thank you both for the suggestions. Just downloaded the add-on.

Justin, thanks also. You're advice worked (I replied directly to you
instead of the group).

Jay Godse

unread,
Jan 10, 2010, 12:45:28 AM1/10/10
to Django users
If you want to get comfortable with SQLite, try some of the tutorials
at:

http://www.squidoo.com/sqlitehammer
http://www.squidoo.com/sqlitetutorial
http://www.squidoo.com/sqliteprogramming

There are also videos at

http://www.youtube.com/user/Jaynonymous1

which you may find useful.

Cheers, Jay

> I've reviewedwww.sqlite.comand some related Google Groups, but my

Tom Evans

unread,
Jun 12, 2013, 10:43:44 AM6/12/13
to django...@googlegroups.com
On Wed, Jun 12, 2013 at 3:21 PM, Shailen Sobhee <s.so...@gmail.com> wrote:
> You need to download the sqlite3 program.
>
> This can be obtained here: http://www.sqlite.org/download.html (site up as
> of date of posting this reply.)
>
> 1) Put the sqlite3.exe file in your PATH. If you do not know what that is,
> copy the file in C:\Windows\System32
> 2) In a command prompt, type:
> sqlite3 <path_to_my_database>
> .schema
> 3) <path_to_my_database> is the path where the database is created when you
> executed "python manage.py syncdb". The path can also be found in the
> "settings.py" file
> 4) StackExchange is a better place to ask for support.
>

5) Original poster is probably not still waiting for a response to a
question asked over three and a half years ago. Better stick to
stackexchange.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages