I was using an sqlite
database and after applying python manage.py dumpdata
I added the new postgresql
database settings in settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'music',
'USER': '**',
'PASSWORD': '****',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
But when I try to load the data into the new postgresql
database I get the following error
C:\Users\Saket\musicalguru>python manage.py loaddata
usage: manage.py loaddata [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--database DATABASE]
[--app APP_LABEL] [--ignorenonexistent]
fixture [fixture ...]
manage.py loaddata: error: No database fixture specified. Please provide the path of at least one fixture in the command line.
Can't understand what the error is. I already have data in my sqlite
database so I need the new data in the postgresql
database too.
Can you show how you did the data dump? If you look at the
dumpdata
docs, you'll see that it:And:
Now, if you take a look at your error, you'll see that you are missing a database fixture. The
loaddata
docs tells what a fixture is and where Django will look for fixtures:So, the file that you dump your data to can be used: