Cloud-CV / CloudCV-Old

CloudCV - Large-Scale Distributed Computer Vision As A Cloud Service
http://cloudcv.org
MIT License
51 stars 37 forks source link

Extract secret key from Environment Variable #27

Closed shivamMg closed 8 years ago

shivamMg commented 8 years ago

Secret Key should be set as an environment variable and then extracted into settings. It should not be specified inside source code.

This commit might break already installed forks. They must set a SECRET_KEY environment variable as the original secret key they had been using. They must set SECRET_KEY inside cloudcv17/config.py as the original secret key they had been using.

deshraj commented 8 years ago

@shivamMg what we have in our mind is that keeping the SECRET_KEY in the config file that we have. All the necessary details will be stored in that file only.

shivamMg commented 8 years ago

@DESHRAJ So we will have to add a new configuration file to the repo, right? Because this file must be read when settings.py is loaded. We can put this configuration in a secrets.json file and then load it with settings.py, like the djangoproject does it.

deshraj commented 8 years ago

@shivamMg see the file https://github.com/batra-mlp-lab/CloudCV/blob/master/cloudcv17/config.py . This is the file that we will be using for storing the configuration keys. Can you make changes to the PR accordingly and then we are good to go. Let me know if something is not clear.

shivamMg commented 8 years ago

@DESHRAJ Done :+1:

shivamMg commented 8 years ago

@DESHRAJ The build is failing because the secret key is being imported and not being used inside settings.py. I think we should keep it as SECRET_KEY = config.SECRET_KEY

deshraj commented 8 years ago

Ok cool. Not an issue. :+1:

shivamMg commented 8 years ago

@DESHRAJ :+1: