|
1 |
| -You can [skip right over this section](http://tutorial.djangogirls.org/en/installation/#install-python) if you're not using a Chromebook. If you |
2 |
| -are, your installation experience will be a little different. You can ignore the |
3 |
| -rest of the installation instructions. |
| 1 | +For people using a Chromebook or those with limited memory on their laptops, we recommend using a cloud IDE environment. This allows you to interact with the command line, Python, and Django directly through your browser, where a code editor is already installed. In case you using this instruction, some steps of the tutorial don't have to be done again ("Deploy/Git" [part](https://tutorial.djangogirls.org/en/deploy/#installing-git) ). You’ll find a more detailed explanation in the “Deploy/Git” section. |
4 | 2 |
|
5 |
| -### Cloud IDE (PaizaCloud Cloud IDE, AWS Cloud9, Glitch.com) |
| 3 | +Your installation experience will be a little different. |
6 | 4 |
|
7 |
| -Cloud IDE is a tool that gives you a code editor and access to a computer running |
8 |
| -on the Internet where you can install, write, and run the software. For the duration |
9 |
| -of the tutorial, cloud IDE will act as your _local machine_. You'll still be |
10 |
| -running commands in a terminal interface just like your classmates on OS X, |
11 |
| -Ubuntu, or Windows, but your terminal will be connected to a computer running |
12 |
| -somewhere else that cloud IDE sets up for you. |
13 |
| -Here are the instructions for cloud IDEs (PaizaCloud Cloud IDE, AWS Cloud9, Glitch.com). |
14 |
| -You can choose one of the cloud IDEs, and follow the instruction of the cloud IDE. |
| 5 | +1. **Go to [GitHub.com](https://github.com)** and sign up for a new, free user account. Be sure to remember your password (add it to your password manager, if you use one). |
15 | 6 |
|
16 |
| -#### PaizaCloud Cloud IDE |
| 7 | +2. **Create a GitHub project**. Visit [this](https://github.com/new) link, use "my-first-blog" name for your project, and make it public (needed for deployment, you can make it private later). Also, add a `README.md` and `.gitignore` file. |
17 | 8 |
|
18 |
| -1. Go to [PaizaCloud Cloud IDE](https://paiza.cloud/) |
19 |
| -2. Sign up for an account |
20 |
| -3. Click _New Server_ and choose the Django app |
21 |
| -4. Click Terminal button(on the left side of the window) |
| 9 | +  |
22 | 10 |
|
23 |
| -Now you should see an interface with a sidebar, buttons at the left. |
24 |
| -Click "Terminal" button to open terminal window with prompt like this: |
| 11 | +3. **Start a Codespace**. Go to GitHub [Codespaces](https://github.com/codespaces/new) and select the repository you just created. Click "Create Codespace". |
25 | 12 |
|
26 |
| -{% filename %}Terminal{% endfilename %} |
27 |
| -``` |
28 |
| -$ |
29 |
| -``` |
| 13 | +  |
30 | 14 |
|
31 |
| -The terminal on the PaizaCloud Cloud IDE is prepared for your instructions. |
32 |
| -You can resize or maximize that window to make it a bit bigger. |
| 15 | + Wait a little bit and you'll see something like that: |
33 | 16 |
|
34 |
| -#### AWS Cloud9 |
35 |
| -Currently Cloud 9 requires you to sign up with AWS and enter credit card |
36 |
| -information. |
| 17 | +  |
37 | 18 |
|
38 |
| -1. Install Cloud 9 from the [Chrome web store](https://chrome.google.com/webstore/detail/cloud9/nbdmccoknlfggadpfkmcpnamfnbkmkcp) |
39 |
| -2. Go to [c9.io](https://c9.io) and click _Get started with AWS Cloud9_ |
40 |
| -3. Sign up for an AWS account (requires credit card information, but you can |
41 |
| - use it for free) |
42 |
| -4. In the AWS Dashboard, enter _Cloud9_ in the search bar and click it |
43 |
| -5. In the Cloud 9 dashboard, click _Create environment_ |
44 |
| -6. Name it _django-girls_ |
45 |
| -7. While configuring settings, select _Create a new instance for environment |
46 |
| - (EC2)_ for "Environment Type" and the _t2.micro_ "Instance type" (it should |
47 |
| - say "Free-tier eligible."). The default cost-saving setting is fine and you |
48 |
| - can keep the other defaults. |
49 |
| -8. Click _Next step_ |
50 |
| -9. Click _Create environment_ |
| 19 | + The [VSCode](https://code.visualstudio.com) editor will open for you automatically. If you see a notification that says "Install Python", please click on it. If not prompted, click the "Extensions" icon on the left sidebar in the Codespace editor. Search for "Python" and click "Install." |
51 | 20 |
|
52 |
| -Now you should see an interface with a sidebar, a big main window with some |
53 |
| -text, and a small window at the bottom that looks something like this: |
| 21 | +  |
54 | 22 |
|
55 |
| -{% filename %}bash{% endfilename %} |
56 |
| -``` |
57 |
| -yourusername:~/workspace $ |
58 |
| -``` |
| 23 | + The bash terminal (similar to Linux) is at the bottom of the page. |
59 | 24 |
|
60 |
| -This bottom area is your terminal. You can use the terminal to send instructions |
61 |
| -to the remote Cloud 9 computer. You can resize that window to make it a bit |
62 |
| -bigger. |
| 25 | +  |
63 | 26 |
|
64 |
| -#### Glitch.com Cloud IDE |
| 27 | + By default, the GitHub Codespace environment will be deleted after 1 month (this applies only to the environment, not your code). To prevent auto-deletion, you can adjust the settings on the page: https://github.com/codespaces |
65 | 28 |
|
66 |
| -1. Go to [Glitch.com](https://glitch.com/) |
67 |
| -2. Sign up for an account (https://glitch.com/signup) or use your GitHub account if you have one. (See GitHub instructions below.) |
68 |
| -3. Click _New Project_ and choose _hello-webpage_ |
69 |
| -4. Click on the Tools dropdown list (at the bottom left side of the window), then on Terminal button to open terminal tab with a prompt like this: |
| 29 | +  |
70 | 30 |
|
71 |
| -{% filename %}Terminal{% endfilename %} |
72 |
| -``` |
73 |
| -app@name-of-your-glitch-project:~ |
74 |
| -``` |
75 |
| - |
76 |
| -When using Glitch.com as your Cloud IDE, you don't have to create a virtual environment. |
77 |
| -Instead, create the following files manually: |
78 |
| - |
79 |
| -{% filename %}glitch.json{% endfilename %} |
80 |
| -```json |
81 |
| -{ |
82 |
| - "install": "pip3 install -r requirements.txt --user", |
83 |
| - "start": "bash start.sh", |
84 |
| - "watch": { |
85 |
| - "throttle": 1000 |
86 |
| - } |
87 |
| -} |
88 |
| -``` |
89 |
| - |
90 |
| -{% filename %}requirements.txt{% endfilename %} |
91 |
| -``` |
92 |
| -Django~={{ book.django_version }} |
93 |
| -``` |
94 |
| - |
95 |
| -{% filename %}.bash_profile{% endfilename %} |
96 |
| -```bash |
97 |
| -alias python=python3 |
98 |
| -alias pip=pip3 |
99 |
| -``` |
100 |
| - |
101 |
| - |
102 |
| -{% filename %}start.sh{% endfilename %} |
103 |
| -```bash |
104 |
| -chmod 600 .bash_profile |
105 |
| -pip3 install -r requirements.txt --user |
106 |
| -python3 manage.py makemigrations |
107 |
| -python3 manage.py migrate |
108 |
| -python3 manage.py runserver $PORT |
109 |
| -``` |
110 |
| - |
111 |
| -Once these files are created, go to the Terminal and execute the following commands to create your first Django project: |
112 |
| - |
113 |
| -{% filename %}Terminal{% endfilename %} |
114 |
| -``` |
115 |
| -django-admin.py startproject mysite . |
116 |
| -refresh |
117 |
| -``` |
118 |
| - |
119 |
| -In order to see detailed error messages, you can activate Django debug logs for your Glitch application. |
120 |
| -Simply add the following at the end of the `mysite/settings.py` file. |
121 |
| - |
122 |
| -{% filename %}mysite/settings.py{% endfilename %} |
123 |
| -```python |
124 |
| -LOGGING = { |
125 |
| - 'version': 1, |
126 |
| - 'disable_existing_loggers': False, |
127 |
| - 'handlers': { |
128 |
| - 'file': { |
129 |
| - 'level': 'DEBUG', |
130 |
| - 'class': 'logging.FileHandler', |
131 |
| - 'filename': 'debug.log', |
132 |
| - }, |
133 |
| - }, |
134 |
| - 'loggers': { |
135 |
| - 'django': { |
136 |
| - 'handlers': ['file'], |
137 |
| - 'level': 'DEBUG', |
138 |
| - 'propagate': True, |
139 |
| - }, |
140 |
| - }, |
141 |
| -} |
142 |
| -``` |
143 |
| -This will create a `debug.log` file detailing Django operations and any error messages that might come up, making it much easier to fix if your website does not work. |
144 |
| - |
145 |
| -The initial restarting of the Glitch project should fail. |
146 |
| -(If you click on the top dropdown button `Show` then click on `In a New Window`, you will receive a `DisallowedHost` error message.) |
147 |
| -Do not worry about it at this stage, the tutorial will fix this as soon as you update the Django settings of your project in the `mysite/settings.py` file. |
148 |
| - |
149 |
| -### Virtual Environment |
150 |
| - |
151 |
| -A virtual environment (also called a virtualenv) is like a private box we can |
152 |
| -stuff useful computer code into for a project we're working on. We use them to |
153 |
| -keep the various bits of code we want for our various projects separate so |
154 |
| -things don't get mixed up between projects. |
155 |
| - |
156 |
| -Run: |
157 |
| - |
158 |
| -{% filename %}Cloud 9{% endfilename %} |
159 |
| -``` |
160 |
| -mkdir djangogirls |
161 |
| -cd djangogirls |
162 |
| -python3 -m venv myvenv |
163 |
| -source myvenv/bin/activate |
164 |
| -pip install django~={{ book.django_version }} |
165 |
| -``` |
166 |
| - |
167 |
| -(note that on the last line we use a tilde followed by an equal sign: `~=`). |
168 |
| - |
169 |
| -### GitHub |
170 |
| - |
171 |
| -Make a [GitHub](https://github.com) account. |
172 |
| - |
173 |
| -### PythonAnywhere |
174 |
| - |
175 |
| -The Django Girls tutorial includes a section on what is called Deployment, |
176 |
| -which is the process of taking the code that powers your new web application |
177 |
| -and moving it to a publicly accessible computer (called a server) so other |
178 |
| -people can see your work. |
179 |
| - |
180 |
| -This part is a little odd when doing the tutorial on a Chromebook since we're |
181 |
| -already using a computer that is on the Internet (as opposed to, say, a laptop). |
182 |
| -However, it's still useful, as we can think of our Cloud 9 workspace as a place |
183 |
| -for our "in progress" work and Python Anywhere as a place to show off our stuff |
184 |
| -as it becomes more complete. |
185 |
| - |
186 |
| -Thus, sign up for a new Python Anywhere account at |
187 |
| -[www.pythonanywhere.com](https://www.pythonanywhere.com). |
| 31 | +4. **Continue with the tutorial**. Follow the next steps from the section [Set up virtual environment and install Django](https://tutorial.djangogirls.org/en/installation/#virtualenv). |
| 32 | + Follow than sections for Ubuntu/Linux. Use the Codespaces command line (terminal), accessible through your browser. |
0 commit comments