2

I'm trying to install saleor on Windows, in the SECRET_KEY part throws an error saying that my SECRET_KEY cannot be empty, I suppose it must be entered by commands. What command is used in Windows to set a SECRET_KEY in Django and then continue to the next step of installing saleor?

  • The SECRET_KEY is just a long random string in your settings.py file. Check your settings.py file. – dirkgroten Aug 11 '19 at 11:08
  • That's the funny thing because the settings.py doesn't exist in the entire project, I've searching for this file a lot of hours an it doesn't exist, the repo with the files is https://github.com/mirumee/saleor – Cristian Javier Blanco García Aug 13 '19 at 22:12
  • 1
    Have you actually followed the [installation instructions](https://docs.getsaleor.com/docs/getting-started/installation-windows/) step by step? How about step 4??? – dirkgroten Aug 14 '19 at 07:10
  • The settings.py file is in **saleor/saleor/settings.py** but as the instructions suggest, don’t add the SECRET_KEY there. – dirkgroten Aug 14 '19 at 07:13

1 Answers1

4

First, settings.py exist indeed, you will found it inside "saleor" folder where you have cloned the project. In settings.py you'll found:

SECRET_KEY = os.environ.get("SECRET_KEY")

Which means that you really haven't a secret key setted up. Instead of this it will be capturing it from your environment variables, so here you must setup it:

Open a command prompt and type: setx SECRET_KEY "<your secret key>" (another method here: https://www.youtube.com/watch?v=bEroNNzqlF4)

Your secret key can be "hello" if you're just testing, or can generate a "real" key here: https://www.miniwebtool.com/django-secret-key-generator/

Regards!

Cristianjs19
  • 765
  • 1
  • 9
  • 15