Configure Pycharm - Developer Guide

  1. As a student, you can get the license for free via the Git Developer Pack

  2. Assumption: The Qunicorn core repository has already been cloned.

  3. Assumption: Poetry and Python have already been set up as in the step above

  4. Overwrite IBM_TOKEN=”yourToken” and EXECUTE_CELERY_TASK_ASYNCHRONOUS=”Boolean” in .env file

  5. Ctrl + Shift + A → Search for “Switch Python Interpreter” → Select Poetry Python version

  6. Ctrl + Shift + A → Search for “Plugins” → Switch to the Marketplace (top center)

    1. Install Grep Console

    2. Diagrams.net integration (if you want to generate domain models)

    3. EnvFile and Requirements. For correct highlighting in .env and .flaskenv and better integration

  7. Customize code style:

  8. Double-click on ./instance/qunicorn_core.db to automatically configure a database connection that can be searched and manipulated

  9. Configure debugger and logger from the following paragraphs

Configure Debugger for Pycharm

Run → Edit Configurations → Add the configuration parameters from the image

../_images/configure_debugger.jpeg

Configure Logger Terminal

  1. If you start the app using the configuration described above, all logs are displayed in red.

  2. The Grep-Console plugin (in Pycharm) can be used to color the different logging types differently.

  3. If this has been installed, the app can be started in debug mode, for example, and the different colors can then be adjusted in the Grep-Console settings

  4. With “Rehighlight-Your-Console” the customization can be “tested” directly

../_images/configure_logger.png

How to open the database

  1. Double-click on ./instance/qunicorn_core.db to automatically configure a database connection that can be searched and manipulated

How to open the database

  1. Double-click on ./instance/qunicorn_core.db to automatically configure a database connection that can be searched and manipulated

  2. How to display the domain model of the database: rightclick at the database tab on main -> diagrams -> show diagrams

How to check if the pipeline will succeed

  1. poetry run invoke check-linting

    1. If black fails fix it with: poetry run black .

    2. If flake8 fails fix it with: poetry run flake8

  2. poetry run pytest ./tests/automated_tests/

How to test the user authentication

Checkout the Keycloak documentation under Keycloak Authentication

How to write documentation

Use Read the docs for that: Read The Docs Documentation

Other useful commands

To add some flask or invoke commands checkout the documentation: Useful Commands