Note: this project contains a .gitignore
file, so that you will only share source code on GitHub. In particular it ignores:
- Compiled Python code (
.pyc
files) - VS Code IDE stuff (
.vscode/
subdir) - SQLite database content (
db.sqlite3
file) - etc.
- Fork this project:
- Click the "Fork" button in the-top right corner of this page
- Select your GitHub account; you will be landing in your project's GitHub page (
john-doe/awng-tutorial
instead ofEISC-209-AWNG/awng-tutorial
)
- Add your teachers as members of your project:
- Go to Settings / Collaborators on your project's GitHub page
- Use Add Collaborator for each teacher (type its GitHub identifier)
- Rename the forked project so that it clearly identifies you:
- Go to Settings on your project's GitHub page
- Type the new Repository Name:
awng-tutorial-firstname-lastname
, with your name, e.g.awng-tutorial-john-doe
- Click the "Rename" button
At this point, you have your own project on GitHub with an appropriate initial content. Next, you need to get a working copy on your computer:
- Follow the instructions of the Cloning your forked repository section of https://docs.github.com/en/get-started/quickstart/fork-a-repo
- Launch VS Code and open the local directory, named
awng-tutorial-firstname-lastname
- In your local project directory, create a virtual environment and install Django (see next section)
The following commands create a venv
virtual environment in your local copy of the project. Open a terminal in your local directory (it can be VS Code integrated terminal), then:
$ cd /path/to/project
$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install Django
$ cd /path/to/project
$ py -m venv venv
$ source venv/Scripts/activate
(venv) $ pip install Django
$ cd \path\to\project
$ py -m venv venv
$ venv\Scripts\activate
(venv) $ pip install Django
Warning: activate
might not work on Windows, complaining about some "execution policy" matter. In that case, open a powershell console, run Set-ExecutionPolicy -scope CurrentUser
, answer bypass
and A
(yes to all).
Every time you will use a new terminal/console to type python or Django commands, you will need to reactivate the virtual environment by calling the activate
script. Actually, you need to run the activate
script if you do not see (venv)
before the shell prompt.
For instance, every time you restart VS Code to work on the project, you will have to go to the project local directory if needed, and then to activate venv
:
$ cd /path/to/project
$ source venv/bin/activate
(venv) $
or on Windows via powershell in VS Code:
$ cd \path\to\project
$ venv\Scripts\activate
(venv) $
or on Windows via Git Bash in VS Code:
$ cd /path/to/project
$ source venv/Scripts/activate
(venv) $