Skip to content

Commit ded0f7b

Browse files
authored
Merge pull request #1781 from amakarudze/add-cloud-development
Add RunCode Cloud instructions
2 parents d94c065 + c2aa801 commit ded0f7b

File tree

11 files changed

+174
-11
lines changed

11 files changed

+174
-11
lines changed

en/SUMMARY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
* [Introduction](README.md)
44
* [Installation](installation/README.md)
5-
* [Command Line](installation/README.md#command-line)
5+
* [Installation (RunCode Cloud)](cloud_development_setup/README.md)
6+
* [Installation (Chromebook)](chromebook_setup/README.md)
7+
* [Installation (OS X/Windows/Linux)](installation/README.md#osx-windows-linux)
8+
* [Command Line](installation/README.md#intro-command-line)
69
* [Python](installation/README.md#python)
710
* [Code Editor](installation/README.md#code-editor)
811
* [Virtual Environment](installation/README.md#virtualenv)
912
* [Django](installation/README.md#django)
1013
* [Git](installation/README.md#git)
1114
* [GitHub](installation/README.md#github-account)
1215
* [PythonAnywhere](installation/README.md#pythonanywhere-account)
13-
* [Installation (chromebook)](chromebook_setup/README.md)
1416
* [How the Internet works](how_the_internet_works/README.md)
1517
* [Introduction to command line](intro_to_command_line/README.md)
1618
* [Python installation](python_installation/README.md)

en/cloud_development_setup/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# RunCode Cloud Environment setup
2+
3+
> **Note** If you already worked through the [installation steps](../installation/README.md), you do not need to also complete the RunCode Cloud Environment setup. Please skip straight to [Introduction to Python](../python_introduction/README.md).
4+
5+
{% include "/cloud_development_setup/instructions.md" %}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
If you are using RunCode Cloud development environment, your installation experience will be a little different. You can ignore the rest of the installation instructions as you do not need to install anything locally, you just need to create three online accounts.
2+
3+
## Create a GitHub account
4+
Go to [GitHub.com](https://github.com/) and sign up for a new, free user account.Skip this step if you already did
5+
this in the previous step so you could sign up for RunCode.
6+
7+
## Create a RunCode account
8+
Go to [RunCode.io](https://runcode.io/) and sign up for a new, free user account. You need to have a
9+
[Google.com](https://www.google.com/intl/en-GB/gmail/about/) account or [GitHub.com](https://github.com/)
10+
which you can sign up with.
11+
12+
## Create a PythonAnywhere account {#pythonanywhere-account}
13+
{% include "/deploy/signup_pythonanywhere.md" %}
14+
15+
## Command Line
16+
To open the Ubuntu terminal on RunCode, go to Workspaces → New Workspace → Blank. This will open a new Visual Studio Code workspace which has an Ubuntu terminal in the bottom pane.
17+
18+
Altenatively, you can go to Workspaces → New Workspace → Jupyter Lab. This will open a Python prompt which is depicted by `>>>`, you can type `exit()` to get back to the Ubuntu terminal.
19+
20+
Ubuntu is a version of Linux so for all command line instructions later in the tutorial you can follow Linux instructions.
21+
22+
## Virtual Environment
23+
Before we install Django we will get you to install an extremely useful tool to help keep your coding environment tidy on your computer. It's possible to skip this step, but it's highly recommended. Starting with the best possible setup will save you a lot of trouble in the future!
24+
25+
So, let's create a **virtual environment** (also called a *virtualenv*). Virtualenv will isolate your Python/Django setup on a per-project basis. This means that any changes you make to one website won't affect any others you're also developing. Neat, right?
26+
27+
All you need to do is find a directory in which you want to create the `virtualenv`; your home directory, for example. On Windows, it might look like `C:\Users\Name\` (where `Name` is the name of your login).
28+
29+
For this tutorial we will be using a new directory `djangogirls` from your home directory:
30+
31+
{% filename %}command-line{% endfilename %}
32+
```
33+
$ mkdir djangogirls
34+
$ cd djangogirls
35+
```
36+
37+
We will make a virtualenv called `myvenv`.
38+
39+
To create a new `virtualenv` on RunCode, you first need to install the `virtualenv` module. To do so, first you need to update
40+
the packages in your environment
41+
>```
42+
>$ sudo apt-get update -y
43+
>```
44+
> then install `virtualenv` by running the command:
45+
>```
46+
>$ sudo apt-get install -y virtualenv
47+
>```
48+
49+
> After this you can create the `virtualenv` run the command:
50+
>```
51+
>$ virtualenv -p python myvenv
52+
>```
53+
> and a new `virtualenv` with the name `myvenv` or whatever name you chose should be created in your `djangogirls` folder.
54+
55+
## Working with a Virtual Environment
56+
>Start your virtual environment by running:
57+
>```
58+
>$ . myvenv/bin/activate
59+
>```
60+
61+
### Installing packages with requirements
62+
63+
A requirements file keeps a list of dependencies to be installed using
64+
`pip install`:
65+
66+
First create a `requirements.txt` file inside of the `djangogirls/` folder, using the code editor that you installed earlier. You do this by opening a new file in the code editor and then saving it as `requirements.txt` in the `djangogirls/` folder. Your directory will look like this:
67+
68+
```
69+
djangogirls
70+
├── myvenv
71+
│ └── ...
72+
└───requirements.txt
73+
```
74+
75+
In your `djangogirls/requirements.txt` file you should add the following text:
76+
77+
{% filename %}djangogirls/requirements.txt{% endfilename %}
78+
```
79+
Django~={{ book.django_version }}
80+
```
81+
82+
Now, run `pip install -r requirements.txt` to install Django.
83+
84+
{% filename %}command-line{% endfilename %}
85+
```
86+
(myvenv) ~$ pip install -r requirements.txt
87+
Collecting Django~={{ book.django_version }} (from -r requirements.txt (line 1))
88+
Downloading Django-{{ book.django_version }}-py3-none-any.whl (7.9MB)
89+
Installing collected packages: Django
90+
Successfully installed Django-{{ book.django_version }}
91+
```
92+
93+
That's it! You're now (finally) ready to create a Django application!

en/code_editor/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ You're about to write your first line of code, so it's time to download a code e
88
99
> **Note** You might have done this earlier in the [Installation chapter](../installation/README.md) – if so, you can skip right ahead to the next chapter!
1010
11+
> **Note** If you have followed [RunCode Setup](../cloud_development_setup/README.md) you can skip this section as Visual Studio Code is pre-installed on the platform.
12+
1113
{% include "/code_editor/instructions.md" %}

en/django_installation/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> **Note** If you're using a Chromebook, skip this chapter and make sure you follow the [Chromebook Setup](../chromebook_setup/README.md) instructions.
44
5+
> **Note** If you're using RunCode, skip this chapter and make sure you follow the [RunCode Setup](../cloud_development_setup/README.md) instructions.
6+
57
> **Note** If you already worked through the [installation steps](../installation/README.md) then you've already done this – you can go straight to the next chapter!
68
79
{% include "/django_installation/instructions.md" %}

en/django_installation/instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ $ python3 -m venv myvenv
104104
105105
<!--endsec-->
106106
107+
107108
## Working with virtualenv
108109
109110
The command above will create a directory called `myvenv` (or whatever name you chose) that contains our virtual environment (basically a bunch of directories and files).

en/django_start_project/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ or on Glitch:
252252
https://name-of-your-glitch-project.glitch.me
253253
```
254254

255+
If you are using RunCode cloud platform, the URL will look something like this:
256+
`https://8000-soft-limit-18855079.eu-ws4.runcode.io/`. To view your own instance, the URL will be like:
257+
258+
{% filename %}browser{% endfilename %}
259+
```
260+
https://8000-the-name-of-your-runcode-instance.eu-ws4.runcode.io/
261+
```
262+
You can open this in another browser window and you should see the Django install worked page.
263+
255264
Congratulations! You've just created your first website and run it using a web server! Isn't that awesome?
256265

257266
![Install worked!](images/install_worked.png)

en/installation/README.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,61 @@ If you are attending one of the [Django Girls events](https://djangogirls.org/ev
1414
- If your workshop does not have an installation party (or you couldn't attend), and if the organizers didn't ask you to try to install everything before you arrived, skip this page and go straight to the [How the Internet works](../how_the_internet_works/README.md) chapter. You'll be installing everything you need as you work through the tutorial.
1515

1616
# Installation
17-
In this tutorial you will be building a blog. In order to do that, as you go through the tutorial you'll be instructed on how to install various software on your computer and set up some online accounts as they are needed. This page gathers all of the installation and sign-up instructions in one place (which is useful for some workshop formats).
17+
In this tutorial you will be building a blog. In order to do that, as you go through the tutorial you'll be instructed on how to
18+
install various software on your computer and set up some online accounts as needed (if you are using local desktop environment) or instructed on how to create online accounts only (if you are using cloud development). This page gathers all of the installation and sign-up instructions in one place (which is useful for some workshop formats).
19+
20+
# Cloud Development
21+
In this tutorial, the cloud development platform we will be using will be [RunCode](https://runcode.io/). RunCode is a cloud development environment which people can use without the need to install Python, Django and Visual Studio Code editor locally on their machines. This cloud environment enables anyone to work from any device that has an internet connection, including cellphones, tablets, laptop or desktop.
22+
23+
This removes the need for you to install packages on a borrowed laptop or the need for you to own a laptop to attend the workshop or follow this tutorial from home as you only need to set up three online accounts. This will also save you time required for setting up your development environment. You can always do the [installation](installation/README.md#command-line) later own as a follow-up after finishing the tutorial. However, loading the development enviroment requires good and fast internet for this solution to work for you.
24+
25+
> **Note** There are sections of this tutorial which depend on the platform you are working on. If you follow the local installation steps for Windows, Linux, OS X or Chromebook, you will need to follow instructions for your operating system. If you follow RunCode Cloud Environment setup instructions, then you will need to follow instructions for RunCode development environment. Where no specific instructions are provided for RunCode Cloud Environment, follow the Linux instructions as RunCode runs on Ubuntu Linux.
26+
27+
28+
# RunCode Cloud Development Setup
29+
To set up RunCode Cloud development, follow the instructions below:
30+
31+
<!-- sec data-title="RunCode Cloud Development setup (if you are using cloud development)"
32+
data-id="cloud_development" data-collapse=true ces-->
33+
{% include "/cloud_development_setup/instructions.md" %}
34+
<!--endsec-->
35+
36+
# Chromebook Installation
37+
To set up your Chromebook, follow the instructions below:
1838

1939
<!--sec data-title="Chromebook setup (if you're using one)"
2040
data-id="chromebook_setup" data-collapse=true ces-->
2141
{% include "/chromebook_setup/instructions.md" %}
2242
<!--endsec-->
2343

24-
# Brief intro to the command line {#command-line}
44+
45+
# OS X, Windows, Linux Installation {#osx-windows-linux}
46+
> __NOTE:__ You can skip right over this section if you have followed [RunCode Cloud Development](cloud_development_setup/README.md) or [ChromeBook](chromebook_setup/README.md) installation steps.
47+
48+
If you are not using RunCode or Chromebook, your experience will be a little different as you need to download and install some software locally as well as set up online accounts.
49+
50+
To install software on your machine, follow the instructions below:
51+
52+
## Brief intro to the command line {#intro-command-line}
2553
Many of the steps below reference the "console", "terminal", "command window", or "command line" -- these all mean the same thing: a window on your computer where you can enter commands. When you get to the main tutorial, you'll learn more about the command line. For now, the main thing you need to know is how to open a command window and what it looks like:
2654
{% include "/intro_to_command_line/open_instructions.md" %}
2755

28-
# Install Python {#python}
56+
## Install Python {#python}
2957
{% include "/python_installation/instructions.md" %}
3058

31-
# Install a code editor {#code-editor}
59+
## Install a code editor {#code-editor}
3260
{% include "/code_editor/instructions.md" %}
3361

34-
# Set up virtualenv and install Django {#virtualenv}
62+
## Set up virtualenv and install Django {#virtualenv}
3563
{% include "/django_installation/instructions.md" %}
3664

37-
# Install Git {#git}
65+
## Install Git {#git}
3866
{% include "/deploy/install_git.md" %}
3967

40-
# Create a GitHub account {#github-account}
68+
## Create a GitHub account {#github-account}
4169
Go to [GitHub.com](https://www.github.com) and sign up for a new, free user account. Be sure to remember your password (add it to your password manager, if you use one).
4270

43-
# Create a PythonAnywhere account {#pythonanywhere-account}
71+
## Create a PythonAnywhere account {#pythonanywhere-account}
4472
{% include "/deploy/signup_pythonanywhere.md" %}
4573

4674

en/intro_to_command_line/open_instructions.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<!--sec data-title="Opening: Windows" data-id="windows_prompt" data-collapse=true ces-->
32

43
Depending on your version of Windows and your keyboard, one of the following should open a command window (you may have to experiment a bit, but you don't have to try all of these suggestions):
@@ -26,3 +25,14 @@ Go to Applications → Utilities → Terminal.
2625
It's probably under Applications → Accessories → Terminal, or Applications → System → Terminal, but that may depend on your system. If it's not there, you can try to Google it. :)
2726

2827
<!--endsec-->
28+
29+
<!--sec data-title="Opening: RunCode" data-id="runcode_prompt" data-collapse=true ces-->
30+
> **NOTE** If you followed [RunCode setup instructions](../cloud_development_setup/README.md) follow these steps to open command line.
31+
32+
To open the Ubuntu terminal on RunCode, go to Workspaces → New Workspace → Blank. This will open a new Visual Studio Code workspace which has an Ubuntu terminal in the bottom pane.
33+
34+
Altenatively, you can go to Workspaces → New Workspace → Jupyter Lab. This will open a Python prompt which is depicted by `>>>`, you can type `exit()` to get back to the Ubuntu terminal.
35+
36+
Ubuntu is a version of Linux so from now on you can follow Linux instructions.
37+
38+
<!--endsec-->

en/python_installation/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ Python originated in the late 1980s and its main goal is to be readable by human
1212
1313
> **Note** If you already worked through the [installation steps](../installation/README.md), there's no need to do this again – you can skip straight ahead to the next chapter!
1414
15+
> **Note** If you're using [RunCode cloud environment](../cloud_development_setup/README.md), you do not need to install Python as it is pre-installed on their platform so you can skip straight ahead to the next chapter!
16+
1517
{% include "/python_installation/instructions.md" %}
1618

en/python_introduction/prompt.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,12 @@ Python {{ book.py_release }} (...)
1515
Type "help", "copyright", "credits" or "license" for more information.
1616
>>>
1717
```
18+
19+
<!--sec data-title="Opening: RunCode Cloud Environment" data-id="runcode_prompt" data-collapse=true ces-->
20+
21+
To open the Python terminal on RunCode, go to Workspaces → New Workspace → Jupyter Lab. This will open a Python prompt
22+
which is depicted by `>>>`. If you already opened an Ubuntu terminal open, in the [Intro to Command Line](../intro_to_command_line/README.md) chapter, you can just type `python3` in the prompt as shown below to open a Python prompt.
23+
24+
`ubuntu@runcode:~$ python3`
25+
26+
<!--endsec-->

0 commit comments

Comments
 (0)