Padcaster Portal RESTful API
- VS Code is recommended for working on this project.
- Install and setup Docker
docker-compose updocker-compose run app sh -c "python manage.py createsuperuser"docker-compose run app sh -c "python manage.py test && flake8"- Install and setup Python
- Install and setup PostgreSQL
- Install and setup libvips
In order to connect to your postgres instance you need to setup the following environment variables:
- DB_HOST - The host of the database server, if local probably it is 127.0.0.1
- DB_NAME - The database name
- DB_USER - The database username that can access to the DB_NAME database
- DB_PASSWORD - the DB_USER password
python setup.pyRun migrations:
cd portal
python manage.py migratecd portal
python manage.py createsuperuser --email admin@example.comcd portal
python manage.py runserverOpen http://localhost:8000 with your browser to see the result.
In VSCode, start the debugger to run the development server with interactive debugging.
The core app holds all of the central code, everything that is important to the rest of the sub-apps that we create in this system.
Anything that is shared between one or more apps like the migrations, models, admin setup, core tests, so it's very clear where the central point of all these things is.
TODO: Describe other apps
Please follow this protocol to contribute code from the Git CLI:
git checkout maingit pullgit checkout -b[branch]git push -u origin[branch]- do work and commits here
git checkout maingit pullgit checkout[branch]git rebase[-i]main- fix any conflicts
git push
When your work is ready for review, create a pull request on Github.
The following branch names are reserved. Do not commit directly to these branches.
main- The main development branch.
test- Merging to this branch triggers the deployment pipeline.
stable/YYYY-MM-DD-V- Archive of production branch deployed on
YYYY-MM-DD, whereVis the version number, if multiple deployments happened that day. These branches should be made for every deployment for quick reversions.
- Archive of production branch deployed on
archive/YYYY-MM-DD- Archive of unstable branch made on
YYYY-MM-DD. Use this to preserve experimental or unused code.
- Archive of unstable branch made on
When creating branches to perform work, please use the following naming conventions (-ii represents your first and last initials):
PAD-###-ii- When your work addresses a ticket from Jira, use the ticket ID as the branch name. If multiple developers may be working on the ticket, append your initials. For example,
PAD-108-ss. Prefer this format. If a ticket doesn't exist for your work, please request one from your PM to work against. Fall back to another format if your PM is unavailable.
- When your work addresses a ticket from Jira, use the ticket ID as the branch name. If multiple developers may be working on the ticket, append your initials. For example,
feature/ii-description- Use this format when adding a new feature not associated with a ticket.
experiment/ii-description- Use the
experimentprefix for sandbox branches with breaking or destructive changes. Branches prefixed withexperimentwill not be considered for merging into main. If an experimental branch is successful, create a newfeaturebranch from it for PR.
- Use the
hotfix/ii- Use the
hotfixprefix and your initials for time-constrained updates, or updates which may address multiple high-priority tickets.
- Use the
update/ii-description- Use this format when updating existing functionality not associated with a ticket or a bug.
When reviewing code, please do the following:
git pullgit checkout[branch]- build, run, test
- On Github
- fail
- Reject PR, dev works/commits and re-PRs
- Assign ticket to dev
- pass
- Approve
- Merge
- Delete feature branch
- fail
To deploy source code to staging, merge main into test:
git checkout maingit pullgit checkout testgit pullgit merge main -s resolvegit push
This will trigger a deployment in AWS CodePipeline. If the deployment is successful, review the staging instance at TBD.