The problem with configuring sqlite3 using django!: /

I am in the settings.py module and I have to add the directory to the sqlite database. How to find out where the database is and what is the full catalog?

I am using Windows 7.

+5
source share
2 answers

The absolute path to the database directory is what you need. E.g. if your database is called my.dband lives in C:\users\you\, then:

DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'C:/users/you/my.db' 

Refresh

AFAIK . syncdb. . , Django, .

, , Django C:\users\you\myproject\. :

DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'C:/users/you/myproject/my.db' 
+3

, settings.py, , : c:/projects/project1/my_proj.db

, os.path

os.path.dirname() settings.py , , , os.path.join(os.path.dirname( ), 'my_proj.db')

+1

All Articles