I need to create an SQLite database with Django and Python 2.7.
However, when I run "python manage.py syncdb", I receive:
unable to open database file
Here is a fragment of settings.py file:
import os
MANAGERS = ADMINS
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_DIR, 'db'),....
I have read several books and tutorials, but can't make a database on Windows.
change 'NAME': os.path.join(PROJECT_DIR, 'db'), to 'NAME': 'database.db',
I need to create an SQLite database with Django and Python 2.7.
However, when I run "python manage.py syncdb", I receive:
unable to open database file
Here is a fragment of settings.py file:
import os
MANAGERS = ADMINS
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_DIR, 'db'),....
I have read several books and tutorials, but can't make a database on Windows.
change 'NAME': os.path.join(PROJECT_DIR, 'db'), to 'NAME': 'database.db',
0 commentaires:
Enregistrer un commentaire