简体   繁体   中英

python manage.py syncdb

I am very new to python and Django, was actually thrown in to finish off some coding for my company since our coder left for overseas.

When I run python manage.py syncdb I receive the following error

psycopg2.OperationalError: FATAL: password authentication failed for user "winepad"

I'm not sure why I am being prompted for user "winepad" as I've created no such user by that name, I am running the sync from a folder named winepad. In my pg_hba.conf file all I have is a postgres account which I altered with a new password.

Any help would be greatly appreciated as the instructions I left are causing me some issues.

Thank you in advance

Once you start a Django project, you have to set your database settings in your_project/settings.py . The settings you want to check/change is (assuming you use Django 1.3) something like this:

DATABASES = {
    'default': {
        'ENGINE': '',
        'NAME': '',
        'USER': '',
        'PASSWORD': '', 
        'HOST': '',
        'PORT': '',
    }
}

So make sure those settings are correctly set up (you have to do it manually)

Check your settings.py file. The most likely reason for this issue is that the username for the database is set to "winepad". Change that to the appropriate value and rerun python manage.py syncdb That should fix the issue.

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