Skip to content

Commit

Permalink
fix conflic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkit committed Dec 15, 2015
2 parents 2b84677 + 98a1164 commit 9752132
Show file tree
Hide file tree
Showing 313 changed files with 14,394 additions and 1,832 deletions.
7 changes: 5 additions & 2 deletions LANGS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
* [English](en)
* [Polski](pl)
* [Українська](uk)
* [简体中文](zh)
* [Español (beta)](es)
* [Français (beta)](fr)
* [Français](fr)
* [Português-brasileiro (beta)](pt/)
* [Русский (beta)](ru)
* [한국어 (beta)](ko)
* [简体中文](zh)
* [Italian (beta)](it)
* [Magyar (beta)](hu)
* [Türkçe (beta)](tr)
2 changes: 1 addition & 1 deletion en/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Between the `<head>` and `</head>`, after the links to the Bootstrap CSS files a
```html
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
```
The browser reads the files in the order they're given, so we need to be make sure this is in the right place. Otherwise the code in our file may override code in Bootstrap files.
The browser reads the files in the order they're given, so we need to make sure this is in the right place. Otherwise the code in our file may override code in Bootstrap files.
We just told our template where our CSS file is located.

Your file should now look like this:
Expand Down
1 change: 1 addition & 0 deletions en/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ application = DjangoWhiteNoise(get_wsgi_application())
```

> **Note** Don't forget to substitute in your own username where it says `<your-username>`
> **Note** In line three, we make sure Pyhthon anywhere knows how to find our application. It is very important that this path name is correct, and especially that there are no extra spaces here. Otherwise you will see an "ImportError" in the error log.
This file's job is to tell PythonAnywhere where our web app lives and what the Django settings file's name is. It also sets up the "whitenoise" static files tool.

Expand Down
30 changes: 23 additions & 7 deletions en/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ It's time to open `blog/templates/blog/base.html`. We will add a link in `div` n
<a href="{% url 'post_new' %}" class="top-menu"><span class="glyphicon glyphicon-plus"></span></a>
```

Note that we want to call our new view `post_new`.
Note that we want to call our new view `post_new`. The class `"glyphicon glyphicon-plus"` is provided by the bootstrap theme we are using, and will display a plus sign for us.

After adding the line, your html file should now look like this:

Expand Down Expand Up @@ -198,7 +198,7 @@ if form.is_valid():
Basically, we have two things here: we save the form with `form.save` and we add an author (since there was no `author` field in the `PostForm` and this field is required!). `commit=False` means that we don't want to save `Post` model yet - we want to add author first. Most of the time you will use `form.save()`, without `commit=False`, but in this case, we need to do that.
`post.save()` will preserve changes (adding author) and a new blog post is created!

Finally, it would be awesome if we can immediatelly go to `post_detail` page for newly created blog post, right? To do that we need one more import:
Finally, it would be awesome if we can immediately go to `post_detail` page for newly created blog post, right? To do that we need one more import:

```python
from django.shortcuts import redirect
Expand All @@ -207,10 +207,10 @@ from django.shortcuts import redirect
Add it at the very beginning of your file. And now we can say: go to `post_detail` page for a newly created post.

```python
return redirect('blog.views.post_detail', pk=post.pk)
return redirect('post_detail', pk=post.pk)
```

`blog.views.post_detail` is the name of the view we want to go to. Remember that this *view* requires a `pk` variable? To pass it to the views we use `pk=post.pk`, where `post` is the newly created blog post!
`post_detail` is the name of the view we want to go to. Remember that this *view* requires a `pk` variable? To pass it to the views we use `pk=post.pk`, where `post` is the newly created blog post!

Ok, we talked a lot, but we probably want to see what the whole *view* looks like now, right?

Expand All @@ -223,7 +223,7 @@ def post_new(request):
post.author = request.user
post.published_date = timezone.now()
post.save()
return redirect('blog.views.post_detail', pk=post.pk)
return redirect('post_detail', pk=post.pk)
else:
form = PostForm()
return render(request, 'blog/post_edit.html', {'form': form})
Expand Down Expand Up @@ -300,7 +300,7 @@ def post_edit(request, pk):
post.author = request.user
post.published_date = timezone.now()
post.save()
return redirect('blog.views.post_detail', pk=post.pk)
return redirect('post_detail', pk=post.pk)
else:
form = PostForm(instance=post)
return render(request, 'blog/post_edit.html', {'form': form})
Expand Down Expand Up @@ -352,7 +352,23 @@ We're going to add another `{% if %}` tag to this which will make the link only

This `{% if %}` will cause the link to only be sent to the browser if the user requesting the page is logged in. This doesn't protect the creation of new posts completely, but it's a good first step. We'll cover more security in the extension lessons.

Since you're likely logged in, if you refresh the page, you won't see anything different. Load the page in a new browser or an incognito window, though, and you'll see that the link doesn't show up!
Remember the edit icon we just added to our detail page? We also want to add the same change there, so other people won't be able to edit existing posts.

Open `blog/templates/blog/post_detail.html` and find:

```html
<a class="btn btn-default" href="{% url 'post_edit' pk=post.pk %}"><span class="glyphicon glyphicon-pencil"></span></a>
```

Change it to:

```html
{% if user.is_authenticated %}
<a class="btn btn-default" href="{% url 'post_edit' pk=post.pk %}"><span class="glyphicon glyphicon-pencil"></span></a>
{% endif %}
```

Since you're likely logged in, if you refresh the page, you won't see anything different. Load the page in a new browser or an incognito window, though, and you'll see that the link doesn't show up, and the icon doesn't display either!

## One more thing: deploy time!

Expand Down
5 changes: 5 additions & 0 deletions en/django_installation/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ Now that you have your `virtualenv` started, you can install Django using `pip`.
on Windows
> If you get an error when calling pip on Windows platform please check if your project pathname contains spaces, accents or special characters (for example, `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.
on Windows 8 and Windows 10
> Your command line might freeze after when you try to install Django. If this happens, instead of the above command use:
> C:\Users\Name\djangogirls> python -m pip install django==1.8
on Linux
> 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.
Expand Down
4 changes: 2 additions & 2 deletions en/django_models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Post(models.Model):
return self.title
```

> Double-check that you use two undescore characters (`_`) on each side of `str`. This convention is used frequently in Python and sometimes we also call them "dunder" (short for "double-underscore").
> Double-check that you use two underscore characters (`_`) on each side of `str`. This convention is used frequently in Python and sometimes we also call them "dunder" (short for "double-underscore").
It looks scary, right? But no worries we will explain what these lines mean!

Expand Down Expand Up @@ -152,7 +152,7 @@ If something is still not clear about models, feel free to ask your coach! We kn

### Create tables for models in your database

The last step here is to add our new model to our database. First we have to make Django know that we have some changes in our model (we have just created it!). Type `python manage.py makemigrations blog`. It will look like this:
The last step here is to add our new model to our database. First we have to make Django know that we have some changes in our model (we have just created it!). Go to your console window and type `python manage.py makemigrations blog`. It will look like this:

(myvenv) ~/djangogirls$ python manage.py makemigrations blog
Migrations for 'blog':
Expand Down
2 changes: 1 addition & 1 deletion en/django_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $ git pull
* Finally, hop on over to the [Web tab](https://www.pythonanywhere.com/web_app_setup/) and hit **Reload** on your web app. Your update should be live!


Congrats! Now go ahead and try adding a new post in your Django admin (remember to add published_date!), then refresh your page to see if the post appears there.
Congrats! Now go ahead and try adding a new post in your Django admin (remember to add published_date!) Make sure you are in the Django admin for your pythonanywhere site, https://www.yourname.pythonanywhere.com/admin. Then refresh your page to see if the post appears there.

Works like a charm? We're proud! Step away from your computer for a bit, you have earned a break. :)

Expand Down
4 changes: 2 additions & 2 deletions en/installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ Go to [GitHub.com](http://www.github.com) and sign up for a new, free user accou

# Start reading

Congratulations, you are are all set up and ready to go! If you still have some time before the workshop, it would be useful to start reading a few of the beginning chapters:
Congratulations, you are all set up and ready to go! If you still have some time before the workshop, it would be useful to start reading a few of the beginning chapters:

* [How the internet works](../how_the_internet_works/README.md)

* [Introduction to the command line](../intro_to_command_line/README.md)

* [Introduction to Python](../intro_to_command_line/README.md)
* [Introduction to Python](../python_introduction/README.md)

* [What is Django?](../django/README.md)

Expand Down
6 changes: 5 additions & 1 deletion en/intro_to_command_line/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ On Windows, it's a `>` sign, like this:

Each command will be prepended by this sign and one space, but you don't have to type it. Your computer will do it for you :)

> Just a small note: in your case there may be something like `C:\Users\ola>` or `Olas-MacBook-Air:~ ola$` before the prompt sign and that's 100% correct. In this tutorial we will just simplify it to the bare minimum.
> Just a small note: in your case there may be something like `C:\Users\ola>` or `Olas-MacBook-Air:~ ola$` before the prompt sign and that's 100% correct.
The part up to and including the `$` or the `>` is called the *command line prompt*, or *prompt* for short. It prompts you to input something there.

In the tutorial, when we want you to type in a command, we will include the `$` or `>`, and occasionally more to the left. You can ignore the left part and just type in the command which starts after the prompt.

## Your first command (YAY!)

Expand Down
3 changes: 1 addition & 2 deletions en/python_installation/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ Django is written in Python. We need Python to do anything in Django. Let's star

You can download Python for Windows from the website https://www.python.org/downloads/release/python-343/. 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!

One thing to watch out for: on the second screen of the installation wizard, marked "Customize", make sure you scroll down and choose the "Add python.exe to the Path" option, as shown here:
One thing to watch out for: on the second screen of the installation wizard, marked "Customize", make sure you scroll down to the "Add python.exe to the Path" option and select "Will be installed on local hard drive", as shown here:

![Don't forget to add Python to the Path](../python_installation/images/add_python_to_windows_path.png)


### Linux

It is very likely that you already have Python installed out of the box. To check if you have it installed (and which version it is), open a console and type the following command:
Expand Down
6 changes: 3 additions & 3 deletions en/python_introduction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ Earlier, we picked out a code editor from the [code editor](../code_editor/READM
print('Hello, Django girls!')
```

> **Note** You should notice one of the coolest thing about code editors: colours! In the Python console, everything was the same colour, now you should see that the `print` function is a different colour from the string. This is called "syntax highlighting", and it's a really useful feature when coding. The colour of things will give you hints, such as unclosed strings or a typo in a keyword name (like the `def` in a function, which we'll see below). This is one of the reasons we use a code editor :)

Obviously, you're a pretty seasoned Python developer now, so feel free to write some code that you've learned today.

Now we need to save the file and give it a descriptive name. Let's call the file **python_intro.py** and save it to your desktop. We can name the file anything we want, but the important part here is to make sure the file ends in __.py__. The __.py__ extension tells our operating system that this is a **python executable file** and Python can run it.

> **Note** You should notice one of the coolest thing about code editors: colours! In the Python console, everything was the same colour, now you should see that the `print` function is a different colour from the string. This is called "syntax highlighting", and it's a really useful feature when coding. The colour of things will give you hints, such as unclosed strings or a typo in a keyword name (like the `def` in a function, which we'll see below). This is one of the reasons we use a code editor :)

With the file saved, it's time to run it! Using the skills you've learned in the command line section, use the terminal to **change directories** to the desktop.

On a Mac, the command will look something like this:
Expand Down
2 changes: 1 addition & 1 deletion en/whats_next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Later on, you can try the resources listed below. They're all very recommended!
- [New Coder tutorials](http://newcoder.io/tutorials/)
- [Code Academy Python course](http://www.codecademy.com/en/tracks/python)
- [Code Academy HTML & CSS course](http://www.codecademy.com/tracks/web)
- [Django Carrots tutorial](http://django.carrots.pl/en/)
- [Django Carrots tutorial](https://github.com/ggcarrots/django-carrots)
- [Learn Python The Hard Way book](http://learnpythonthehardway.org/book/)
- [Getting Started With Django video lessons](http://gettingstartedwithdjango.com/)
- [Two Scoops of Django: Best Practices for Django 1.8 book](http://twoscoopspress.com/products/two-scoops-of-django-1-8)
Expand Down
2 changes: 1 addition & 1 deletion es/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Tal y como hiciste en tu propio ordenador, puedes crear un virtualenv en PythonA

20:20 ~ $ source myvenv/bin/activate

(mvenv)20:20 ~ $ pip install django whitenoise
(mvenv)20:20 ~ $ pip install django==1.8 whitenoise
Collecting django
[...]
Successfully installed django-1.8 whitenoise-1.0.6
Expand Down
2 changes: 1 addition & 1 deletion es/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Bueno, vamos a ver cómo quedará el HTML en `post_edit.html`:

{% block content %}
<h1>New post</h1>
<form method="POST" class="post-form">{% raw %}{% csrf_token %}{% endraw %}
<form method="POST" class="post-form">{% csrf_token %}
{{ form.as_p }}
<button type="submit" class="save btn btn-default">Save</button>
</form>
Expand Down
21 changes: 17 additions & 4 deletions es/django_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,25 @@ Todo lo que pones entre `{% for %}` y `{% endfor %}` se repetirá para cada obje
Sería bueno ver si tu sitio web seguirá funcionando en la Internet pública, ¿verdad? Intentemos desplegándola en PythonAnywhere nuevamente. Aquí te dejamos un ayuda memoria...

* Primero, sube tu código a GitHub

$ git status [...] $ git add -A . $ git status [...] $ git commit -m "Added views to create/edit blog post inside the site." [...] $ git push

```
$ git status
[...]
$ git add -A .
$ git status
[...]
$ git commit -m "Modified templates to display posts from database."
[...]
$ git push
```

* Luego, identifícate en [PythonAnywhere][4] y ve a tu **consola Bash** (o empieza una nueva), y ejecuta:

$ cd my-first-blog $ git pull [...]

```
$ cd my-first-blog
$ git pull
[...]
```

* Finalmente, ve a la [pestaña Web][5] y presiona **Reload** en tu aplicación web. ¡Tu actualización debería poder verse!

Expand Down
9 changes: 8 additions & 1 deletion es/html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,14 @@ Una vez que hicimos esto, subimos (push) nuestros cambios a PythonAnywhere:

* Abre la [página de consolas de PythonAnywhere][5] y ve a tu **consola Bash** (o comienza una nueva). Luego, ejecuta:

$ cd ~/my-first-blog $ git pull [...]
```
$ cd ~/my-first-blog
$ source myvenv/bin/activate
(myvenv)$ git pull
[...]
(myvenv)$ python manage.py collectstatic
[...]
```

[5]: https://www.pythonanywhere.com/consoles/

Expand Down
6 changes: 3 additions & 3 deletions es/intro_to_command_line/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Los siguientes pasos te mostrarán cómo usar aquella ventana negra que todos lo

## ¿Qué es la línea de comandos?

La ventana, que generalmente es llamada **línea de comandos** o **interfaz de línea de comandos**, es una aplicación basada en texto para la ver, manejar y manipular archivos en tu computadora (como por ejemplo el Explorador de Windows o Finder en Mac, pero sin la interfaz gráfica). Otros nombres para la línea de comandos son: *cmd*, *CLI*, *símbolo del sistema*, *consola* o *terminal*.
La ventana, que generalmente es llamada **línea de comandos** o **interfaz de línea de comandos**, es una aplicación basada en texto para ver, manejar y manipular archivos en tu computadora (como por ejemplo el Explorador de Windows o Finder en Mac, pero sin la interfaz gráfica). Otros nombres para la línea de comandos son: *cmd*, *CLI*, *símbolo del sistema*, *consola* o *terminal*.

## Abrir la interfaz de línea de comandos

Expand Down Expand Up @@ -217,7 +217,7 @@ Ahora es hora de eliminar el directorio `djangogirls`.

> **Atención**: Eliminar archivos utilizando `del`, `rmdir` o `rm` hace que no puedan recuperarse, lo que significa que los *archivos borrados desaparecerán para siempre* Debes ser muy cuidadosa con este comando.
$ rm - r djangogirls
$ rm -r djangogirls


Windows:
Expand Down Expand Up @@ -272,4 +272,4 @@ Si tienes curiosidad, [ss64.com][1] contiene una referencia completa de comandos

## ¿Lista?

¡Vamos a sumergirnos en Python!
¡Vamos a sumergirnos en Python!
Loading

0 comments on commit 9752132

Please sign in to comment.