jazzband / dj-database-url

Use Database URLs in your Django Application.
https://pypi.org/project/dj-database-url/
BSD 3-Clause "New" or "Revised" License
1.48k stars 205 forks source link

Document how to specify local MySQL db #112

Closed trodicaro closed 1 year ago

trodicaro commented 5 years ago

DATABASES['default'] = dj_database_url.config(default="mysql://myname:mypass@localhost:3306/db_name") works.

douglaspetrin commented 5 years ago

@trodicaro did you just remove the dict DATABASES = { } ?

in your settings.py you just added this line?

DATABASES['default'] = dj_database_url.config(default="mysql://myname:mypass@localhost:3306/db_name")

douglaspetrin commented 5 years ago

I just figure it out doing this:

settings.py

DATABASES = { 'default': dj_database_url.config( default=config('DATABASE_URL') ) }

.env

DATABASE_URL= "mysql://myuser:mypass@my_host:3306/my_db_name"

=)

mattseymour commented 1 year ago

This is an old issue closing it off. If you feel this is still a requirement please create a new ticket.