UW-GAC / primed-django

PRIMED Consortium Django application website
MIT License
0 stars 0 forks source link

Primed Consortium Django Site

Black code style

pre-commit.ci status

image

Built with Cookiecutter Django

Setup Application

Brief details on how to deploy this application in dev:

Enable oauth login for drupal if needed for your development work

Troubleshooting

Check your callback url. Your django development server may be running at http://localhost:8000/accounts/github/login/callback/ instead of http://127.0.0.1:8000/accounts/github/login/callback/

Example:

$ python manage.py runserver_plus
Performing system checks...
System check identified no issues (0 silenced).
Django version 3.1.13, using settings 'config.settings.local'
Development server is running at http://[127.0.0.1]:8000/

Type checks

Running type checks with mypy:

$ mypy primed

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html (git bash on windows use start instead of open)

Running tests with pytest and unittest

$ pytest
$ python manage.py test

Basic steps to add/alter code

  1. git checkout -b \<feature_branch_name> (Create and switch to feature branch)
  2. sync requirements: pip-sync requirements/requirements.txt test-requirements.txt dev-requirements.txt
  3. make changes, test changes, document changes, commit often
  4. run tests: pytest, python manage.py test
  5. test coverage: (see above)
  6. type checks: mypy primed
  7. git add your changes
  8. manually run pre-commit if you did not install
  9. git commit your changes
  10. repeat steps 3-8
  11. merge in any changes to main
    1. git checkout main
    2. git pull
    3. git checkout \<feature_branch_name>
    4. git rebase main
  12. git push origin \<feature_branch_name>
  13. review or request review of changes in github
  14. submit pull request in github

Compiling requirements files

Requriements files must be compiled in the correct order to handle layering.

pip-compile requirements/requirements.in
pip-compile requirements/test-requirements.in
pip-compile requirements/dev-requirements.in