A Django website with an Angular frontend serving as a virtual archive and museum showcasing Crow Indian cultural items. URL: https://civam-mt.org/home
- CIVAM
- All python commands should be run in in the
django_projectfolder. - All ng commands should be run in the
angular-frontendfolder. - You must install all required packages and modules before you can run the site locally.
- This project is designed to work well with Linux or WSL. If you are running MacOS, consider loading an Ubuntu VM or dual-boot to Linux. Nobody has worked on this project using MacOS to our knowledge becuase the setup is tricky.
- After cloning the repository, edit .git/info/exclude
- Add the following to this file:
django_project/project/settings.py
django_project/dump.json
django_project/civam/package-lock.json
- After setting everything else up, if you run
git statusand see any of the above files, rungit update-index --assume-unchanged [<file> ...]for each file. - These files will be modified for local development, but should not be changed on the server unless absolutely necessary.
See instructions here.
For submitting patches and additions, this project uses the "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine from YOUR fork on github.
git clone <url from your fork>then change into the new directory. - Set Upstream do
git remote add upstream <url from upstream fork> - Make new branch for YOUR code submission; do
git checkout -b <whatever you want to name this branch> - Commit changes to your new branch, with descriptive message containing issue number
- Push your work back up to your fork
git push -u origin <your branch name> - On Github Submit a Pull request so that the group can review your changes
NOTE: Be sure to rebase your feature branch on latest changes from "upstream" before making a pull request!
All conflicts should be resolved locally, then rebased and pushed to github.
To sync your master branch before starting to code, do:
git checkout mastergit fetch --allgit pull upstream mastergit push- this syncs your fork on github.- Start on #4 above to begin a new contribution.
Here is a great cheatsheet for git/github.
Here is another article that describes this exact workflow, in more detail.
git fetch
git checkout <originbranch>
git pull
git checkout <featurebranch>
git rebase <originbranch>
- If there are any merge conficts: fix them, add, and commit changes.
- Follow prompts from git.
Consider: one issue == one commit == one pull request.
This strategy (atomicity) ensures that changes can be traced back to discussions about them.
Read this article to learn about how to rebase your commit history and keep it clean.
Pull requests that do not meet this standard should not be merged.
- Navigate to
CISC475directory on server. - Stash any modified files on server:
git stash - Pull latest changes from your repo:
git pull - Pop stashed files:
git stash pop - If there are changes in Angular:
cd ~/CISC475_D5/angular-frontendng build --prod- Then copy generated files:
sudo cp -r /home/ubuntu/CISC475_D5/angular-frontend/dist/angular-frontend/* /var/www/html/
- If there are changes to tables in django:
cd ~/CISC475_D5/django_project- Prepare migration files:
python3 manage.py makemigrations - Migrate table changes to postgres:
python3 manage.py migrate - Restart apache:
sudo service apache2 restart
This document explains how to back up the database content only (no media).
Here is how you can set up your local environment with data from the site.
This webpage holds the actual content displayed on CIVAM. Credentials are on the google drive.
This document details the nuances of the Google map that is used in the CIVAM site.
This document details the RClone media backup procedure.
In case you need it, here are details about restarting the AWS server.
Website Information Folder: https://drive.google.com/drive/u/1/folders/1kLZumZYjkP4IBg42w1kuQPbsW9XPwnIJ?ths=true