As a beginner in Python i must understand this code:
from settings import PROJECT_ROOT
--> I am trying in the Python Shell to type this but Python gives me a Traceback even though i have such a module
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # 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.
}
}
--> I want to use sqlite the db that is built into Python but i really can't understand what i must do
Pardon me for the basicness of the question but i feel overwhelmed by the task i have in Python these days.
For reasons of completness this is all the code in the module which is called settings.py
:
from settings import PROJECT_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # 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.
}
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = ''
# Python dotted path to the WSGI application used by Django's runserver; added in v1.4
WSGI_APPLICATION = 'wsgi.application'
############### PYSEC specific variables
# assumes this directory exists
DATA_DIR = "%s/pysec/data/" % PROJECT_ROOT
UPDATE
I dont want to stress your already overstressed patience but why does it keep telling me the SECRET_KEY
value is empty? I put
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'sdfgtardyure34654356435'
and it gives me ths in text
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
Here it is in a pic in the cmd