mysql - Access denied to ClearDB database using Python/Django on Heroku -
i'm trying build webapp on heroku using python/django, , followed tutorial set django project , push heroku. however, can never normal django "it worked!" screen. of course, because when check heroku ps, there never processes running. there no procfile according tutorial, shouldn't matter django app.
when run heroku run python manage.py runserver, following error occurs:
unhandled exception in thread started <bound method command.inner_run of <dja ngo.contrib.staticfiles.management.commands.runserver.command object @ 0x1ff819 0>> traceback (most recent call last): file "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/com mands/runserver.py", line 91, in inner_run self.validate(display_num_errors=true) file "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/bas e.py", line 266, in validate num_errors = get_validation_errors(s, app) file "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/val idation.py", line 103, in get_validation_errors connection.validation.validate_field(e, opts, f) file "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/mysql/v alidation.py", line 14, in validate_field db_version = self.connection.get_server_version() file "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/mysql/b ase.py", line 411, in get_server_version self.cursor() file "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/__init_ _.py", line 306, in cursor cursor = self.make_debug_cursor(self._cursor()) file "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/mysql/b ase.py", line 387, in _cursor self.connection = database.connect(**kwargs) file "/app/.heroku/venv/lib/python2.7/site-packages/mysqldb/__init__.py", line 81, in connect return connection(*args, **kwargs) file "/app/.heroku/venv/lib/python2.7/site-packages/mysqldb/connections.py", l ine 187, in __init__ super(connection, self).__init__(*args, **kwargs2) _mysql_exceptions.operationalerror: (1044, "access denied user '<user> '@'%' database 'heroku_<####################>?reconnect=true'") i did set database_url value of cleardb_database_url. also, in django settings.py, added instructed:
import dj_database_url databases = {'default': dj_database_url.config(default='postgres://localhost')} any appreciated.
that particular error fixed after calling cleardb. turns out ?reconnect=true rails apps, , should removed database_url django apps.
Comments
Post a Comment