Need help running Django at a local machine after deploying it to DigitalOcean apps

I'm using Digital Ocean app platform to host my website but after following the settings from the end of this documentation from the website (at the end of step 2), there's something I think I'm missing cause I have deployed the app following the guide but now I can't run it on my local machine.

The error comes from this snippet, throwing the Exception "DATABASE_URL environment variable not defined"

elif len(sys.argv) > 0 and sys.argv[1] != 'collectstatic':
    if os.getenv("DATABASE_URL", None) is None:
        raise Exception("DATABASE_URL environment variable not defined")
    DATABASES = {
        "default": dj_database_url.parse(os.environ.get("DATABASE_URL")),
    }

Any clue? I thought I should use something like python-dotenv or django-dotenv or having multiple Django settings modules, but my brain right now is just frosted. Please help

Back to Top