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

fix typo #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions data/module-2/part-1/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ urlpatterns = [
```python
# views.py
from django.http import HttpResponse


def pathView(request):
return HttpResponse('Path')
Expand Down Expand Up @@ -212,7 +212,7 @@ urlpatterns = [
```python
# views.py
from django.http import HttpResponse


def greetView(request, user):
return HttpResponse('Hi ' + user)
Expand All @@ -236,7 +236,7 @@ urlpatterns = [
```python
# views.py
from django.http import HttpResponse


def greetView(request):
user = request.GET.get('user')
Expand Down Expand Up @@ -364,7 +364,7 @@ def homePageView(request):

The context variable is a
[dictionary](https://docs.python.org/3/tutorial/datastructures.html#dictionaries),
and it can also contain nested dictionaries and lists.
and it can also contain nested dictionaries and lists.

The context can be then rendered using the `{{}}` syntax in the template

Expand All @@ -390,7 +390,7 @@ application. Forms are defined in HTML (see
[form](http://www.w3schools.com/html/html_forms.asp)) using the `form`-element.
The form-element will contain the path to which the content will be sent to,
the type of the request, and the data. For now, the type of the request will be
POST. We will discuss POST and GET later.
POST. We will discuss POST and GET later.

The data is defined using fields such as the input field (`<input
type="text"...`), and the content is sent to the server using a button (`<input
Expand Down Expand Up @@ -489,7 +489,7 @@ python3 manage.py migrate
```

NB! Be wary that `items = request.session.get('items', [])` doesn't create a new list in session if one doesn't exist,
it will simply initializes `items` to `[]`. Moreover, for example, `items = []` will not update the list in sessions.
it will simply initialize `items` to `[]`. Moreover, for example, `items = []` will not update the list in sessions.
It will only set the `items` to point to `[]`.
Consequently, in certain cases, you have to update the actual list explicitly for example with `request.session['items'] = items`.

Expand Down
2 changes: 1 addition & 1 deletion data/module-2/part-2/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define a classification for that element.

While HTML is the language for defining the structure and content of a web
page, Javascript is a language for defining dynamic content to the page.
javascript is a programming language, and like almost any programming language,
Javascript is a programming language, and like almost any programming language,
it is executed one command at a time, top to bottom, left to right.


Expand Down