0

I want deploy Django app on heroku. When I try sync db localy i get error message:

ImportError: Could not import settings 'aplikacjaKZ.settings' (Is it on sys.path?): No    module named dj_database_url

I installed dj database url. This is my requirements file:

    Django==1.5.1
    argparse==1.2.1
    distribute==0.6.34
    dj-database-url==0.2.2
    dj-static==0.0.5
    django-toolbelt==0.0.1
    gunicorn==17.5
    psycopg2==2.5.1
    static==0.4
    wsgiref==0.1.2

This is my settings:

DATABASES = {'default':  dj_database_url.config(default='postgres://localhost')}

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', 
        'NAME': '/var/db/appKZ',        
        'USER': '',
        'PASSWORD': '',
        'HOST': '',                      
        'PORT': '',             
    }
}
Mr Jedi
  • 33,658
  • 8
  • 30
  • 40

1 Answers1

3

heroku has been kind enough to explain this process in details here https://devcenter.heroku.com/articles/getting-started-with-django

From the error, it seems like dj database url is really not on the system path,

Here are somethings you should look out for

  1. Install the Dependencies in the requirements.txt file using

    pip install -r requirements.text

  2. Double check that you have activated venv. You can do this by running

    venv/scripts/activate.bat # assuming that "venv" is the name of your virtual Environment

e911miri
  • 31
  • 3