Skip to content

Instantly share code, notes, and snippets.

@andyndev
Forked from Bouke/settings.py
Created November 25, 2017 20:36
Show Gist options
  • Save andyndev/15d4eaa7d4daae28bf980cd6897c8406 to your computer and use it in GitHub Desktop.
Save andyndev/15d4eaa7d4daae28bf980cd6897c8406 to your computer and use it in GitHub Desktop.
Django simple sqlite config
import os
# Define PROJECT_PATH as the project's root directory, according to new 1.4 layout:
#
# root
# |-- manage.py
# |-- project
# |-- settings.py
PROJECT_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_PATH, 'database.sqlite'),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment