S
S
Sergey Eremin2014-07-24 13:55:34
Django
Sergey Eremin, 2014-07-24 13:55:34

How to get Django to work if it can't "resolve" a fixture for sqlite3?

When starting the project, an error is thrown:

CommandError: No database fixture specified. Please provide the path of at least one fixture in the command line.

Actually, the project works fine under UBUNTU, but when launched under WINDOWS 8, it swears like this. At the same time, nothing changed in the code itself (it continues to work under UBUNTU, despite the fact that the line indicating the path to the SQLITE database is specified as for windows):
DATABASES = {
  'default': {
   'ENGINE': 'django.db.backends.sqlite3',
   'NAME': 'C:\Users\Sergei\My Programm\django\prj16\db.sqlite', 
    }
}

The matter is that the project does not use any references to base.
In theory, SQLITE3 should work out of the box, but paranoia prompted me to check the environment libraries. After all, they are different for different systems. So it turned out, but installing similar Ubuntu environment libraries on Windows does not always work. When installing with PIP, for some of the libraries, the following is issued:
Could not find any downloads that satisfy the requirement __имя_библиотеки__
Some externally hosted failes were ignored (use --allow-external __имя_библиотеки__ to allow)

Another note: before, both under Windows and under UBUNTU, everything worked the same way. The problem arose unexpectedly (perhaps after a careless DJANGO update)
SYSTEM:
WINDOWS 8 (64 bit)
PYCHARM development environment (installation of problematic libraries does not go through it either).
There were suspicions that the problem is in the 64-bit system. Installed Python for x86. When running it, it also gives similar errors.
PS A similar question was raised on stackowerflow:
stackoverflow.com/questions/10565254/django-1-4-sa...
there, too, problems happened when updating DJANGO. There are no good answers and the problem has not been solved. :(
UDP: Downgraded DJANGO. Problem persists.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2014-07-24
@Sergei_Erjemin

from os import path, getenv
#....
# base dir отличается от дефолтного принятого в 1.6 
# возможно понадобиться поправить пути в других местах
BASE_DIR = path.abspath(path.join(path.dirname(__file__), '../..'))
#....
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': path.join(BASE_DIR, 'db.sqlite3'),
    }
}

again, it’s not clear, what for coding in a miserable OS

G
gimntut, 2014-07-24
@gimntut

In line
there is definitely an error. It would be correct like this:

'NAME': r'C:\Users\Sergei\My Programm\django\prj16\db.sqlite',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question