f-klubben / stregsystemet

The very public stregsystem repo
Other
37 stars 47 forks source link
bitcoin boand fritfit hacktoberfest profit transparency

Stregsystemet Django CI Actions Status codecov

This is the current stregsystem in the F-Klub.

Branches

Python Environment

For windows using Anaconda and virtual environments:

  1. Download and install Anaconda
  2. In a shell:
    • conda create -n stregsystem python=3.11
    • activate stregsystem
    • pip install -r requirements.txt
  3. ???
  4. Profit

For Ubuntu with virtual envs:

  1. Install python3 with pip
    • sudo apt install python3 python3-pip python3-venv
  2. Create virtual environment
    • python3 -m venv venv
  3. Activate virtualenv
    • source venv/bin/activate
  4. Install packages
    • pip3 install -r requirements.txt
  5. ???
  6. Profit

Using Testdata

In order to simplify development for all, we have included a test fixture. Using testserver will delete the data after running. To use it do the following:

  1. python manage.py migrate
  2. python manage.py testserver stregsystem/fixtures/testdata.json
  3. ???
  4. Profit

Admin panel: http://127.0.0.1:8000/admin/
Login: tester:treotreo

Stregsystem: http://127.0.0.1:8000/1/
User: tester

Persistent Testdata

Using runserver will automatically reload django on code change, and persist data in the database configured in local.cfg (can be whatever backend you want to use). First time:

  1. python manage.py migrate
  2. python manage.py loaddata stregsystem/fixtures/testdata.json
  3. python manage.py runserver
  4. ???
  5. Profit

From then on

  1. python manage.py runserver
  2. ???
  3. Profit

Testing Mailserver

Using the debugging tool MailHog (Follow their README for install instructions) and test the mailserver like this:

  1. MailHog --smtp-bind-addr 127.0.0.1:25
  2. Go to http://127.0.0.1:8025 in your browser
  3. python manage.py runserver
  4. ???
  5. Profit