GE02 ‐ 1 ‐ Environment Setup (David Jones) - wycre/CS3300-Team-2-9 GitHub Wiki

Set up folders

  1. Make a folder named cs3300
  2. Make a folder inside cs3300 named portfolio
  3. Open the portfolio folder in a terminal
  4. run python3 -m venv djvenv
  5. Activate venv with source djvenv/bin/activate or start djvenv/Scripts/activate.bat if on windows
  6. run pip install django==4.2
  7. Upgrade pip if necessary python3 -m pip install --upgrade pip
  8. create the django project `django-admin startproject django_project
  9. Reorder directory structure:
    1. Move django_project/manage.py to portfolio/
    2. Move contents of django_project/django_project/ to django_project/
    3. Remove the folder django_project/django_project/
      The final structure should look like this:
portfolio/
 | - .gitignore
 | - manage.py
 | - requirements.txt
 | - django_project/
   | - __init__.py
   | - asgi.py
   | - settings.py
   | - urls.py
   | - wsgi.py
 | - portfolio_app/
   | - __init__.py
   | - admin.py
   | - apps.py
   | - models.py
   | - tests.py
   | - urls.py
   | - views.py
   | - ...

Git & Github Setup

  1. Make a private github repository named cs3300-portfolio
  2. Inside the portfolio/ folder, run git init to initialize a local repository
  3. Download the .gitignore file and put it in portfolio/ (when you download it, it may get renamed to gitignore make sure its name is .gitignore)
  4. Do git add . and git commit to create the initial commit containing your files
  5. Copy and run the commands from your new github repository for "...or push an existing repository from the command line"
    They should look like this:
git remote add origin [email protected]:<username>/cs3300-portfolio.git # REPLACE <username>
git branch -M main
git push -u origin main

Git General

When working through the GE, most of your commits will be made directly to the sprint01 branch.

You can make this branch by doing git checkout -b sprint01 in the terminal.

You will also be asked to "version on your sprint01 branch and update your remote repository"
this means you will run the following commands

git add .           # stages all changes for commit
git commit          # commits all staged changes to the repository (use -m "message" to write message from terminal)
git push            # pushes all commits to github

You will also need to merge sprint01 back into main later on, to do this run the following commands:

git branch main     # changes the current branch to main
git merge sprint01  # Merges the changes in sprint01 into the current branch (main)
⚠️ **GitHub.com Fallback** ⚠️