Skip to content
Advertisement

Error in running a project regarding virtual environment and “DJANGO_SECRET_KEY” in VS code

I want to run a project from gitlab on my local machine. I cloned the project, created a virtual environment and activated it. When I want to run without debugging I got this error:

JavaScript

The output of this project is a form, how can I solve this error to get the output?

Advertisement

Answer

There’s a good explanation here https://stackoverflow.com/a/47117966/20027268

basically it’s used for securing data in a django app, you can get around this for now by setting the DJANGO_SECRET_KEY environment variable to something random for now:

Windows: https://www.tutorialspoint.com/how-to-set-environment-variables-using-powershell

Mac: export [variable_name]=[variable_value]

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement