Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor grammar and typo fixes. #13

Merged
merged 1 commit into from
Jul 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Introduction

Have you ever felt that world is more and more about technology and you are somehow left behind? Have you ever wondered how to create a website but have never had enough motivation to start? Have you ever thought that software world is too complicated for you to even try doing something on your own?
Have you ever felt that the world is more and more about technology and you are somehow left behind? Have you ever wondered how to create a website but have never had enough motivation to start? Have you ever thought that the software world is too complicated for you to even try doing something on your own?

Well, we have good news for you! Programming is not as hard as it seems and we want to show you how fun it could be.

The tutorial will not magically turn you into programmer. If you want to be good at it, you need months or even years of learning and practice. But we want to show you that programming or creating website is not as complicated as it seems. We will try to explain different bits and pieces as good as we can, so you will not feel intimidated by technology.
The tutorial will not magically turn you into programmer. If you want to be good at it, you need months or even years of learning and practice. But we want to show you that programming or creating websites is not as complicated as it seems. We will try to explain different bits and pieces as well as we can, so you will not feel intimidated by technology.

We hope that we'll be able to make you love technology as much as we do!

Expand Down
18 changes: 9 additions & 9 deletions css/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CSS - make it pretty!

Our blog looks still pretty ugly, right? Time to make it nice! We will use CSS for that.
Our blog still looks pretty ugly, right? Time to make it nice! We will use CSS for that.

## What is CSS?

Expand Down Expand Up @@ -32,13 +32,13 @@ Looking nicer already!

Another thing you will learn about today is called __static files__. Static files are all your CSS and images -- files that are not dynamic, so their content don't depend on request context and will be the same for every user.

CSS is a static file, so in order to customize CSS, we need to first configure static files in Django. You'll only do it once for all. Let's start:
CSS is a static file, so in order to customize CSS, we need to first configure static files in Django. You'll only do it once and for all. Let's start:

### Configure static files in Django

First, we need to create a folder to store our static files in. Go ahead and create folder called `static` inside your `mysite` folder.

Now we need to tell Django how it can find it. Open up a `mysite/mysite/settings.py` file, scroll to the bottom of it and add following lines:
Now we need to tell Django how it can find it. Open up the `mysite/mysite/settings.py` file, scroll to the bottom of it and add the following lines:

STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
Expand All @@ -52,9 +52,9 @@ That's it! Time to see if it works :)

First things first: let's create a CSS file now. Create a new folder called `css` inside your `static` folder. Then create a new file called `blog.css` inside this `css` directory. Ready?

Time to write some CSS! Open up your `blog.css` file in code editor.
Time to write some CSS! Open up the `blog.css` file in your code editor.

We won't be going to deep into customizing and learning about CSS here, because it's pretty easy and you can learn it on your own after this workshop. We really recommend doing this [Codeacademy HTML & CSS course](http://www.codecademy.com/tracks/web) to learn everything you need to know about making your websites more pretty with CSS.
We won't be going too deep into customizing and learning about CSS here, because it's pretty easy and you can learn it on your own after this workshop. We really recommend doing this [Codeacademy HTML & CSS course](http://www.codecademy.com/tracks/web) to learn everything you need to know about making your websites more pretty with CSS.

But let's do at least a little. Maybe we could change the color of our header? To understand colors, computer use special codes. They start with `#` and are followed by 6 letters and numbers. You can find color codes for example here: http://www.colorpicker.com/

Expand All @@ -74,7 +74,7 @@ We're just loading static files here :) Then, in the `<head>` section, add this

<link rel="stylesheet" href="{% static 'css/blog.css' %}">

We just told our template where our CSS file is located. Ok, save a file and refresh the site!
We just told our template where our CSS file is located. Ok, save the file and refresh the site!

![Figure 14.2](images/color2.png)

Expand All @@ -84,11 +84,11 @@ Nice work! Maybe we would also like to give our website a little air and increas
margin-left: 15px;
}

Add this to your CSS, save a file and see how it works!
Add this to your CSS, save the file and see how it works!

![Figure 14.3](images/margin2.png)

Maybe we can customize a font in our header? Paste this into your `<head>` in `post_list.html` file:
Maybe we can customize the font in our header? Paste this into your `<head>` in `post_list.html` file:

<link href="http://fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext" rel="stylesheet" type="text/css">

Expand Down Expand Up @@ -181,7 +181,7 @@ Then also replace this:
</div>
{% endfor %}

in a `<body>` of your `post_list.html` with this:
in the `<body>` of your `post_list.html` with this:

<div class="content">
<div class="row">
Expand Down
16 changes: 8 additions & 8 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

Until now your website was only available on your computer, now we will learn how to deploy it! Deploying is a process of publishing your application on the Internet so people can finally go and see your app :)

As you learned, website has to be located on the server. There is a lot of providers, but we will use the one with simplest deployment process: [Heroku](http://heroku.com/). Heroku is free for small applications that don't have too much visitors, it'll be definitely enough for you too.
As you learned, a website has to be located on a server. There are a lot of providers, but we will use the one with the simplest deployment process: [Heroku](http://heroku.com/). Heroku is free for small applications that don't have too many visitors, it'll definitely be enough for you too.

We will be following this tutorial: https://devcenter.heroku.com/articles/getting-started-with-django, but we pasted it here so it's easier for you.

## Requirements.txt

We need to create a `requirements.txt` file to tell Heroku what Python packages needs to be installed on our server.
We need to create a `requirements.txt` file to tell Heroku what Python packages need to be installed on our server.

But first, Heroku needs us to install `django-toolbelt` package. Go to your console with `virtualenv` activated and type this:
But first, Heroku needs us to install the `django-toolbelt` package. Go to your console with `virtualenv` activated and type this:

$ pip install django-toolbelt

Expand All @@ -22,15 +22,15 @@ This will create a file called `requirements.txt` with a list of your installed

## Procfile

Another thing we need to create is a Profile. Open up your code editor, create a file called `Procfile` in `mysite` directory and add this line:
Another thing we need to create is a Procfile. Open up your code editor, create a file called `Procfile` in `mysite` directory and add this line:

web: gunicorn mysite.wsgi

Then save it. Done!

## mysite/settings.py

Another thing we need to modify is our website `settings.py` file. Open `mysite/settings.py` in your editor and add following lines:
Another thing we need to do is modify our website's `settings.py` file. Open `mysite/settings.py` in your editor and add the following lines:

import dj_database_url
DATABASES['default'] = dj_database_url.config()
Expand All @@ -41,11 +41,11 @@ Another thing we need to modify is our website `settings.py` file. Open `mysite/

STATIC_ROOT = 'staticfiles'

Then save a file.
Then save the file.

## mysite/urls.py

Open `mysite/urls.py` file and add this two line in the begining of the file:
Open `mysite/urls.py` file and add these two line in the begining of the file:

from django.conf.urls.static import static
from django.conf import settings
Expand All @@ -63,7 +63,7 @@ The whole thing should look like this:

## mysite/wsgi.py

Open `mysite/wsgi.py` file and replace this line:
Open the `mysite/wsgi.py` file and replace this line:

application = get_wsgi_application()

Expand Down
14 changes: 7 additions & 7 deletions django_-_why_you_need_a_webframework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

Django (_/ˈdʒæŋɡoʊ/ jang-goh_) is a free and open source web application framework, written in Python. It's a web framework - a set of components that helps you to develop websites faster and easier.

You see, when you're building a website, you always need a similiar set of components: a way to handle user authentication (signing up, signing in, signing out), management panel for your website, forms, uploading files, etc, etc.
You see, when you're building a website, you always need a similiar set of components: a way to handle user authentication (signing up, signing in, signing out), management panel for your website, forms, uploading files, etc.

Luckily for you other people long ago noticed that web developers face similar problems when building a new site, so they teamed up and create frameworks (Django is one of them) that gives you ready components you can use.
Luckily for you other people long ago noticed that web developers face similar problems when building a new site, so they teamed up and created frameworks (Django is one of them) that givs you ready components you can use.

Frameworks exist to save you from having to re-invent the wheel and help alleviate some of the overhead when you’re building a new site.

## Why do you need a framework?

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.
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.

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.
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 a webpage. But when you want to send something, you need to have some content. And Django is something that helps you create the content.

## What happen when someone request a website from your server?

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.
When a 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 do. 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.

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.

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 to user's web browser.
In the 'view' all interesting things are done: we can look at the database to look for some information to return it to the user. Maybe the user asked to change something in the data? Like a letter saying "Please change description of my job title." - the view can check if you are allowed to do that, then update the job title for you and send back a message: "Done!". Then the view generates a response and Django can send it to the user's web browser.

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.

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!
So instead of diving too much into details, we will simply start creating something with Django and we will learn all the important parts along the way!


12 changes: 6 additions & 6 deletions django_admin/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Django admin

To add, edit and delete posts we have just modeled, we will use Django admin.
To add, edit and delete posts we have just modeled, we will use the Django admin.

Let's open `blog/admin.py` file and replace it's content with this:
Let's open `blog/admin.py` file and replace its content with this:

from django.contrib import admin
from .models import Post

admin.site.register(Post)

As you can see, we import (include) Post model defined in the previous chapter.
As you can see, we import (include) the Post model defined in the previous chapter.

Ok, time to look at our Post model. Go to the browser and type an address:

Expand All @@ -19,7 +19,7 @@ You will see a login page like this:

![Login page](images/login_page.png)

You should use username and password you chose when you were creating a database (in "Starting Django project" chapter). After login in, you should see Django admin dashboard.
You should use the username and password you chose when you were creating a database (in "Starting Django project" chapter). After login in, you should see the Django admin dashboard.

![Django admin](images/django_admin.png)

Expand All @@ -29,8 +29,8 @@ Make sure that at least two or three (but not all) have publish date set. It wil

![Django admin](images/edit_post.png)

If you want to know more about Django admin, you should check Django documentation: https://docs.djangoproject.com/en/dev/ref/contrib/admin/
If you want to know more about the Django admin, you should check Django's documentation: https://docs.djangoproject.com/en/dev/ref/contrib/admin/

It is probably the good moment to grab a coffee (or tea) and eat something sweet. You created your first Django model - you deserve a little treat!
It is probably a good moment to grab a coffee (or tea) and eat something sweet. You created your first Django model - you deserve a little treat!


Loading