Go to file
Benjamin Bach e519383741
Some checks failed
continuous-integration/drone/pr Build is failing
Use FK relation for created user, rather than boolean
2024-08-14 10:20:00 +02:00
requirements Add django-ratelimit as dependency 2024-08-06 23:49:21 +02:00
src Use FK relation for created user, rather than boolean 2024-08-14 10:20:00 +02:00
.dockerignore Cleanup. 2024-07-14 23:14:07 +02:00
.drone.yml Cleanup. 2024-07-14 23:14:07 +02:00
.env.example Changes to payment models (#32) 2024-08-03 17:55:32 +00:00
.gitignore New WaitingListEntry (#33) 2024-07-31 22:49:46 +00:00
.pre-commit-config.yaml Requirements pinning + some cleanup (#36) 2024-07-31 21:17:00 +00:00
docker-compose.yml Cleanup. 2024-07-14 23:14:07 +02:00
Dockerfile Fix error building dev project 2024-08-08 00:34:52 +02:00
entrypoint.sh Fix entrypoint paths. Add uvicorn. Set correct port. 2021-03-01 14:13:19 +01:00
Makefile Changes to payment models (#32) 2024-08-03 17:55:32 +00:00
pyproject.toml Merge branch 'main' of git.data.coop:data.coop/membersystem into membership-invite 2024-08-12 00:12:25 +02:00
README.md Adds a README note 2024-08-13 09:50:07 +02:00
requirements.txt Add django-ratelimit as dependency 2024-08-06 23:49:21 +02:00

data.coop member system

Development setup

There are two ways to setup the development environment.

  • Using the Docker Compose setup provided in this repository.
  • Using hatch in your host OS.

Using Docker Compose

Working with the Docker Compose setup is made easy with the Makefile provided in the repository.

Requirements

  • Docker
  • docker compose plugin

Setup

  1. Setup .env file

    An example .env file is provided in the repository. You can copy it to .env file using the following command:

    cp .env.example .env
    

    The default values in the .env file are suitable for the docker-compose setup.

  2. Migrate

    make migrate
    
  3. Run the development server

    make run
    

Building and running other things

# Build the containers
make build

# Create a superuser
make createsuperuser

# Create Django migrations (after this, maybe you need to change file permissions in volume)
make makemigrations

Using hatch

Requirements

  • Python 3.12 or higher
  • hatch (Recommended way to install is using pipx install hatch)
  • A running PostgreSQL server

Setup

  1. Setup .env file

    An example .env file is provided in the repository. You can copy it to .env file using the following command:

    cp .env.example .env
    

    Edit the .env file and set the values for the environment variables, especially the database variables.

  2. Run migrate

    hatch run dev:migrate
    
  3. Run the development server

    hatch run dev:server
    

Updating requirements

We use hatch-pip-compile. That means we have a set of loosely defined dependencies in pyproject.toml and then we can keep the exactly pinned version in our requirements.txt (auto-generated).

To generate requirements.txt and requirements/requirements-dev.txt, run the following command:

# Build requirements.txt etc
make requirements

# Build Docker image with new Python requirements
make build

Important notes

  • This project uses django-zen-queries, which will sometimes raise a QueriesDisabledError in your templates. You can find a difference of opinion about that, but you can find a difference of opinion about many things, right?
  • If a linting error annoys you, please feel free to strike back by adding a noqa to the line that has displeased the linter and move on with life.