How can I see my databases in SQlite for Django.
I am following the django tutorial on ubuntu.
Now its working fine except. After running
python manage.py sql polls
then
python manage.py syncdb
So then I thought I would check out the daabase and tables but this is where the issue is:
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main
1 temp
There is no mysite database. How can i see the database?
your
mysite
database will be in the file system itself in the root of your project (top most folder of your django project), if this is how yoursettings.py
looks like:-If you enabled your django admin, and write the appropriate admin.py files for your polls app, you should be able to add, edit, delete or view your polls data in django admin.
You can of course load up your
mysite
database in your django project root (top folder) and view the data in it using something like http://sqlitebrowser.sourceforge.net/In command line in your ubuntu terminal, if you did do your syncdb correctly, you should be seeing something similar to this:-
You mentioned you already run your
./manage.py syncdb
correctly, so you should be able access your sqlite database by executingsqlite mysite
, like this:-And the
.tables
command in your sqlite shell will give you:-simply go to your project folder there is ds.sqlite3 file
open this in tool from https://sqlitebrowser.org/
Inside tool > Browse Data > select table in drop down to view table
I have used option 'dbshell' if this is already synced:
python manage.py dbshell
SQLite version 3.8.2 2013-12-06 14:53:30 Enter ".help" for instructions Enter SQL statements terminated with a ";"
sqlite> .databases