Opened 4 years ago

Closed 4 years ago

#16143 closed Bug (needsinfo)

Default file should fully qualify database name setting

Reported by: anonymous Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords: settings, database name, sqlite3
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX:


While struggling through trying to get a WSGI implementation of Django+Pinax up and running, I finally went back to the basics and just tried to get an "out of the box" Pinax basic project working.

It worked fine using the development web server, but failed with the WSGI setup.

I finally narrowed it down to the fact that Apache couldn't find the sqlite3 database. And that was because the name wasn't fully qualified.

My solution was to change the default definition of the database name in to

"NAME": os.path.join(PROJECT_ROOT,"dev.db"),

it was:

"NAME": "dev.db",

Not a major bug here, but I believe that the "out of the box" solution should work in multiple environments without jumping through a lot of hoops. It just would have made my troubleshooting tonight a lot easier.

Change History (2)

comment:1 Changed 4 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This might not be an ideal solution, though, because if you change the type of database to mySQL (or another), then the name shouldn't be so complicated.

comment:2 Changed 4 years ago by aaugustin

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

In the default project template, the default value of NAME is empty :

    'default': {
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.

The tutorial docs are unambiguous :

NAME -- The name of your database. If you're using SQLite, the database will be a file on your computer; in that case, NAME should be the full absolute path, including filename, of that file

I don't understand how you obtained an "out of the box" solution with a relative name. Please tell us where you got that misleading information and re-open the ticket

Note that if the problem is in Pinax, you should report it at not here.

Note: See TracTickets for help on using tickets.
Back to Top