From 4c0bd3bea844d5361358a71bdf795bbd6bbf6d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jirka=20Sch=C3=A4fer?= Date: Wed, 4 Jan 2017 13:26:03 +0100 Subject: [PATCH 1/3] replace . by , in twilio voice msg token string --- two_factor/gateways/twilio/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/two_factor/gateways/twilio/views.py b/two_factor/gateways/twilio/views.py index a7a03d468..5ff5fe7f3 100644 --- a/two_factor/gateways/twilio/views.py +++ b/two_factor/gateways/twilio/views.py @@ -80,5 +80,5 @@ def get_prompt_context(self): # Build the prompt. The numbers have to be clearly pronounced, # this is by creating a string like "1. 2. 3. 4. 5. 6.", this way # Twilio reads the numbers one by one. - 'token': '. '.join(self.kwargs['token']) if self.request.method == 'POST' else '', + 'token': ', '.join(self.kwargs['token']) if self.request.method == 'POST' else '', } From 4000a1108b68fe91ef58c266c39512e5d73447e3 Mon Sep 17 00:00:00 2001 From: Jirka Schaefer Date: Mon, 9 May 2022 22:21:28 +0200 Subject: [PATCH 2/3] simple docker dev env --- CONTRIBUTING.rst | 4 ++++ Dockerfile | 8 ++++++++ docker-compose.yml | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 80d53cf3f..396a9f0f4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -32,6 +32,10 @@ covering all supported Python and Django version with:: tox +With docker run tests:: + + docker-compose run --rm cli bash -c "pip install -r requirements_dev.txt; make test" + Releasing --------- The following actions are required to push a new version: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..f9298fcd2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3 +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +WORKDIR /code +COPY requirements_dev.txt /code/ +RUN pip install . +RUN pip install -r requirements_dev.txt +COPY . /code/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..8aec9aa9e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3.9" + +services: + cli: + build: . + command: bash + volumes: + - .:/code From e479d53ebf7ff0243b170c57dadbec064a68ccac Mon Sep 17 00:00:00 2001 From: Jirka Schaefer Date: Thu, 12 May 2022 23:03:11 +0200 Subject: [PATCH 3/3] run example app with docker --- CONTRIBUTING.rst | 7 +++++++ Dockerfile | 4 ++++ docker-compose.yml | 14 +++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 396a9f0f4..82fb096a0 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -15,6 +15,13 @@ Contribute * Send a pull request with your changes. * Provide a translation using Transifex_. +Running example app with Docker +---------------------------------- + +Run the example app on port 8000:: + + docker-compose up -d example_app + Running tests ------------- This project aims for full code-coverage, this means that your code should be diff --git a/Dockerfile b/Dockerfile index f9298fcd2..99eb326ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,10 @@ ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /code COPY requirements_dev.txt /code/ +COPY setup.py /code/ +COPY README.rst /code/ RUN pip install . RUN pip install -r requirements_dev.txt COPY . /code/ +RUN example/manage.py migrate +COPY . /code/ diff --git a/docker-compose.yml b/docker-compose.yml index 8aec9aa9e..875c195ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,16 @@ version: "3.9" - -services: - cli: + +x-base: &base build: . command: bash volumes: - .:/code + +services: + cli: + <<: *base + example_app: + <<: *base + command: example/manage.py runserver 0.0.0.0:8000 + ports: + - "8000:8000"