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
Copy file name to clipboardExpand all lines: code_editor/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
You're about to write your first line of code, so it's time to download a code editor!
4
4
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 more simple.
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
6
7
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.
Copy file name to clipboardExpand all lines: django_installation/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
> Part of this chapter is based on tutorials by Geek Girls Carrots (http://django.carrots.pl/).
4
4
5
-
> Parts of this chapter is based on the [django-marcador
5
+
> Part of this chapter is based on the [django-marcador
6
6
tutorial](http://django-marcador.keimlink.de/) licensed under Creative Commons
7
7
Attribution-ShareAlike 4.0 International License. The django-marcador tutorial
8
8
is copyrighted by Markus Zapke-Gründemann et al.
@@ -27,7 +27,7 @@ We will make a virtualenv called `myvenv`. The general command will be in the fo
27
27
28
28
### Windows
29
29
30
-
To create a new `virtualenv`, you need to open the console (we told you about that a few tutorials ago - remember?) and run `C:\Python\python -m venv venv`. It will look like this:
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:\Python\python -m venv venv`. It will look like this:
and just like the Windows instructions above, `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!
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
44
45
45
> __NOTE:__ Initiating the virtual environment on Ubuntu 14.04 like this currently gives the following error:
Copy file name to clipboardExpand all lines: django_models/README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,13 +47,13 @@ What kind of things could be done with a blog post? It would be nice to have som
47
47
48
48
So we will need `publish` method.
49
49
50
-
Since we already know what we want to achieve, we can start modelling it in Django!
50
+
Since we already know what we want to achieve, we can start modeling it in Django!
51
51
52
52
## Django model
53
53
54
54
Knowing what an object is, we can create a Django model for our blog post.
55
55
56
-
A model in Django is a special kind of object - it is saved in the `database` (database we created in the __Database__ chapter).
56
+
A model in Django is a special kind of object - it is saved in the `database`. You can think of model in a database as of a spreadsheet with columns and rows.
57
57
58
58
### Creating an application
59
59
@@ -77,7 +77,7 @@ You will notice that a new `blog` directory is created and it contains a number
77
77
tests.py
78
78
views.py
79
79
80
-
After creating an application we also need to tell Django that it should use it. We do that in the file `mysite/settings.py`. We need to find `INSTALLED_APPS` and add a line `blog` just above `)`. We should also add the `mysite` application (which was created for us when we started a new project in the last chapter). So the final product should look like this:
80
+
After creating an application we also need to tell Django that it should use it. We do that in the file `mysite/settings.py`. We need to find `INSTALLED_APPS` and add a line `blog` just above `)`. So the final product should look like this:
81
81
82
82
INSTALLED_APPS = (
83
83
'django.contrib.admin',
@@ -87,12 +87,11 @@ After creating an application we also need to tell Django that it should use it.
87
87
'django.contrib.messages',
88
88
'django.contrib.staticfiles',
89
89
'blog',
90
-
'mysite',
91
90
)
92
91
93
92
### Creating a blog post model
94
93
95
-
In the `models.py` file we define all objects called `Models` - this is a place in which we will define our blog post.
94
+
In the `blog/models.py` file we define all objects called `Models` - this is a place in which we will define our blog post.
96
95
97
96
Let's open `blog/models.py`, remove everything from it and write code like this:
98
97
@@ -120,7 +119,7 @@ It is scary, right? But no worries, we will explain what these lines mean!
120
119
121
120
All lines starting with `from` or `import` are lines that add some bits from other files. So instead of copying and pasting the same things in every file, we can include some parts with `from ... import ...`.
122
121
123
-
`class Post(models.Model):` - this line defines our model (it is an `object`!).
122
+
`class Post(models.Model):` - this line defines our model (it is an `object`).
124
123
125
124
-`class` is a special keyword that indicates that we are defining an object.
126
125
-`Post` is the name of our model, we can give it a different name (but we must avoid special characters and whitespaces). Always start a name with an uppercase letter.
Copy file name to clipboardExpand all lines: django_urls/README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
We're about to build our first webpage -- a homepage for your blog! But first, let's learn a little bit about Django urls.
4
4
5
-
## What is a URL?
5
+
## What is an URL?
6
6
7
-
A URL is simply like a web address, you can see a URL every time you visit any website - it is visible in your browser's address bar (yes! `127.0.0.1:8000` is a URL! And http://djangogirls.com is also a URL):
7
+
An URL is simply a web address, you can see a URL every time you visit any website - it is visible in your browser's address bar (yes! `127.0.0.1:8000` is a URL! And http://djangogirls.com is also a URL):
8
8
9
9

10
10
@@ -29,7 +29,7 @@ Let's open up the `mysite/urls.py` file and see what it looks like:
29
29
30
30
As you can see, Django already put something here for us.
31
31
32
-
Lines that start with `#` are comments - it means that those lines won't be executed by Python. Pretty handy, right?
32
+
Lines that start with `#` are comments - it means that those lines won't be run by Python. Pretty handy, right?
33
33
34
34
The admin URL, which you visited in previous chapter is already here:
35
35
@@ -43,9 +43,10 @@ Do you wonder how Django matches URLs to views? Well, this part is tricky. Djang
43
43
44
44
## Your first Django url!
45
45
46
-
Time to create our first urls! We want http://127.0.0.1:8000/ to be a homepage of our blog and display a list of posts.
46
+
Time to create our first URL! We want http://127.0.0.1:8000/ to be a homepage of our blog and display a list of posts.
47
47
48
48
We also want to keep the `mysite/urls.py` file clean, so we will import urls from our `blog` application to the main `mysite/urls.py` file.
49
+
49
50
Go ahead, delete the commented lines (lines starting with `#`) and add a line that will import `blog.urls` into the main url (`''`).
50
51
51
52
Your `mysite/urls.py` file should now look like this:
@@ -77,7 +78,7 @@ After that, we can add our first URL pattern:
77
78
url(r'^$', views.post_list),
78
79
)
79
80
80
-
As you can see, we're now assigning a `view` called `post_list` to `^$` URL. But what does `^$` mean? It's regex magic :) Let's break it down:
81
+
As you can see, we're now assigning a `view` called `post_list` to `^$` URL. But what does `^$` mean? It's a regex magic :) Let's break it down:
81
82
-`^` in regex means "the beginning"; from this sign we can start looking for our pattern
82
83
-`$` matches only "the end" of the string, which means that we will finish looking for our pattern here
Copy file name to clipboardExpand all lines: how_internet_works/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,4 +45,4 @@ So, basically, when you have a website you need to have a *server* (machine) whe
45
45
46
46
Since this is a Django tutorial, you will ask what Django does. When you send a response, you don't always want to send the same thing to everybody. It is so much better if your letters are personalized, especially for the person that has just written to you, right? Django helps you with creating these personalized, interesting letters :).
47
47
48
-
Enough talk, time to create! But first the boring part - installation!
Copy file name to clipboardExpand all lines: intro_to_command_line/README.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Introduction to Command Line
2
2
3
+
## What is command line?
3
4
4
-
## Introduction
5
5
The following steps will show you how to use the black window all hackers use. It might look a bit scary at first, but really, it is just a prompt, waiting for commands from you.
6
6
7
7
The window, which is usually called the *command line*, is a text-based application for viewing, handling and manipulating files on your computer (much like e.g. Windows Explorer or Finder on Mac, but without the graphical interface). Other names for the command line are: *cmd*, *prompt*, *console* or *terminal*.
@@ -18,7 +18,6 @@ Each operating system has a slightly different set of commands for the command l
18
18
| mkdir | mkdir | create a new directory |**mkdir testdirectory**|
19
19
|del | rm | delete a directory/file | **del c:\test\test.txt**
20
20
21
-
22
21
These are just a very few of the commands you can run in your command line. To learn more about them, check out the **Further Information** section below.
23
22
24
23
[ss64.com](http://ss64.com) contains a complete reference of commands for all operating systems.
@@ -27,15 +26,12 @@ These are just a very few of the commands you can run in your command line. To l
27
26
28
27
***Up arrow** - rerun previous commands. You can avoid typing the same commands again and again by using the up arrow key to cycle through recently used commands.
29
28
30
-
31
29
***Tab key** - the tab key autocompletes directory and file names. For example, if you type `dir t` and then use `TAB`, the command line will try to match this to existing files in your current directory and autocomplete the name for you. Meaning, if your directory contains a file called `test.txt`, typing `dir t` and `TAB` will autocomplete to `dir test.txt`.
32
30
33
-
34
31
## Further information on some of the above commands
35
32
36
33
***exit** - closes your command prompt. This makes sense, right? No need to explain too much...
37
34
38
-
39
35
***cd** - allows you to go to another directory. To go to a directory contained within your current directory, type `cd subdirectory` (where you replace subdirectory with the name of the directory you want to go to) and press enter.
40
36
41
37
**For example:** let's say you are in a directory called `c:\test` with three sub-directories: `documents`, `photos` and `music`.
Copy file name to clipboardExpand all lines: python_installation/README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@ Python originated in the late 1980s and its main goal is to be readable by human
8
8
9
9
# Python installation
10
10
11
-
> This subchapter is based on awesome tutorials by Geek Girls Carrots (http://django.carrots.pl/)
11
+
> This subchapter is based on tutorial by Geek Girls Carrots (http://django.carrots.pl/)
12
12
13
13
Django is written in Python. We need Python to do anything in Django. Let's start with installing it! We want you to install Python 3.4, so if you have any earlier version, you will need to upgrade it.
14
14
15
15
### Windows
16
16
17
-
You can download Python for Windows from the website https://www.python.org/download/releases/3.4.1/. After downloading the ***.msi** file, you should execute it (double-click on it) and follow the instructions there. It is important to remember the path (the directory) where you installed Python. It will be needed later!
17
+
You can download Python for Windows from the website https://www.python.org/download/releases/3.4.1/. After downloading the ***.msi** file, you should run it (double-click on it) and follow the instructions there. It is important to remember the path (the directory) where you installed Python. It will be needed later!
18
18
19
19
### Linux
20
20
@@ -31,7 +31,6 @@ Type this command into your console:
0 commit comments