You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issues fixed:
- Use python3-pip instead of python-pip in the PDF
- Use postgresql:// url instead of postgres:// since that's now deprecated
- Ensure ToC links work properly
This is a tutorial on setting up a server on DigitalOcean, a cloud computing platform. We will walk through whole process from creating an account to setting up a server instance and connecting to it. The process should be similar for any cloud computing services. Once you set up your server on any platform of your choice the remaining deploying steps should be identical. Here is a tutorial that may serve as a general guide on deploying your Python app onto any hosting platforms: [How to Deploy Python App Using uWSGI and Nginx](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md).
4
-
5
-
# DigitalOcean
3
+
This is a tutorial on setting up a server on DigitalOcean, a cloud computing platform. We will walk through whole process from creating an account to setting up a server instance and connecting to it. The process should be similar for any cloud computing services. Once you set up your server on any platform of your choice the remaining deploying steps should be identical. Here is a tutorial that may serve as a general guide on deploying your Python app onto any hosting platforms: [How to Deploy Python App Using uWSGI and Nginx](https://github.com/tecladocode/rest-apis-flask-python/blob/master/guides/How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.pdf).
6
4
7
5
DigitalOcean is a cloud infrastructure provider focused on simplifying web infrastructure for software developers. It allows you to rent servers with different performance at different cost. For more detailed information, you may refer to the official website help page [here](https://www.digitalocean.com/help/).
8
6
9
-
# Creating an account
7
+
##Creating an account
10
8
11
9
You can sign up to DigitalOcean using our affiliate link. Doing so gives you a starting credit of $10, which allows you to rent a server for 2 months. Click this link to create your account and get the $10: [https://m.do.co/c/d54c088544ed](https://m.do.co/c/d54c088544ed). If the link doesn't work, paste it into your browser.
12
10
13
11

14
12
15
13
After clicking the link, you should see a page like the above. Create your account at the left-bottom corner and you'll receive the $10 automatically. Beware that you'll be asked to provide payment info when creating the account, since all services (which you'll choose below) in DigitalOcean will be charged after your credit runs out.
16
14
17
-
# Creating a Droplet
15
+
##Creating a Droplet
18
16
19
17
A server instance in DigitalOcean is called a `Droplet`. It's just a name that may vary in different platforms, for example, `Dyno` for `Heroku` and `EC2` for `AWS` (Amazon Web Service). Below are the steps to create a `Droplet`.
20
18
21
-
## Choosing an image
19
+
###Choosing an image
22
20
23
21
To create a `Droplet`, we must first specify an image, that is, choosing what Operating System you want for the server. We recommend to use a Ubuntu LTS (Long Term Support) distribution. For more info on Ubuntu life time, please refer to the [official Ubuntu end of life page here](https://www.ubuntu.com/info/release-end-of-life). In our example, we'll use `Ubuntu 16.04.* x64`, which is an LTS distribution.
24
22
25
23
### Choosing a size
26
24
27
25
Next, we need to choose the specs for our server. In this tutorial, we'll be using the most basic tier of a Standard `Droplet`, which offers a single CPU with 512MB RAM, 20GB SSD and 1000 GB transfer at $5 per month. Generally, it's more than enough for running personal applications. You may also run several services in a single Droplet.
28
26
29
-
## Choosing a datacenter region
27
+
###Choosing a datacenter region
30
28
31
29
Generally, choosing a region that's _closest to your users_ will make your service deliver faster. If your users are primarily in the United States, you could choose a United States-based Droplet.
32
30
33
-
## Other configurations
31
+
###Other configurations
34
32
35
33
In our example, we do not need to add any other services such as block storage or private network. So we will ignore these settings to keep our setup simple and cheap. You may choose to use `SSH` key or you can just leave it unchecked and a password will be generated for you. If you choose to use SSH key, then each time you want to login to the server, you will need to provide the key. Since you have to have access to the SSH key whenever you log in, it can be more secure or more troublesome depends on scenarios. At last, you may change the name of your `Droplet` to something you like and then click `Create` to create and launch your `Droplet`.
@@ -46,8 +44,8 @@ Now you will be shown a console connected to your `Droplet`. Use the login `root
46
44
47
45
If you have successfully followed the tutorial so far, then you have finished all the setting-ups that are specific to DigitalOcean. The following sections can serve as a standalone tutorial and can be applied to deployment onto any other platforms as well.
48
46
49
-
# Deploying application onto our server
47
+
##Deploying application onto our server
50
48
51
-
After setting up our server (Droplet), the next thing we may want to do is to deploy our application onto the server. We will not, however, cover the process in this tutorial. Instead we recommend you to read this separate tutorial: [How to Deploy Python App Using uWSGI and Nginx](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md). We organize contents in such way because deployment is an independent process and should be similar on any platforms, not specific to DigitalOcean. So if you are curious, please check it out.
49
+
After setting up our server (Droplet), the next thing we may want to do is to deploy our application onto the server. We will not, however, cover the process in this tutorial. Instead we recommend you to read this separate tutorial: [How to Deploy Python App Using uWSGI and Nginx](https://github.com/tecladocode/rest-apis-flask-python/blob/master/guides/How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.pdf). We organize contents in such way because deployment is an independent process and should be similar on any platforms, not specific to DigitalOcean. So if you are curious, please check it out.
Copy file name to clipboardExpand all lines: guides/Flask-JWT Configuration Tutorial.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
## Overview
1
+
#Flask-JWT Configuration Tutorial
2
2
3
3
Flask-JWT adds JWT functionality to Flask in an easy to use manner. It gives you a lot of functionality out of the box, but sometimes we want to modify some of the configuration. This document walks through how to:
4
4
@@ -9,7 +9,7 @@ Flask-JWT adds JWT functionality to Flask in an easy to use manner. It gives you
9
9
10
10
In addition, it covers how to retrieve the **currently logged in user** from any of our Flask app endpoints.
11
11
12
-
This tutorial assumes that you’ve followed the lectures and have set up Flask-JWT already! If you haven't done so yet, check out Section 5 of the [Udemy course](https://www.udemy.com/rest-api-flask-and-python/?couponCode=GITHUB).
12
+
This tutorial assumes that you’ve followed the lectures and have set up Flask-JWT already! If you haven't done so yet, check out Section 5 of the [Udemy course](https://go.tecla.do/rest-apis-sale).
Copy file name to clipboardExpand all lines: guides/Heroku Tutorial.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# Overview
2
2
3
-
In this tutorial, we will introduce a popular cloud application platform called Heroku. We will briefly describe [what Heroku is](Heroku%20Tutorial.md#what-is-heroku) and [how to use it](Heroku%20Tutorial.md#deploying-our-app-onto-heroku).
3
+
In this tutorial, we will introduce a popular cloud application platform called Heroku. We will briefly describe [what Heroku is](#what-is-heroku) and [how to use it](#deploying-our-app-onto-heroku).
4
4
5
5
# What is Heroku
6
6
7
7
Heroku is a cloud platform for deploying and running modern apps. A more detailed Introduction can be found [here](https://www.heroku.com/platform).
8
8
9
9
Some of the key advantages of Heroku include:
10
10
- No server side knowledge is required, so it is easy to set up.
11
-
- It can be free, but the free tier has some limitations, which we will discuss later when we introduce [`Dyno`](Heroku%20Tutorial.md#creating-a-heroku-dyno).
11
+
- It can be free, but the free tier has some limitations, which we will discuss later when we introduce [`Dyno`](#creating-a-heroku-dyno).
12
12
- It enables SSL so the communication between your app and its users are encrypted.
13
13
14
14
@@ -44,9 +44,9 @@ The first file we need to add is called `runtime.txt`. And it is **important** t
44
44
python-3.5.2
45
45
```
46
46
47
-
#### requirement.txt
47
+
#### requirements.txt
48
48
49
-
The next file we need to add is called `requirement.txt`, which specifies all the dependencies of our project. So for our sample project, we will have something like this for the `requirement.txt` file:
49
+
The next file we need to add is called `requirements.txt`, which specifies all the dependencies of our project. So for our sample project, we will have something like this for the `requirements.txt` file:
50
50
51
51
```
52
52
Flask
@@ -57,7 +57,7 @@ uwsgi
57
57
psycopg2
58
58
```
59
59
60
-
Note that we are running a `Python` project, and `uWSGI` is used to run `Python` applications more efficiently and more reliably, providing features such as multi-threading and auto restarting after failure. If you are not running a `Python` app or you choose not to use `uWSGI`, it is totally fine and you can skip the next sub-section and go to the `Procfile` sub-section [here](Heroku%20Tutorial.md#procfile).
60
+
Note that we are running a `Python` project, and `uWSGI` is used to run `Python` applications more efficiently and more reliably, providing features such as multi-threading and auto restarting after failure. If you are not running a `Python` app or you choose not to use `uWSGI`, it is totally fine and you can skip the next sub-section and go to the `Procfile` sub-section [here](#procfile).
Copy file name to clipboardExpand all lines: guides/How To Deploy Python App Using uWSGI And Nginx.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ In this tutorial, we will not cover how to set up a server on any hosting platfo
7
7
# Quick links
8
8
In this tutorial, we will assume you have a server set up already, and we will introduce the deployment process in the following order:
9
9
10
-
-[Connecting to the server using `SSH`](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md#connecting-to-our-server).
11
-
-[Creating and configuring a `UNIX` user](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md#creating-another-user).
12
-
-[Setting up `PostgreSQL` database](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md#configuring-postgres).
13
-
-[Getting project code from `GitHub`](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md#getting-code-from-github).
14
-
-[Configuring `uWSGI` for our project](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md#uwsgi).
15
-
-[Configuring `nginx` for our project](How%20To%20Deploy%20Python%20App%20Using%20uWSGI%20And%20Nginx.md#nginx).
10
+
-[Connecting to the server using `SSH`](#connecting-to-our-server).
11
+
-[Creating and configuring a `UNIX` user](#creating-another-user).
12
+
-[Setting up `PostgreSQL` database](#configuring-postgres).
13
+
-[Getting project code from `GitHub`](#getting-code-from-github).
14
+
-[Configuring `uWSGI` for our project](#uwsgi).
15
+
-[Configuring `nginx` for our project](#nginx).
16
16
17
17
If you are a first time learner, we highly recommend you to follow through the whole tutorial so that you can get familiar with it and may be less likely to run into error. However, if you are only looking for information on a specific subject, please feel free to use the above links to navigate to according sections.
18
18
@@ -331,7 +331,7 @@ And the content we are going to input is shown below:
0 commit comments