diff --git a/.envsample b/.envsample deleted file mode 100644 index 08e49d0..0000000 --- a/.envsample +++ /dev/null @@ -1 +0,0 @@ -SECRET_KEY = VULCANWEBKEY diff --git a/README.md b/README.md index e05ea0b..89cc2d1 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,7 @@ And in frontend: ```shell npm install ``` -## 2. Create .env and make migrations -In the .env file put the code: -```shell -SECRET_KEY = VULCANWEBKEY -``` -After saving the files, we migrate with these commands: +## 2. Make migrations ```shell python manage.py makemigrations python manage.py migrate diff --git a/requirements.txt b/requirements.txt index e1abe1e..6bbeba5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ beautifulsoup4==4.9.3 bs4==0.0.1 Django==3.1.3 -python-dotenv==0.15.0 requests==2.24.0 cryptography==3.2.1 \ No newline at end of file diff --git a/wulkanowy/settings.py b/wulkanowy/settings.py index e27fd66..36d57bc 100644 --- a/wulkanowy/settings.py +++ b/wulkanowy/settings.py @@ -12,7 +12,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/ from pathlib import Path import os -import dotenv +from cryptography.fernet import Fernet ROOT_PATH = os.path.dirname(__file__) # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -22,11 +22,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ -dotenv_file = os.path.join(BASE_DIR, ".env") -if os.path.isfile(dotenv_file): - dotenv.load_dotenv(dotenv_file) - -SECRET_KEY = os.environ['SECRET_KEY'] # Instead of your actual secret key +SECRET_KEY = Fernet.generate_key().decode('utf-8') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True