Skip to content

Commit

Permalink
Merge pull request #50 from debdutgoswami/nwoc
Browse files Browse the repository at this point in the history
Productionized
  • Loading branch information
PragatiVerma18 authored Dec 26, 2020
2 parents c2ea920 + 6818225 commit 1b29e59
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ cd Snippet-Share/snippet_share_project
```
pip install -r requirements.txt
```
- Copy example.env to .env and set the values accordingly
```
cp example.env .env
```
- Make migrations using
```
python manage.py makemigrations
Expand Down
3 changes: 3 additions & 0 deletions snippet_share_project/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DEBUG=false
SECRET_key=2&g68z@0fnz2+5=q5wb9vcdtv$ribu9b0_g*m=o$9zi9=h%^n4
ALLOWED_HOST=localhost
1 change: 1 addition & 0 deletions snippet_share_project/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Django==3.0.7
django-crispy-forms==1.9.0
pytz==2019.3
sqlparse==0.3.1
python-dotenv==0.15.0
14 changes: 9 additions & 5 deletions snippet_share_project/snippet_share/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"""

import os
from distutils.util import strtobool
from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -19,13 +23,13 @@
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '2&g68z@0fnz2+5=q5wb9vcdtv$ribu9b0_g*m=o$9zi9=h%^n4'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = strtobool(os.getenv('DEBUG', 'true'))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.getenv('SECRET_KEY', 'demo-secret')

ALLOWED_HOSTS = []
ALLOWED_HOSTS = [os.getenv('ALLOWED_HOST', 'localhost')]


# Application definition
Expand Down

0 comments on commit 1b29e59

Please sign in to comment.