Django-nodejs-ishoutjs-redis: IntegrityError: UNIQUE constraint failed: auth_user.username - python

My goal is to build a realtime notification app using Django(1.8.5). I am using django server, Nodejs as push server, ishout.js[nodejs+redis +express.js API]. So I installed them by following the instructions.
I have build the whole project, Kindly suggest how it can be fixed
Error:1) Now when I am doing "$ python manage.py shell" , I get this error http://pastebin.com/DnGjpYEn
Actually by mistake I entered wrong password in first attempt, username was correct but password parameter got wrong, Now can I reset that to avoid the error depicted in pastebin above. By any ways and means can I repeat that step in correct manner. Also, initially there was some warning message related to sqlite3 in ubuntu terminal, hence in response to that I used "$ python manage.py migrate"
Code can be accessed at https://github.com/arunsingh/real_time_notification

Related

Password authentication failed when trying to run django application on server

I have downloaded postgresql as well as django and python but when I try running the command "python manage.py runserver" it gives me an error saying "Fatal: password authentication failed for user" . I am trying to run it locally but am unable to figure out how to get past this issue.
I was able to connect to the server in pgAdmin but am still getting password authentication error message
You need to change the password used to connect to your local Database, and this can be done, modifying your setting.py file in "DATABASES" object

Problem with `python manage.py runserver` command An attempt was made to access a socket

I have an issue which says An attempt was made to access a socket in a way forbidden by its access permissions. This issue is appearing when I use python manage.py command to run the server.
Here is a picture with the problem . Give some advice, tutorial or anything which could help me to fix it.

Odoo/OpenERP "Unable to login on database odoo"

I am trying to install Odoo on a hosted machine. First, I created a new Postgres user "odoo" with database "odoo". Then, I cloned the GIT repositry "https://github.com/odoo/odoo". After that I ran:
./openerp-server -s -c server.cfg
This created a configuration file named "server.cfg". I edited the configuration by changing the database parameters. After that, I ran
./openerp-server -c server.cfg
This loaded all the necessary addons and the server started running.
Whenever I open the browser, I keep getting to the following url:
http://erp.example.com/web/database/selector?error=Unable%20to%20login%20on%20database%20odoo
I thought maybe this is a database error. So, I checked the database and all the tables are created in the database.
The database user and password created all the tables but for some reason I can't login to the database.
Has anyone had an issue like this? If yes, how did you fix it?
Maybe you don't set a password for your database yet, if it's the case: do it with this query :
ALTER USER odoo WITH ENCRYPTED PASSWORD '<type your password here>';
or : run odoo in the debug mode for see some details about the problem :
try this command
python openerp-server -r odoo -w '<the password>' --db_port=<5432 by default> --debug

Django can't find user with 'python manage.py changepassword'

I've got some code (using Python 3.4, Django 1.7, and PostgreSQL) that I pushed to Heroku. Everything worked fine until I added a login. Just like on my local machine, I used the shell to add a user, create a password, and save the user/password. That pattern worked locally, even with foreman.
The setup that seems to have worked:
heroku run python3 manage.py shell
a = User.objects.get(id=1)
a
The server returns
<User: {'username':'Me'}>.
Asking for a.password returns a hashed password that changes when I do a.set_password('Blah') and then a.save().
That's all good and normal, except that the username/password (unhashed) won't log me in. When I run:
heroku run python3 manage.py changepassword Me
Heroku responds with:
CommandError: user 'Me' does not exist
How can a user be saved and retrievable in the shell, implying it's in the database, but not be found otherwise using "manage.py changepassword"?
Most importantly, how can I log into my website on Heroku?
****Edit****
I ran python manage.py createsuperuser in the Heroku shell to create a user so I could log in. Once I did, I saw that none of my CSS loaded. I'm not sure how that's related, but two big problems at the same time make me suspicious that it's something totally unrelated.

Django, MySQL, syncdb: Access Denied to valid user

I have a Django application that is running just fine on two other servers. It is using MySQL as the database.
I have the user setup for a new instance of the application on a new server so that I can successfully connection via the mysql command line client to the remote database.
However, when I attempt to run ./manage.py syncdb, it tell me:
django.db.utils.OperationalError: (1045, "Access denied for user 'app_user'#'mynewserver.com' (using password: YES)")
Every place I've looked online tell me to make sure the user is setup in mysql and has permission to the new database and even to run flush privileges;. I have double checked all of those and done this multiple times. That doesn't seem to be the issue.
Any thoughts?
EDIT
Also, I just checked and running the following from the python command line works fine too:
conn = mysql.connect(host='mynewserver.com', user='app_user', passwd='secret', db='myapp').cursor(mysql.cursors.DictCursor)
EDIT 2
I just ran ./manage.py sql myapp > myapp.sql; ./manage.py dbshell < myapp.sql
Everything worked, it created the tables just fine. I'm assuming that would use the same permissions and settings as running ./manage.py syncdb. What gives?!?
Versions
Python==2.7.6
Django==1.6.1
EDIT 3
I guess I should also add that I am using South==0.7.6. If that helps.
I did leave something out that I didn't think was relevant, but is totally relevant.
This application has multiple databases defined. Syncdb only runs on one database at a time, and by default will run using the default database, as noted here:
https://docs.djangoproject.com/en/1.6/topics/db/multi-db/#synchronizing-your-databases
However, when my user didn't have permission on the other database syncdb would fail. It didn't indicate which database it was trying to access.
Running ./manage.py reset_db from django-extensions, worked fine as well, before I made sure that the user had permissions on all databases.
I would assume then that there is a bug in syncdb. After more looking into this, I might have to report a bug to Django.

Categories