Skip to content

Commit d5e341d

Browse files
Add production env variable
1 parent f36b951 commit d5e341d

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Virtual Environment
2-
/project_env
2+
/venv
33

44
# Byte-compiled / optimized / DLL files
55
__pycache__/

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This app was created following [Corey Schafer's](https://www.youtube.com/watch?v
88

99
## Live Demo
1010

11-
[View the Live Demo](https://andrewbaldwin-django-blogger.herokuapp.com/)
11+
[View the Live Demo](https://django-blog-7rxa.onrender.com/)
1212

1313
## Features
1414

@@ -69,17 +69,19 @@ This app was created following [Corey Schafer's](https://www.youtube.com/watch?v
6969

7070
## Deploy the Project
7171

72-
__Clone the repo to your local machine using the terminal__:
72+
**Clone the repo to your local machine using the terminal**:
73+
7374
```
7475
$ git clone git@github.com:andrewbaldwin44/Django_Blog.git
7576
```
7677

77-
__Deploy the Development Server__:
78+
**Deploy the Development Server**:
79+
7880
1. Move into the project directory `cd django_blog`
79-
2. Create a virtual environment: `python3 -m venv project_env`
80-
3. Activate the virtual environment: `source project_env/bin/activate`
81+
2. Create a virtual environment: `python -m venv venv`
82+
3. Activate the virtual environment: `source venv/bin/activate`
8183
4. Install the dependencies: `pip install -r requirements.txt`
82-
5. Start the development server: `python manage.py runserver `
84+
5. Start the development server: `python manage.py runserver`
8385

8486
This will run the app in the development mode.<br />
8587
Open [http://localhost:8000](http://localhost:8000) to view it in the browser.

django_blog/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
SECRET_KEY = os.environ.get('SECRET_KEY')
2626

2727
# SECURITY WARNING: don't run with debug turned on in production!
28-
DEBUG = True
28+
DEBUG = os.environ.get('PRODUCTION') != 'true'
2929

30-
ALLOWED_HOSTS = ['localhost', 'andrewbaldwin-django-blogger.herokuapp.com']
30+
ALLOWED_HOSTS = ['localhost', 'https://django-blog-7rxa.onrender.com/']
3131

3232

3333
# Application definition

0 commit comments

Comments
 (0)