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
@@ -42,7 +43,8 @@ Django already knows where to find the static files for the built-in "admin" app
42
43
43
44
We do that by creating a folder called `static` inside the blog app:
44
45
45
-
```:command-line
46
+
{% filename %}command-line{% endfilename %}
47
+
```
46
48
djangogirls
47
49
├── blog
48
50
│ ├── migrations
@@ -58,7 +60,8 @@ Django will automatically find any folders called "static" inside any of your ap
58
60
59
61
Let's create a CSS file now, to add your own style to your web-page. Create a new directory called `css` inside your `static` directory. Then create a new file called `blog.css` inside this `css` directory. Ready?
60
62
61
-
```:command-line
63
+
{% filename %}command-line{% endfilename %}
64
+
```
62
65
djangogirls
63
66
└─── blog
64
67
└─── static
@@ -75,7 +78,8 @@ To understand colors, computers use special codes. These codes start with `#` fo
75
78
76
79
In your `blog/static/css/blog.css` file you should add the following code:
@@ -94,22 +98,25 @@ Read about [CSS Selectors in w3schools](http://www.w3schools.com/cssref/css_sele
94
98
95
99
Then, we need to also tell our HTML template that we added some CSS. Open the `blog/templates/blog/post_list.html` file and add this line at the very beginning of it:
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.
108
114
We just told our template where our CSS file is located.
As before, check the order and place before the link to `blog/static/css/blog.css`. This line will import a font called *Lobster* from Google Fonts (https://www.google.com/fonts).
160
169
161
170
Find the `h1 a` declaration block (the code between braces `{` and `}`) in the CSS file `blog/static/css/blog.css`. Now add the line `font-family: 'Lobster';` between the braces, and refresh the page:
@@ -194,7 +206,8 @@ And now add a class `post` to your `div` containing a blog post.
194
206
195
207
We will now add declaration blocks to different selectors. Selectors starting with `.` relate to classes. There are many great tutorials and explanations about CSS on the Web to help you understand the following code. For now, just copy and paste it into your `blog/static/css/blog.css` file:
Copy file name to clipboardExpand all lines: en/deploy/README.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,8 @@ Git tracks changes to a particular set of files in what's called a code reposito
26
26
27
27
> **Note** Check your current working directory with a `pwd` (OSX/Linux) or `cd` (Windows) command before initializing the repository. You should be in the `djangogirls` folder.
28
28
29
-
```:command-line
29
+
{% filename %}command-line{% endfilename %}
30
+
```
30
31
$ git init
31
32
Initialized empty Git repository in ~/djangogirls/.git/
32
33
$ git config --global user.name "Your Name"
@@ -37,7 +38,8 @@ Initializing the git repository is something we only need to do once per project
37
38
38
39
Git will track changes to all the files and folders in this directory, but there are some files we want it to ignore. We do this by creating a file called `.gitignore` in the base directory. Open up your editor and create a new file with the following contents:
39
40
40
-
```:.gitignore
41
+
{% filename %}.gitignore{% endfilename %}
42
+
```
41
43
*.pyc
42
44
__pycache__
43
45
myvenv
@@ -54,7 +56,8 @@ And save it as `.gitignore` in the "djangogirls" folder.
54
56
55
57
It's a good idea to use a `git status` command before `git add` or whenever you find yourself unsure of what has changed. This will help stop any surprises from happening, such as wrong files being added or commited. The `git status` command returns information about any untracked/modifed/staged files, branch status, and much more. The output should be similar to:
56
58
57
-
```:command-line
59
+
{% filename %}command-line{% endfilename %}
60
+
```
58
61
$ git status
59
62
On branch master
60
63
@@ -73,7 +76,8 @@ nothing added to commit but untracked files present (use "git add" to track)
73
76
74
77
And finally we save our changes. Go to your console and run these commands:
75
78
76
-
```:command-line
79
+
{% filename %}command-line{% endfilename %}
80
+
```
77
81
$ git add --all .
78
82
$ git commit -m "My Django Girls app, first commit"
79
83
[...]
@@ -102,14 +106,16 @@ Now we need to hook up the Git repository on your computer to the one up on GitH
102
106
103
107
Type the following into your console (Replace `<your-github-username>` with the username you entered when you created your GitHub account, but without the angle-brackets):
@@ -140,13 +146,15 @@ When you've signed up for PythonAnywhere, you'll be taken to your dashboard or "
140
146
141
147
Let's pull down our code from GitHub and onto PythonAnywhere by creating a "clone" of our repo. Type the following into the console on PythonAnywhere (don't forget to use your GitHub username in place of `<your-github-username>`):
0 commit comments