I'm trying to build a webapp on Heroku using Python/Django, and I just followed the tutorial to set up a Django project and push it to Heroku. However, I can never even get to the normal Django "It worked!" screen. Of course, that is because when I check heroku ps
, there are never any processes running. There is no Procfile
but according to the tutorial, that shouldn't matter for a Django app.
When I run heroku run python manage.py runserver
, the following error occurs:
Unhandled exception in thread started by <bound method Command.inner_run of <dja
ngo.contrib.staticfiles.management.commands.runserver.Command object at 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_runself.validate(display_num_errors=True)File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/bas
e.py", line 266, in validatenum_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_errorsconnection.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_fielddb_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_versionself.cursor()File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/__init_
_.py", line 306, in cursorcursor = 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 _cursorself.connection = Database.connect(**kwargs)File "/app/.heroku/venv/lib/python2.7/site-packages/MySQLdb/__init__.py", line81, in Connectreturn 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 for user '<user>
'@'%' to database 'heroku_<####################>?reconnect=true'")
I did already set my DATABASE_URL
to the value of CLEARDB_DATABASE_URL
. Also, in the Django settings.py
, I added as instructed:
import dj_database_url
DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
Any help would be greatly appreciated.