10

I am beginner lift with django mongodb on heroku [ addon : mongolab ].

heroku run python manage.py syncdb

Running python manage.py syncdb attached to terminal... up, run.2332 Creating tables ...

OperationFailure: database error: not authorized for query on database.system.namespaces consider editing privileges on the basis of data mongo

.

>use admin
>db.addUser({ user: "myadmin", pwd: "1234", roles: ["userAdminAnyDatabase"] })

but get:

Error: couldn't add user: not authorized on admin to execute command 

Thanks in advance.

Héctor Valverde
  • 1,089
  • 1
  • 14
  • 34

3 Answers3

1

Heroku Postgres does not allow for user creation. You'll want to use the connection string provided in DATABASE_URL. Actions like creating/dropping DB's and creating users is prohibited.

jmccartie
  • 4,956
  • 8
  • 50
  • 71
0

I think this is more a heroku problem than a django problem. It appears to be that you're not allowed to add users on the mongodb instance; were you send a username and password to plug into the django settings?

phildini
  • 129
  • 1
  • 12
0

First you should connect to your mongodb terminal without any authentication, then you try to create user or user-role which you want to do.

check this link for more information. here

Ravi
  • 216
  • 3
  • 11