diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml new file mode 100644 index 0000000..1896a3e --- /dev/null +++ b/.github/workflows/django.yml @@ -0,0 +1,43 @@ +name: Django CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:latest + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: github_actions + ports: + - 5432:5432 + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.11 + uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run migrations + run: | + cd backend + python manage.py migrate + - name: Run tests + run: | + cd backend + python manage.py test diff --git a/README.md b/README.md new file mode 100644 index 0000000..803f355 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# TurTaskWeb + +[![Django Testing](https://github.com/TurTaskProject/TurTaskWeb/actions/workflows/django.yml/badge.svg)](https://github.com/TurTaskProject/TurTaskWeb/actions/workflows/django.yml) + +--- + +TurTask is a task and project management tool that incorporates gamification elements. + +[Wiki Repository](https://github.com/TurTaskProject/TurTaskWiki) diff --git a/backend/core/settings.py b/backend/core/settings.py index 65fc5f7..7fa2954 100644 --- a/backend/core/settings.py +++ b/backend/core/settings.py @@ -22,7 +22,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = config('SECRET_KEY') +SECRET_KEY = config('SECRET_KEY', default='j5&66&8@b-!3tbq!=w6-dypl($_0zzoi*ilxd1*&$_6s-59il5') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', default=False, cast=bool) @@ -82,8 +82,8 @@ REST_USE_JWT = True SOCIALACCOUNT_PROVIDERS = { 'google': { 'APP': { - 'client_id': config('GOOGLE_CLIENT_ID'), - 'secret': config('GOOGLE_CLIENT_SECRET'), + 'client_id': config('GOOGLE_CLIENT_ID', default='fake-client-id'), + 'secret': config('GOOGLE_CLIENT_SECRET', default='fake-client-secret'), 'key': '' }, "SCOPE": [ @@ -118,7 +118,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - # "allauth.account.middleware.AccountMiddleware", + "allauth.account.middleware.AccountMiddleware", ] ROOT_URLCONF = 'core.urls' @@ -150,11 +150,11 @@ WSGI_APPLICATION = 'core.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': config('DB_NAME'), - 'USER': config('DB_USER'), - 'PASSWORD': config('DB_PASSWORD'), - 'HOST': config('DB_HOST'), - 'PORT': config('DB_PORT'), + 'NAME': config('DB_NAME', default='github_actions'), + 'USER': config('DB_USER', default='postgres'), + 'PASSWORD': config('DB_PASSWORD', default='postgres'), + 'HOST': config('DB_HOST', default='127.0.0.1'), + 'PORT': config('DB_PORT', default='5432'), } } diff --git a/requirements.txt b/requirements.txt index 985f79c..81c4d2f 100644 Binary files a/requirements.txt and b/requirements.txt differ