Skip to content

Commit 9f1390e

Browse files
committed
Merge branch 'master' of github.com:asendecka/djangogirls-tutorial
2 parents da97538 + a3f6b98 commit 9f1390e

5 files changed

Lines changed: 102 additions & 4 deletions

File tree

SUMMARY.md

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

33
* [How the Internet works?](how_the_internet_works/README.md)
44
* [Let's start with Python](try_python/README.md)
5+
* [Django - why you need a webframework?](django_-_why_you_need_a_webframework/README.md)
6+
* [Django installation](django_installation/README.md)
57
* [Next chapters](next_chapters/README.md)
68

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Django - why you need a webframework?
2+
3+
To understand what Django actually is for, we need a closer look at the servers. First thing is that the server needs to know, that you want it to serve you a webpage.
4+
5+
Imagine a mailbox (port) which is monitored for incoming letters (requests). It is done by a web server. The web server also sends the response with webpage. But when you want something to send, you need to have some content. And Django is something that helps you create the content.
6+
7+
## What Django does with a request?
8+
9+
When request comes to a web server it passes it to Django. Django tries to figure out what actually is requested. It takes a webpage address used and tries to figure out what to. This part is done by Django's urlresolver (Note that a website address is called URL - Uniform Resource Locator, so the name 'urlresolver' makes sense). It is not very smart here - it takes a list of patterns and tries to match the URL. Django checks patterns from top to the bottom and if something is matched then Django passes the request to the associated function called view.
10+
11+
Imagine a postman with a letter who is walking down the street and checks each house number with the one on the letter. If it matches, they put the letter there.
12+
13+
In 'view' all interesting things are done: we can look at the database to look for some information to return it to user. Maybe user asked to change something in the data? Like a letter saying "Please change description of my job title." - view can check if you are allowed to do that, then update the job title for you and send back a message: "Done!". Then view is generating a response and Django can send it back to web server.
14+
15+
Of course, the description above is a little bit simplified, but you don't need to know all the technical things yet. Knowing a general idea is enough.
16+
17+
So instead of diving too much into details, we will simply start creating something with Django and we will learn all important parts on the way!
18+
19+

django_installation/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Python & Django installation
2+
3+
*This chapter is based on awesome tutorials by Geek Girls Carrots (http://django.carrots.pl/) and django-marcador (http://django-marcador.keimlink.de/).*
4+
5+
## Python Installation
6+
7+
Django is written in Python. We need it to do anything in Django. Let's start with installing it!
8+
9+
### Windows
10+
11+
You can download Python for Windows from website https://www.python.org/download/releases/3.4.0/. After downloading ***.msi** file, you should execute it (double-click on it) and follow the instructions there. It is important to remember the path (the folder) where we installed the Python. It will be needed later.
12+
13+
### Linux
14+
15+
It is very probable, that you already have Python installed out of the box. To check if you have it installed (and which version it is), you type in a console:
16+
17+
$ python --version
18+
Python 3.4.0
19+
20+
If you don't have Python instaled or you want different version, you can install it as follows.
21+
22+
#### Ubuntu
23+
24+
You type in the console:
25+
26+
sudo apt-get install python3.4
27+
28+
29+
#### Fedora
30+
31+
Yout type in the console:
32+
33+
sudo yum install python3.4
34+
35+
### OS X
36+
37+
You need to go to the website https://www.python.org/download/releases/3.4.0/ and install the appropriate package for you operating system.
38+
39+
----
40+
41+
If you have any doubts or something went wrong and you have no idea what to do next - please ask your coach! Sometimes things are not going smoothly and it's better to ask for help someone with more experience.

next_chapters/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Next chapters
22

3-
3. Django - why you even need a web framework?
4-
5-
What is Django? Why it’s useful? What does it do?
6-
73
4. Start virtualenv, create django project - see files
84

95
5. Models, views, urls - how it works together

try_python/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,46 @@ Huh, it's exciting, right?! You'll write your first line of code in just minutes
44

55
But first, let me tell you what Python is. Python is a very popular programming language that can be used to write websites, games, science, graphics, and many, many more. Python was conceived in the late 1980s and it's main goal is to be readable by human beings (not only machines!) that's why it looks much simpler than other programming laungages. That also makes it easy to learn, but don't worry, Python is also really powerful!
66

7+
## Python Installation
8+
9+
*This subchapter is based on awesome tutorials by Geek Girls Carrots (http://django.carrots.pl/)*
10+
11+
Django is written in Python. We need it to do anything in Django. Let's start with installing it!
12+
13+
### Windows
14+
15+
You can download Python for Windows from website https://www.python.org/download/releases/3.4.0/. After downloading ***.msi** file, you should execute it (double-click on it) and follow the instructions there. It is important to remember the path (the folder) where we installed the Python. It will be needed later.
16+
17+
### Linux
18+
19+
It is very probable, that you already have Python installed out of the box. To check if you have it installed (and which version it is), you type in a console:
20+
21+
$ python --version
22+
Python 3.4.0
23+
24+
If you don't have Python instaled or you want different version, you can install it as follows.
25+
26+
#### Ubuntu
27+
28+
You type in the console:
29+
30+
sudo apt-get install python3.4
31+
32+
33+
#### Fedora
34+
35+
Yout type in the console:
36+
37+
sudo yum install python3.4
38+
39+
### OS X
40+
41+
You need to go to the website https://www.python.org/download/releases/3.4.0/ and install the appropriate package for you operating system.
42+
43+
----
44+
45+
If you have any doubts or something went wrong and you have no idea what to do next - please ask your coach! Sometimes things are not going smoothly and it's better to ask for help someone with more experience.
46+
747
## Python Prompt
848

949
To start tinkering with Python, we need to open up a *prompt* on your computer. On Mac OS X you can do this by launching `Terminal` application (It's in Applications → Utilities). On Windows you need to go to Start menu → All Programs → Accessories → Command Prompt. On Linux, it's probably under Applications → Accessories → Terminal.

0 commit comments

Comments
 (0)