Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove django registration redux for 1password passage #199

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,30 @@ name: Django CI

on:
push:
branches: [ master ]
branches: [main]
pull_request:
branches: [ master ]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
environment: test

strategy:
max-parallel: 4
matrix:
python-version: [2.7]
python-version: [3.11]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt --no-cache-dir
COPY . /code/
CMD gunicorn "approval_polls.wsgi:application" "-b 0.0.0.0:8000"
ENTRYPOINT ["/code/entrypoint.sh"]
4 changes: 2 additions & 2 deletions approval_polls/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
)

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"


LOGIN_REDIRECT_URL = "/"
Expand Down Expand Up @@ -197,4 +197,4 @@
},
}

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
8 changes: 3 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ version: "3.9"
services:
web:
build: .
entrypoint: gunicorn
command:
- "approval_polls.wsgi:application"
- "-b 0.0.0.0:8000"
environment:
DEBUG: False
ports:
- "8000:8000"
volumes:
- ./:/code
- ./db.sqlite3:/data/db.sqlite3
- ./db.sqlite3:/data/prod.sqlite3
13 changes: 13 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# Exit script in case of error
set -e

# Run Django migrations
echo "Running migrations"
python manage.py migrate --noinput
python manage.py collectstatic --noinput

# Start Gunicorn server
echo "Starting server"
exec gunicorn "approval_polls.wsgi:application" "-b 0.0.0.0:8000"
Loading