简体   繁体   中英

Heroku python Tutorial Won't run locally in windows

I'm trying to run the python heroku tutorial and it won't work in windows. This is from this repository .

I posted this previously but I was able to get a more descriptive error message. It should be said that I've installed postgres.

Furthermore, I can't run it locally using the method defined in the git respository. Both the createdb and foreman commands don't work. This is despite installing foreman.

django.core.exceptions.ImproperlyConfigured: 'django_postgrespool' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
u'base', u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: DLL load failed: The specified module could not be found.

Looks like python does not know what django-postgrespool is.

Perhaps it did not install properly. Check the output of pip install -r requirements.txt

DATABASES['default']['ENGINE'] = 'django_postgrespool'

in your settings.py is what this is referring to. For me i still dont know why this is causing a problem. I've install psycopg2 and I even tried installing 'pip install django-postgrespool'. It worked once i commented out:

DATABASES['default'] = dj_database_url.config()

DATABASES['default']['ENGINE'] = 'django_postgrespool'

this helps me run the app locally by using the

heroku local web -f Procfile.windows

I was following the same tutorial and what worked for me was changing the settings.py file, this line:

# Enable Connection Pooling (if desired)
DATABASES['default']['ENGINE'] = 'django_postgrespool'

To this:

# Enable Connection Pooling (if desired)
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM