Skip to content

Commit 8f11a13

Browse files
committed
Merge branch 'install-party' of https://github.com/helenst/tutorial into helenst-install-party
2 parents 4b6badb + cb51547 commit 8f11a13

File tree

11 files changed

+270
-216
lines changed

11 files changed

+270
-216
lines changed

en/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Summary
22

33
* [Introduction](README.md)
4+
* [Installation](installation/README.md)
45
* [How the Internet works?](how_the_internet_works/README.md)
56
* [Introduction to command line](intro_to_command_line/README.md)
67
* [Python installation](python_installation/README.md)

en/code_editor/README.md

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

33
You're about to write your first line of code, so it's time to download a code editor!
44

5-
There are a lot of different editors and it largely boils down to personal preference. Most Python programmers use complex but extremely powerful IDEs (Integrated Development Environments), such as PyCharm. As a beginner, however, that's probably less suitable; our recommendations are equally powerful, but a lot simpler.
6-
7-
Our suggestions are below, but feel free to ask your coach what their preferences are - it'll be easier to get help from them.
8-
9-
## Gedit
10-
11-
Gedit is an open-source, free editor, available for all operating systems.
12-
13-
[Download it here](https://wiki.gnome.org/Apps/Gedit#Download)
14-
15-
## Sublime Text 2
16-
17-
Sublime Text is a very popular editor with a free evaluation period. It's easy to install and use, and it's available for all operating systems.
18-
19-
[Download it here](http://www.sublimetext.com/2)
20-
21-
## Atom
22-
23-
Atom is an extremely new code editor created by [GitHub](http://github.com/). It's free, open-source, easy to install and easy to use. It's available for Windows, OSX and Linux.
24-
25-
[Download it here](https://atom.io/)
26-
27-
28-
29-
# Why are we installing a code editor?
30-
31-
You might be wondering why we are installing this special code editor software, rather than using something like Word or Notepad.
32-
33-
The first is that code needs to be **plain text**, and the problem with programs like Word and Textedit is that they don't actually produce plain text, they produce rich text (with fonts and formatting), using custom formats like rtf.
34-
35-
The second reason is that code editors are specialised in editing code, so they can provide helpful features, like highlighting code with colour according to its meaning, or automatically closing quotes for you.
36-
37-
We'll see all this in action later. Soon, you'll come to think of your trusty old code editor as one of your favourite tools :)
5+
> **Note** You might have done this earlier in the Installation chapter - if so, you can skip right ahead to the next chapter!
386
7+
{% include "code_editor/instructions.md" %}

en/code_editor/instructions.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
There are a lot of different editors and it largely boils down to personal preference. Most Python programmers use complex but extremely powerful IDEs (Integrated Development Environments), such as PyCharm. As a beginner, however, that's probably less suitable; our recommendations are equally powerful, but a lot simpler.
2+
3+
Our suggestions are below, but feel free to ask your coach what their preferences are - it'll be easier to get help from them.
4+
5+
## Gedit
6+
7+
Gedit is an open-source, free editor, available for all operating systems.
8+
9+
[Download it here](https://wiki.gnome.org/Apps/Gedit#Download)
10+
11+
## Sublime Text 2
12+
13+
Sublime Text is a very popular editor with a free evaluation period. It's easy to install and use, and it's available for all operating systems.
14+
15+
[Download it here](http://www.sublimetext.com/2)
16+
17+
## Atom
18+
19+
Atom is an extremely new code editor created by [GitHub](http://github.com/). It's free, open-source, easy to install and easy to use. It's available for Windows, OSX and Linux.
20+
21+
[Download it here](https://atom.io/)
22+
23+
24+
25+
## Why are we installing a code editor?
26+
27+
You might be wondering why we are installing this special code editor software, rather than using something like Word or Notepad.
28+
29+
The first is that code needs to be **plain text**, and the problem with programs like Word and Textedit is that they don't actually produce plain text, they produce rich text (with fonts and formatting), using custom formats like rtf.
30+
31+
The second reason is that code editors are specialised in editing code, so they can provide helpful features, like highlighting code with colour according to its meaning, or automatically closing quotes for you.
32+
33+
We'll see all this in action later. Soon, you'll come to think of your trusty old code editor as one of your favourite tools :)
34+

en/deploy/README.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,9 @@ Git is a "version control system" used by a lot of programmers - software which
1818

1919
## Installing Git
2020

21-
### Windows
22-
23-
You can download Git from [git-scm.com](http://git-scm.com/). You can hit "next next next" on all steps except for one; in the 5th step entitled "Adjusting your PATH environment", choose "Run Git and associated Unix tools from the Windows command-line" (the bottom option). Other than that, the defaults are fine. Checkout Windows-style, commit Unix-style line endings is good.
24-
25-
### MacOS
26-
27-
Download Git from [git-scm.com](http://git-scm.com/) and just follow the instructions.
28-
29-
30-
### Linux
31-
32-
If it isn't installed already, git should be available via your package manager, so try:
33-
34-
sudo apt-get install git
35-
# or
36-
sudo yum install git
21+
> **Note** If you already did the Installation steps, no need to do this again - you can skip to the next section and start creating your Git repository.
3722
23+
{% include "deploy/install_git.md" %}
3824

3925
## Starting our Git repository
4026

@@ -93,7 +79,9 @@ And finally we save our changes. Go to your console and run these commands:
9379

9480
## Pushing our code to GitHub
9581

96-
Go to [GitHub.com](http://www.github.com) and sign up for a new, free user account. Then, create a new repository, giving it the name "my-first-blog". Leave the "initialise with a README" tickbox un-checked, leave the .gitignore option blank (we've done that manually) and leave the License as None.
82+
Go to [GitHub.com](http://www.github.com) and sign up for a new, free user account. (If you already did that in the workshop prep, that is great!)
83+
84+
Then, create a new repository, giving it the name "my-first-blog". Leave the "initialise with a README" tickbox un-checked, leave the .gitignore option blank (we've done that manually) and leave the License as None.
9785

9886
<img src="images/new_github_repo.png" />
9987

@@ -128,12 +116,9 @@ Your code is now on GitHub. Go and check it out! You'll find it's in fine compa
128116

129117
# Setting up our blog on PythonAnywhere
130118

131-
Next it's time to sign up for a free "Beginner" account on PythonAnywhere.
132-
133-
* [www.pythonanywhere.com](https://www.pythonanywhere.com/)
134-
119+
> **Note** You might have already created a PythonAnywhere account earlier during the install steps - if so, no need to do it again.
135120
136-
> **Note** When choosing your username here, bear in mind that your blog's URL will take the form `yourusername.pythonanywhere.com`, so either choose your own nickname, or a name for what your blog is all about.
121+
{% include "deploy/signup_pythonanywhere.md" %}
137122

138123

139124
## Pulling our code down on PythonAnywhere

en/deploy/install_git.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
### Windows
3+
4+
You can download Git from [git-scm.com](http://git-scm.com/). You can hit "next next next" on all steps except for one; in the 5th step entitled "Adjusting your PATH environment", choose "Run Git and associated Unix tools from the Windows command-line" (the bottom option). Other than that, the defaults are fine. Checkout Windows-style, commit Unix-style line endings is good.
5+
6+
### MacOS
7+
8+
Download Git from [git-scm.com](http://git-scm.com/) and just follow the instructions.
9+
10+
11+
### Linux
12+
13+
If it isn't installed already, git should be available via your package manager, so try:
14+
15+
sudo apt-get install git
16+
# or
17+
sudo yum install git

en/deploy/signup_pythonanywhere.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
Next it's time to sign up for a free "Beginner" account on PythonAnywhere.
3+
4+
* [www.pythonanywhere.com](https://www.pythonanywhere.com/)
5+
6+
7+
> **Note** When choosing your username here, bear in mind that your blog's URL will take the form `yourusername.pythonanywhere.com`, so either choose your own nickname, or a name for what your blog is all about.
8+

en/django_installation/README.md

Lines changed: 2 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,6 @@
11
# Django installation
22

3-
> Part of this chapter is based on tutorials by Geek Girls Carrots (http://django.carrots.pl/).
3+
> **Note** If you already worked through the Installation steps then you've already done this - you can go straight to the next chapter!
44
5-
> Part of this chapter is based on the [django-marcador
6-
tutorial](http://django-marcador.keimlink.de/) licensed under Creative Commons
7-
Attribution-ShareAlike 4.0 International License. The django-marcador tutorial
8-
is copyrighted by Markus Zapke-Gründemann et al.
5+
{% include "django_installation/instructions.md" %}
96

10-
11-
## Virtual environment
12-
13-
Before we install Django, we'll get you to install an extremely useful tool that will help keep your coding environment tidy on your computer. It's possible to skip this step, but it's highly recommended not to - starting with the best possible setup will save you a lot of trouble in the future!
14-
15-
So, let's create a **virtual environment** (also called a *virtualenv*). It will isolate your Python/Django setup on a per-project basis, meaning that any changes you make to one website won't affect any others you're also developing. Neat, right?
16-
17-
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).
18-
19-
For this tutorial we will be using a new directory `djangogirls` from your home directory:
20-
21-
mkdir djangogirls
22-
cd djangogirls
23-
24-
We will make a virtualenv called `myvenv`. The general command will be in the format:
25-
26-
python3 -m venv myvenv
27-
28-
### Windows
29-
30-
To create a new `virtualenv`, you need to open the console (we told you about that a few chapters ago - remember?) and run `C:\Python34\python -m venv myvenv`. It will look like this:
31-
32-
C:\Users\Name\djangogirls> C:\Python34\python -m venv myvenv
33-
34-
where `C:\Python34\python` is the directory in which you previously installed Python and `myvenv` is the name of your `virtualenv`. You can use any other name, but stick to lowercase and use no spaces, accents or special characters. It is also good idea to keep the name short - you'll be referencing it a lot!
35-
36-
### Linux and OS X
37-
38-
Creating a `virtualenv` on both Linux and OS X is as simple as running `python3 -m venv myvenv`.
39-
It will look like this:
40-
41-
~/djangogirls$ python3 -m venv myvenv
42-
43-
`myvenv` is the name of your `virtualenv`. You can use any other name, but stick to lowercase and use no spaces. It is also good idea to keep the name short - you'll be referencing it a lot!
44-
45-
> __NOTE:__ Initiating the virtual environment on Ubuntu 14.04 like this currently gives the following error:
46-
47-
> Error: Command '['/home/eddie/Slask/tmp/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
48-
49-
> To get around this, use the `virtualenv` command instead.
50-
51-
> ~/djangogirls$ sudo apt-get install python-virtualenv
52-
> ~/djangogirls$ virtualenv --python=python3.4 myvenv
53-
54-
55-
## Working with virtualenv
56-
57-
The command above will create a directory called `myvenv` (or whatever name you chose) that contains our virtual environment (basically a bunch of directory and files). All we want to do now is start it by running:
58-
59-
C:\Users\Name\djangogirls> myvenv\Scripts\activate
60-
61-
on Windows, or:
62-
63-
~/djangogirls$ source myvenv/bin/activate
64-
65-
on OS X and Linux.
66-
67-
Remember to replace `myvenv` with your chosen `virtualenv` name!
68-
69-
> __NOTE:__ sometimes `source` might not be available. In those cases try doing this instead:
70-
71-
> ~/djangogirls$ . myvenv/bin/activate
72-
73-
74-
75-
You will know that you have `virtualenv` started when you see that the prompt in your console looks like:
76-
77-
(myvenv) C:\Users\Name\djangogirls>
78-
79-
or:
80-
81-
(myvenv) ~/djangogirls$
82-
83-
Notice the prefix `(myvenv)` appears!
84-
85-
When working within a virtual environment, `python` will automatically refer to the correct version so you can use `python` instead of `python3`.
86-
87-
OK, we have all important dependencies in place. We can finally install Django!
88-
89-
## Installing Django
90-
91-
Now that you have your `virtualenv` started, you can install Django using `pip`. In the console, run `pip install django==1.8` (note that we use a double equal sign: `==`).
92-
93-
(myvenv) ~$ pip install django==1.8
94-
Downloading/unpacking django==1.8
95-
Installing collected packages: django
96-
Successfully installed django
97-
Cleaning up...
98-
99-
on Windows
100-
> If you get an error when calling pip on Windows platform please check if your project pathname contains spaces, accents or special characters (i.e. `C:\Users\User Name\djangogirls`). If it does please consider moving it to another place without spaces, accents or special characters (suggestion is: `C:\djangogirls`). After the move please try the above command again.
101-
102-
on Linux
103-
> If you get an error when calling pip on Ubuntu 12.04 please run `python -m pip install -U --force-reinstall pip` to fix the pip installation in the virtualenv.
104-
105-
That's it! You're now (finally) ready to create a Django application!
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
> Part of this section is based on tutorials by Geek Girls Carrots (http://django.carrots.pl/).
2+
3+
> Part of this section is based on the [django-marcador
4+
tutorial](http://django-marcador.keimlink.de/) licensed under Creative Commons
5+
Attribution-ShareAlike 4.0 International License. The django-marcador tutorial
6+
is copyrighted by Markus Zapke-Gründemann et al.
7+
8+
9+
## Virtual environment
10+
11+
Before we install Django, we'll get you to install an extremely useful tool that will help keep your coding environment tidy on your computer. It's possible to skip this step, but it's highly recommended not to - starting with the best possible setup will save you a lot of trouble in the future!
12+
13+
So, let's create a **virtual environment** (also called a *virtualenv*). It will isolate your Python/Django setup on a per-project basis, meaning that any changes you make to one website won't affect any others you're also developing. Neat, right?
14+
15+
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).
16+
17+
For this tutorial we will be using a new directory `djangogirls` from your home directory:
18+
19+
mkdir djangogirls
20+
cd djangogirls
21+
22+
We will make a virtualenv called `myvenv`. The general command will be in the format:
23+
24+
python3 -m venv myvenv
25+
26+
### Windows
27+
28+
To create a new `virtualenv`, you need to open the console (we told you about that a few chapters ago - remember?) and run `C:\Python34\python -m venv myvenv`. It will look like this:
29+
30+
C:\Users\Name\djangogirls> C:\Python34\python -m venv myvenv
31+
32+
where `C:\Python34\python` is the directory in which you previously installed Python and `myvenv` is the name of your `virtualenv`. You can use any other name, but stick to lowercase and use no spaces, accents or special characters. It is also good idea to keep the name short - you'll be referencing it a lot!
33+
34+
### Linux and OS X
35+
36+
Creating a `virtualenv` on both Linux and OS X is as simple as running `python3 -m venv myvenv`.
37+
It will look like this:
38+
39+
~/djangogirls$ python3 -m venv myvenv
40+
41+
`myvenv` is the name of your `virtualenv`. You can use any other name, but stick to lowercase and use no spaces. It is also good idea to keep the name short - you'll be referencing it a lot!
42+
43+
> __NOTE:__ Initiating the virtual environment on Ubuntu 14.04 like this currently gives the following error:
44+
45+
> Error: Command '['/home/eddie/Slask/tmp/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
46+
47+
> To get around this, use the `virtualenv` command instead.
48+
49+
> ~/djangogirls$ sudo apt-get install python-virtualenv
50+
> ~/djangogirls$ virtualenv --python=python3.4 myvenv
51+
52+
53+
## Working with virtualenv
54+
55+
The command above will create a directory called `myvenv` (or whatever name you chose) that contains our virtual environment (basically a bunch of directory and files). All we want to do now is start it by running:
56+
57+
C:\Users\Name\djangogirls> myvenv\Scripts\activate
58+
59+
on Windows, or:
60+
61+
~/djangogirls$ source myvenv/bin/activate
62+
63+
on OS X and Linux.
64+
65+
Remember to replace `myvenv` with your chosen `virtualenv` name!
66+
67+
> __NOTE:__ sometimes `source` might not be available. In those cases try doing this instead:
68+
69+
> ~/djangogirls$ . myvenv/bin/activate
70+
71+
72+
73+
You will know that you have `virtualenv` started when you see that the prompt in your console looks like:
74+
75+
(myvenv) C:\Users\Name\djangogirls>
76+
77+
or:
78+
79+
(myvenv) ~/djangogirls$
80+
81+
Notice the prefix `(myvenv)` appears!
82+
83+
When working within a virtual environment, `python` will automatically refer to the correct version so you can use `python` instead of `python3`.
84+
85+
OK, we have all important dependencies in place. We can finally install Django!
86+
87+
## Installing Django
88+
89+
Now that you have your `virtualenv` started, you can install Django using `pip`. In the console, run `pip install django==1.8` (note that we use a double equal sign: `==`).
90+
91+
(myvenv) ~$ pip install django==1.8
92+
Downloading/unpacking django==1.8
93+
Installing collected packages: django
94+
Successfully installed django
95+
Cleaning up...
96+
97+
on Windows
98+
> If you get an error when calling pip on Windows platform please check if your project pathname contains spaces, accents or special characters (i.e. `C:\Users\User Name\djangogirls`). If it does please consider moving it to another place without spaces, accents or special characters (suggestion is: `C:\djangogirls`). After the move please try the above command again.
99+
100+
on Linux
101+
> If you get an error when calling pip on Ubuntu 12.04 please run `python -m pip install -U --force-reinstall pip` to fix the pip installation in the virtualenv.
102+
103+
That's it! You're now (finally) ready to create a Django application!

0 commit comments

Comments
 (0)