Skip to content

Commit 4509b64

Browse files
committed
Render Deployment Section UPD
1 parent 8508c4e commit 4509b64

File tree

5 files changed

+74
-219
lines changed

5 files changed

+74
-219
lines changed

docs/deployment/render/README.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
sidebar_position: 4
3-
sidebar_label: Render Deployment Platform
4-
description: Render Deployment Platform Index
2+
title : Render Deployment Platform
3+
sidebar_label: Render Platform
54
---
65

76
# Render Platform

docs/deployment/render/django-react.mdx

Lines changed: 0 additions & 78 deletions
This file was deleted.

docs/deployment/render/django.mdx

Lines changed: 70 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,108 @@
11
---
2-
sidebar_position: 2
3-
description: How to deploy Django to Render Deployment Platform
2+
title : Django - Deploy on render
3+
sidebar_label: Deploy Django on Render
44
---
55

66
# Deploy Django to Render
77

8-
<SubHeading color="#25c2a0">How to deploy Django to Render Deployment Platform</SubHeading>
8+
<SubHeading color="#25c2a0">This page explains how to deploy Django on Render</SubHeading>
99

10-
@Todo - General information Render Platform
10+
[Render](https://render.com/) fully supports **Python-based** applications and this page explains the steps that any developer can follow and deploy their apps using a minimal configuration.
11+
Any **Django** project can be deployed in two ways:
1112

12-
> Topics covered
13+
- As a Service: the deployed app runs standalone (not connected with other services)
14+
- As a Blueprint, where the Django App can be connected with other local services like cron, background tasks, or a React UI.
1315

14-
- `Render` Account Creation
15-
- `Render` Account Settings
16-
- The project to be deployed
17-
- `Render` Environment set up
18-
- `Render` Domain settings
19-
- `Render` SSL certificates
20-
- `Render` LIVE Service monitoring
16+
This page covers the case when Django is deployed as a service.
2117

22-
## `Render` Account Creation
18+
## Deploy as a Service
2319

24-
Render provide Social auth and email auth, based on your preference you can sign up with Render
20+
To deploy **Django** as a service, the steps are:
2521

26-
**IMG_render_signup**
22+
- Create a new Render account using GitHub
23+
- Using GitHub for authentication facilitates the deployment of the project from the sources directly
24+
- Navigate to the main Dashboard
25+
- Create a `New Service`
26+
- Connect a GitHub Repository. For DEMO we will use:
27+
- https://github.com/app-generator/django-admin-datta
28+
- Configure the project
29+
- Name
30+
- Runtime: Needs to be Python
31+
- Build Command
32+
- this is responsible to install modules, collect statics, and build DB
33+
- Start Command
34+
- here we need to call `Gunicorn` using the `app entry point` as input
35+
- Select the Instance Type
36+
- For this DEMO we will use a free one
37+
- Optionally, we can specify `ENV Variables`, and disable the `auto-deploy`
38+
- Confirm the action
39+
- click on `Create Service`
2740

28-
Once successfully signed up, the user is redirected Render dashboard and sees the screen like below:
41+
The steps with the related screens, are listed below:
2942

30-
**IMG_render_dashboard**
43+
### `Create new Service`
3144

32-
## `Render` Account Settings
45+
![Render - Create Service](https://user-images.githubusercontent.com/51070104/227564422-e97977c4-d92f-4a25-9852-66ff25de793f.png)
3346

34-
The Next step is to connect the Render account with the GitHub account, If you sign up with GitHub then this step is automatically done.
47+
<br />
3548

36-
**IMG_render_account_settings**
49+
### `Connect` a GitHub `Repository`
3750

38-
## The project to be deployed
51+
> This demonstration uses [Datta Able Django](https://github.com/app-generator/django-admin-datta)
3952
40-
Source project: https://github.com/app-generator/django-react-soft-dashboard
53+
![Render - Connect Repo](https://user-images.githubusercontent.com/51070104/227562328-8cb53fab-f5c2-4764-a693-3fd5743ac85e.png)
4154

42-
To deploy the Django app on Render we need to choose the **Web Service** option from the Dashboard as shown below:
55+
<br />
4356

44-
**IMG_render_dashboard_web_service**
57+
### `Naming the Service`
4558

46-
---
59+
![Render - Configure Name](https://user-images.githubusercontent.com/51070104/227562561-a794f42c-9d86-4192-9e94-4091ddf97e59.png)
4760

48-
After selecting the web service option, the next step is to connect the GitHub project repository. On the next page, we can select the project from the linked account, with private or public visibility.
61+
<br />
4962

50-
**IMG_render_web_service**
63+
### `Configure` the Service
5164

52-
---
65+
This step is quite important because we need to inform Render that our project needs Python to run, and also what should be executed before going live.
66+
This open-source starter combines the build set up in single file named [build.sh](https://github.com/app-generator/django-datta-able/blob/master/build.sh) responsible with the following tasks:
67+
68+
- Upgrade PIP (recommended to use a newer version)
69+
- Install modules via PIP
70+
- Collect Static
71+
- Migrate DB
72+
73+
Another important setting is the `Start Command` that specify the entry point to be used by `Gunicorn`. For this starter, this is the value.
74+
75+
`$ gunicorn core.wsgi:application`
76+
77+
![Render - Configure Runtime Environment, Build Command](https://user-images.githubusercontent.com/51070104/227562806-2149a7a7-e2e0-4e9e-bb95-1e28b3400b84.png)
78+
79+
<br />
5380

54-
The next step is to edit deployment details. Here are the sections that need editing:
81+
### `Configure` the Instance
5582

56-
- **Name**: In this section, we should use a unique name for the web service.
57-
- **Root Directory**: By default, the root directory is set to the top-level directory in your repository. We have also the possibility to select subfolders in case the project structure is modular and for instance, the backend and the frontend use different directories
58-
- **Environment**: In this section, we should select the language used to code the product, Python in our case.
59-
- **Region**:- The region where your web service runs, not required to update by default is `Oregon (US West)`
60-
- **Branch**:- The repository branch used for your web service.
61-
- **Build Command**: The shell script that executes all the steps to build the project
62-
- **Start Command**: This section informs Gunicorn where to locate the entry point in our Django starter: `gunicorn core.wsgi:application`
63-
- **Add Environment Variables** required by the starter in `Advanced` section.
64-
- Python Version: `PYTHON_VERSION` = `3.10.4`
65-
- `GUNICORN_CMD_ARGS` = `--preload --bind=0.0.0.0:2000`
66-
- `PORT` = `2000`
67-
- `DJANGO_ALLOWED_HOSTS` = `.onrender.com`
68-
- **Auto-Deploy**: Render provide this option to trigger a new deployment on every push to the repository. In case this feature is not useful, set this option to "NO" for manually managed deployments
83+
Here we have two options: Free & Paid. For this deployment, a free instance was selected.
6984

70-
With all the above settings specified as per project requirements, we can confirm the action and actually Create the new Service.
85+
![Render - Configure Instance Type (free or PAID)](https://user-images.githubusercontent.com/51070104/227563102-250d7fab-ce8b-4bd2-8917-5bdd610bf4c5.png)
7186

72-
**IMG_render_django_deployment_settings**
87+
<br />
7388

74-
## `Render` Domain settings
89+
### `Confirm` & View Deployment Logs
7590

76-
Render by default provides the domain itself, but the user can set up a custom domain based as well. For more information feel free to access the official documentation regarding [custom domains](https://render.com/docs/custom-domains).
91+
Once the above set up is confirmed, Render will create a new page for the sevice where we can visualize the deployment logs and later, update the service settings.
7792

78-
## `Render` SSL certificates
93+
![Render - Visualize Deployment Logs](https://user-images.githubusercontent.com/51070104/227563520-5cf26600-c0d4-417e-921e-ab0d1f3f80af.png)
7994

80-
Render Platform provides valid SSL certificates for all managed services, and also offers the possibility to customize the certificates.
95+
<br />
8196

82-
## `Render` LIVE Service monitoring
97+
### Access the `LIVE Deployment`
8398

84-
Once the project is deployed, the users have the possibility to set up alerts in Health & Alerts section (Project Settings).
99+
At this point, the app should be up & running in the same way as [Datta Able](https://django-datta-able.appseed-srv1.com/) Deployment
85100

86-
The `Health Check Path` is the public URL of the project that should return a 200 status code on access.
101+
![Render - Datta Able is LIVE](https://user-images.githubusercontent.com/51070104/227563947-1373ad49-87b5-4b7a-bcdb-1c9e5597731f.png)
87102

88-
Another option is to get notified via Email in case of Service failure.
103+
<br />
89104

90-
## Links & Resources
105+
## Resources
91106

92-
- [Render Django deployment](https://render.com/docs/deploy-django) - Official Guide to deploy Django app on Render
93-
- [Custom domains on render](https://render.com/docs/custom-domains) - Official Guide to setup custom domain
94-
- [Shell Script](https://www.shellscript.sh/) - Official Guide to shell script
95-
- [Django](https://www.djangoproject.com/) - Official Guide to Django Framework
96-
- [Gunicorn](https://gunicorn.org/) - Official Guide to Gunicorn
107+
- 👉 More [Django Starters](https://appseed.us/apps/django/) - provided by `AppSeed` (free & paid)
108+
- 👉 Free [Support](https://appseed.us/support/) via Email & Discord

docs/deployment/render/flask.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
sidebar_position: 1
3-
description: Deploy Flask to Render
2+
title : Flask - Deploy on Render
3+
sidebar_label: Deploy Flask on Render
44
---
55

66
# Deploy Flask to Render

docs/deployment/render/react.mdx

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)