B
B
bamond2016-02-20 14:10:00
Django
bamond, 2016-02-20 14:10:00

Why error when using uwsgi + nginx?

Good afternoon.
When you run the python manage.py runserver project, everything works fine.
And when through a bunch of nginx + uwsgi , then such an error comes out when checking the authorization login.

OperationalError at /accounts/login/
(1045, "Access denied for user 'user'@'localhost' (using password: YES)")
Request Method:	POST
Request URL:	http://server/accounts/login/
Django Version:	1.6.12
Exception Type:	OperationalError
Exception Value:	
(1045, "Access denied for user 'user'@'localhost' (using password: YES)")
Exception Location:	/usr/lib64/python2.7/site-packages/MySQLdb/connections.py in __init__, line 187
Python Executable:	/usr/bin/uwsgi

url(r'^accounts/login/$','django.contrib.auth.views.login'),

This is despite the fact that in settings py the connection to mysql is registered with a completely different user and the connection is working.
Where does such an error come from? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Voronkov, 2016-02-20
@bamond

Somewhere in the wsgi settings is not the correct path, make sure that the settings of your project are imported in the wsgi.py file

# -*- coding: utf-8 -*-
import os
from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")

application = get_wsgi_application()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question