1👍
Try using python manage.py shell
to open the python shell.
Usually the settings.py
file reside inside the project root directory, so in order to import the PROJECT_ROOT
variable, you can use from project_name.settings import PROJECT_ROOT
[EDIT]
To use the sqlite engine, change the DATABASES
dictionary to:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_ROOT, '/project_database/db_name.sqlite3'),
}
}
2[EDIT]
There’s no stress. Like a tip, see this Adding Python Path on Windows 7 question to add the python files to the win path variable, this help you to avoid to put your projects inside c:PythonXX, and use another directory instead.
I’ve take a look at the linked github project, and it seems to explain inside the README file that you must add a SECRET_KEY and a DATA_DIR variables.
Here’s a workaround I’ve done to get work that project:
$ git clone https://github.com/lukerosiak/pysec.git
$ cd pysec
$ ls # the dir command when on Windows
README.md
TODO.md
local_settings-example.py
manage.py*
pysec/
requirements.txt
settings.py*
$ cp local_settings-example.py local_settings.py
Edit the local_settings.py
file and modify the SECRET_KEY and DATA_DIR variables:
SECRET_KEY = '@r65u-33v3vu-e^h-%u4kg=g9y5z'
DATA_DIR = '/home/slacker/pysec/project_database' # or something like: C:\\users\tosh\pysec\
project_database
Run:
$ python manage.py syncdb
I hope it can help!