Chromebooks are special in that you can't run your own software outside of the Chrome browser. This is fine if you're browsing the web or editing things in Google Docs, but it makes writing and running your own code slightly more challenging. It's possible to set your Chromebook to "developer mode" and use it like a traditional computer, but this is slightly advanced and also resets the computer to factory defaults.
To still get the benefits of the Django Girls tutorial, this installation guide sets you up with a tool that runs a fully fledged computer for you that you can access through your browser.
First, we'll install a tool called Cloud 9 which will let us edit code, install software, and more. For the duration of the tutorial, Cloud 9 will act as your local machine. You'll still be executing commands in a terminal
interface just like your classmates on OS X or Ubuntu, but the terminal
will be remotely connected to a computer somewhere else that Cloud 9 sets up and runs for you.
- Install Cloud 9 from the Chrome Web Store
- Sign up with Cloud 9
- Go to http://c9.io
- Click Create a new workspace
- Name it "django-girls"
- Select the "Blank" template (second from the right on the bottom row of icons)
Cool, you have a computer to continue installing stuff now. You'll see a little window at the bottom of your new workspace that should say something like:
yourusername:~/workspace $
This is your terminal
, where you'll be giving your new computer instructions. You might want to make it a bit bigger.
A virtual environment (also called a virtualenv) is like a private box we can stuff useful computer code into for a project we're working on. We use them to keep the various bits of code we want for our various projects separate so things don't get mixed up between projects. Virtualenvs are explained in more detail in the full tutorial.
The following lines are commands you should type, one by one, into your terminal:
sudo apt install python3.4-venv
python3 -mvenv myvenv
source myvenv/bin/activate
pip install django==1.9.0
After the final command, you should see output like this:
Downloading/unpacking django==1.9.0
Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
*** Error compiling '/home/ubuntu/workspace/myvenv/build/django/django/conf/app_template/apps.py'...
File "/home/ubuntu/workspace/myvenv/build/django/django/conf/app_template/apps.py", line 4
class {{ camel_case_app_name }}Config(AppConfig):
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/myvenv/build/django/django/conf/app_template/models.py'...
File "/home/ubuntu/workspace/myvenv/build/django/django/conf/app_template/models.py", line 1
{{ unicode_literals }}from django.db import models
^
SyntaxError: invalid syntax
Successfully installed django
Cleaning up...
The errors are okay and can be ignored.
Make a Github account.
The Django Girls tutorial includes a section on what is called Deployment, which is the process of taking the code that powers your new web application and moving it to a publicly accessible computer (called a server
) so other people can see your work.
This part is a little odd when doing the tutorial on a Chromebook since we're already using a computer that is on the internet (as opposed to a local machine). However, it's still useful, as we can think of our Cloud 9 workspace as a place for our "in progress" work and Python Anywhere as a place to show off our stuff as it becomes more complete.
Thus, sign up for a new Python Anywhere account at www.pythonanywhere.com.