Allowing collaboration on this project will allow me to complete the final features of the project and to tweak some existing features. It will also give me practice in maintaining a project on GitHub. Please follow the below guidelines to help. If you see something that could be reworked please raise it in an issue and get assigned to it before proceeding with any work. Thank you for your contributions. HAPPY LEARNING!
- This project uses Python. Make sure it is installed before working on this project. Check Python version by running:
python -V
in the terminal. - Install Postgresql. I used Windows installers to install Postgresql locally for database install on a machine without postgresql. Be mindful you may have to install for your current system.
- Check virtualenv version by running: **
virtualenv --version
. If it's not installed intall it usingpy -m pip install virtualenv
on Windows orpython3 -m pip install virtualenv
depending on your system. - Create a virtual environment by running:
py -m venv env
on Windows orpython3 -m venv env
on other systems. - Activate virtual environment by running:
.\env\Scripts\activate
on Windows orsource env/bin/activate
on other systems. - Run
pip install -r requirements.txt
- If you receive a psycopg2 error and are running Linux, you may need to run:
sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib
A Postgresql database is needed to use the same database as the project. Those steps are lengthy and since no changes will be made to database models via open source, you may you the sqlite3 database which is the default for Django and created automatically. Follow the instructions in the mysite/settings.py file and uncomment that sqlite3 section. This settings.py file doesn't need to get pushed to GitHub.
-
First, you need to fork (make a copy) of this repo to your Github account.
-
Clone (download) your fork to your computer.
-
Set your streams so you can sync your clone with the original repo (get the latest updates) by running the following commands in the terminal: Or they could already be set depending on your Git integration extensions with your IDE
-
Run
git remote add upstream <your git fork link from github>
-
Run
git pull upstream main
- These 2 commands will synchronize your forked version of the project with the actual repository.
-
-
Create a branch: Run
git branch <insert new branch name>
-
Change into the new branch: Run
git checkout <insert newly created branch name>
-
Open the
mysite/settings.py
file and scroll to the SECRET_KEY entry and follow the instructions below it to generate a secret key to run the project. Once you have the key, insert it after theSECRET_KEY
variable like so: ('SECRET_KEY', 'insert your key between quotes') You will need to remove this key before committing this file or just don't commit thesettings.py
file to keep your secret key a secret. This SECRET_KEY is needed to run Django. -
DEBUG will need to be changed to True in the settings.py file to get the project on your local machine. It is set to False for the deployed site (you don't have to worry about this).
-
Scroll down and comment out the current DATABASES section and uncomment the one for local development below it (The sqlite3 section).
-
In your terminal: Run:
python manage.py runserver
to start the app. You can visit the local link in the browser to view any changes made in real time. -
Make your changes, Commit, and push the code to your fork. (If you commit the settings.py file the SECRET_KEY you generated would need to be deleted and DEBUG switched back to False before committing, and the DATABASES instructions to comment and uncomment would need to be reversed for development.
-
Create a pull request to have your changes merged from your fork into the origin.