Skip to content

frcroth/myHPI

 
 

Repository files navigation

myHPI

tests Coverage Status

This tool is used to manage the student representative website at https://myhpi.de. It is a CMS based on Wagtail/Django and adds several functionalities like polls.

Development setup

To set up a development version on your local machine, you need to execute the following steps:

  1. Check out repository and cd to it
  2. Set up a virtualenv for the project with Python >=3.8 and activate it (e.g., python3 -m venv venv and source venv/bin/activate)
  3. Install poetry (if not already installed): curl -sSL https://install.python-poetry.org/ | python -
  4. Install dependencies with poetry install
  5. Install bootstrap with python tools/install_bootstrap.py
  6. Create env file by copying the .env.example file to .env, e.g. cp .env.example .env (Notice that for some functionality like OIDC some settings must be changed)
  7. Migrate the database with python manage.py migrate
  8. Compile translations with python manage.py compilemessages (does not work on Windows, recommended to skip this step or see docs)
  9. Create a local superuser with python manage.py createsuperuser
  10. Start the development server with python manage.py runserver
  11. Optionally: Create test data with python tools/create_test_data.py
  12. Open your web browser, visit http://localhost:8000/admin and log in with the user you just created

Tests

Test the code with python manage.py test myhpi.tests.

Code style

We recommend installing a pre-commit hook with pre-commit install. That will (look at .pre-commit-config.yaml) before every commit

  • run autoflake with a couple of flags to remove unused imports,
  • run isort . to sort imports,
  • run black . to format the code. You can also check out the IDE integration

If you want to do that manually, run pre-commit run --all-files. Next to that, we also run pylint myhpi to check for semantic issues in the code.

Tips

  • To create translations, run django-admin makemessages -l de in the myhpi directory.

Reset database

  1. Delete db.sqlite3
  2. Conduct development setup steps 7+

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 68.1%
  • HTML 15.5%
  • JavaScript 11.0%
  • SCSS 4.9%
  • Dockerfile 0.3%
  • CSS 0.1%
  • Shell 0.1%