Hi,
I got this error during the deployment of my Django app:
:42] File "/workspace/.heroku/python/lib/python3.11/site-packages/dj_database_url/__init__.py", line 126, in parse
[c-----] raise ValueError(
[c-----] ValueError: No support for ''. We support: cockroach, mssql, mssqlms, mysql, mysql-connector, mysql2, mysqlgis, oracle, oraclegis, pgsql, postgis, postgres, postgresql, redshift, spatialite, sqlite, timescale, timescalegis
What went wrong? Kind regards,
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Thank you for your support. In the meanwhile I solved the issue
Heya @heintjeb,
The issue seems to be related with the Django App itself rather than something on the App Platform.
The error
No support for ''. We support: cockroach, mssql, mssqlms, mysql, mysql-conne...
suggests that either theDATABASE_URL
environment variable is not set or its value is not in a format thatdj_database_url
can understand.Check Your
DATABASE_URL
Environment Variable: Ensure that theDATABASE_URL
environment variable is set correctly in your app’s settings. This variable should contain the full URL to your database, including the database type (likepostgres://
,mysql://
, etc.), username, password, host, port, and database name.Hi there,
The error you’re encountering during the deployment of your Django app is related to the configuration of your database connection.
The
ValueError
thrown by thedj_database_url
package suggests that it’s unable to recognize the database engine specified in your database URL.As the value of the engine in the log output is empty, it sounds like you’ve not defined it in your env variables.
Basically, yhe
dj_database_url.parse
function is designed to parse a database URL and return a Django database configuration dictionary. The error message indicates that the database engine part of your database URL (the scheme) is either missing or not one of the supported types. The supported types, as listed in the error, include various SQL and NoSQL databases like PostgreSQL (postgres
), MySQL (mysql
), SQLite (sqlite
), and others.You have to make sure that your database URL is set as an environment variable in your App Platform and is also correctly formatted and includes a valid scheme corresponding to the database you’re using. A typical database URL looks like this:
scheme://user:password@host:port/dbname
.If you are using a Managed Database Cluster, you can attach it to your app and then use the
DATABASE_URL
env variable:Let me know if you have any questions!
Best,
Bobby