Opened 10 years ago

Closed 10 years ago

#530 closed defect (invalid)

Unable to initialize SQLite database

Reported by: anonymous Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: critical Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Plateform: Win2000; python2.4; pysqlite 2.0.4; django 654 revision

While Initializing, got the error:

Error: The database couldn't be initialized.
unable to open database file

p.s. did include absolute path in main.py for sqlite (such as c:\xxx\xxx)
======main.py==========
DATABASE_ENGINE = 'sqlite3' # 'postgresql', 'mysql', or 'sqlite3'.
DATABASE_NAME = 'C:\DjanGoProject\first_proj\sqlitedb' # Or path to database file if using sqlite3.
DATABASE_USER = # Not used with sqlite3.
DATABASE_PASSWORD =
# Not used with sqlite3.
DATABASE_HOST = # Set to empty string for localhost. Not used with sqlite3.

Change History (1)

comment:1 Changed 10 years ago by Eugene Lazutkin

  • Resolution set to invalid
  • Status changed from new to closed

You should escape \ in strings. Example:

'C:\\DjanGoProject\\first_proj\\sqlitedb'

Or use / instead:

'C:/DjanGoProject/first_proj/sqlitedb'
Note: See TracTickets for help on using tickets.
Back to Top