GE02 ‐ 1 ‐ Environment Setup (David Jones) - wycre/CS3300-Team-2-9 GitHub Wiki
- Make a folder named
cs3300 - Make a folder inside
cs3300namedportfolio - Open the
portfoliofolder in a terminal - run
python3 -m venv djvenv - Activate venv with
source djvenv/bin/activateorstart djvenv/Scripts/activate.batif on windows - run
pip install django==4.2 - Upgrade pip if necessary
python3 -m pip install --upgrade pip - create the django project `django-admin startproject django_project
- Reorder directory structure:
- Move
django_project/manage.pytoportfolio/ - Move contents of
django_project/django_project/todjango_project/ - Remove the folder
django_project/django_project/
The final structure should look like this:
- Move
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
| - ...
- Make a private github repository named cs3300-portfolio
- Inside the
portfolio/folder, rungit initto initialize a local repository - Download the .gitignore file and put it in
portfolio/(when you download it, it may get renamed togitignoremake sure its name is.gitignore) - Do
git add .andgit committo create the initial commit containing your files - 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 mainWhen 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 githubYou 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)