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
Copy file name to clipboardExpand all lines: en/deploy/README.md
+29-41Lines changed: 29 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,9 +132,23 @@ $ git commit -m "My Django Girls app, first commit"
132
132
133
133
## Pushing your code to GitHub
134
134
135
-
Go to [GitHub.com](https://www.github.com) and sign up for a new, free user account. (If you already did that in the workshop prep, that is great!) Be sure to remember your password (add it to your password manager, if you use one).
135
+
Go to [GitHub.com](https://www.github.com) and sign up for a new, free user account.
136
+
(If you already did that in the workshop prep, that is great!)
137
+
Be sure to remember your password (add it to your password manager, if you use one).
136
138
137
-
Then, create a new repository, giving it the name "my-first-blog". Leave the "initialize with a README" checkbox unchecked, leave the .gitignore option blank (we've done that manually) and leave the License as None.
139
+
### Creating a Personal Access Token
140
+
141
+
Now follow the instructions from GitHub to [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).
142
+
The token should have the 'repo' scope.
143
+
Copy the value of the token, and save it somewhere safe (like a password manager).
144
+
145
+
### Creating a new repository
146
+
147
+
Back on the GitHub homepage,
148
+
create a new repository, giving it the name "my-first-blog".
149
+
Leave the "initialize with a README" checkbox unchecked,
150
+
leave the .gitignore option blank (we've done that manually)
151
+
and leave the License as None.
138
152
139
153

140
154
@@ -146,52 +160,22 @@ On the next screen, you'll be shown your repo's clone URL, which you will use in
146
160
147
161
Now we need to hook up the Git repository on your computer to the one up on GitHub.
148
162
149
-
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 -- the URL should match the clone URL you just saw).
163
+
Type the following into your console
164
+
(replace `<your-github-username>` with the username you entered when you created your GitHub account,
165
+
but without the angle-brackets -- the URL should match the clone URL you just saw).
When you push to GitHub, you'll be asked for your GitHub username and password (either right there in the command-line window or in a pop-up window), and after entering credentials you should see something like this:
Branch main set up to track remote branch main from origin.
167
-
```
173
+
When you push to GitHub, you'll be asked for your GitHub username and password
174
+
(either right there in the command-line window or in a pop-up window).
175
+
Use the Personal Access Token you created earlier,
176
+
not your account password.
168
177
169
-
**Note** You will likely encounter the following error when trying to push to GitHub:
170
-
```
171
-
remote: Support for password authentication was removed on August 13, 2021.
172
-
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
173
-
fatal: Authentication failed for 'https://github.com/<your-github-username>/my-first-blog.git/'
174
-
```
175
-
In this case, follow the instructions from GitHub to [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). The token should have the 'repo' scope. Copy the value of the token, then try the git push command again. When you are prompted to enter your username and password, enter the access token instead of your password:
176
-
177
-
1. Go to profile settings or go here: https://github.com/settings/profile
178
-
2. Scroll down and click "Developer settings" on left-hand menu or go here: https://github.com/settings/apps
179
-
3. On left-hand menu, press "Personal access tokens" to expand the dropdown menu. Click "Tokens (classic)"
180
-
4. In the top-right, click "Generate new token", and then click "Generate new token (classic)". You will need to authenticate your account at this point.
181
-
5. Fill in the form:
182
-
- Note: Django girls blog
183
-
- Expiration: No expiration (or if you want more security, choose 90 days)
184
-
- Select scopes: Check every box
185
-
6. Press "Generate token"
186
-
7. Copy the token generated (it's the text string that likely starts with `ghp...`) and store this token somewhere secure as once you close this page, you will lose access to viewing this token and will need to generate a new one if you lose it. For example, you could store it in a password manager or even in a note on your computer.
187
-
8. Run the command in the terminal again:
188
-
{% filename %}command-line{% endfilename %}
189
-
```
190
-
$ git push -u origin HEAD
191
-
```
192
-
9. When the terminal asks for `username`, enter in your github username. Press enter.
193
-
10. Next, it will ask for `password`. Do not use your github password as this method of authenticating ("logging in") is deprecated. Copy the token you just generated (either from github or wherever you carefully stored this token) and carefully paste it into the terminal. Note that as you paste or even type into the terminal for the password, nothing will appear (you can't see what you typed) for security reasons (it's designed like this on purpose). Press enter.
194
-
11. If that worked, you will see the output as below. If you are unsuccesful, try to run `git push -u origin HEAD` again and make sure that you enter in your github username and the token (as the password) correctly.
178
+
After entering credentials you should see something like this:
195
179
196
180
{% filename %}command-line{% endfilename %}
197
181
```
@@ -205,10 +189,14 @@ Branch main set up to track remote branch main from origin.
205
189
206
190
<!--TODO: maybe do ssh keys installs in install party, and point ppl who dont have it to an extension -->
207
191
208
-
Your code is now on GitHub. Go and check it out! You'll find it's in fine company – [Django](https://github.com/django/django), the [Django Girls Tutorial](https://github.com/DjangoGirls/tutorial), and many other great open source software projects also host their code on GitHub. :)
192
+
Your code is now on GitHub. Go and check it out!
193
+
You'll find it's in fine company – [Django](https://github.com/django/django),
194
+
the [Django Girls Tutorial](https://github.com/DjangoGirls/tutorial),
195
+
and many other great open source software projects also host their code on GitHub. :)
209
196
210
197
{% include "/deploy/pythonanywhere.md" %}
211
198
199
+
212
200
# Check out your site!
213
201
214
202
The default page for your site should say "It worked!", just like it does on your local computer. Try adding `/admin/` to the end of the URL, and you'll be taken to the admin site. Log in with the username and password, and you'll see you can add new Posts on the server -- remember, the posts from your local test database were not sent to your live blog.
0 commit comments