Skip to content
Snippets Groups Projects
Commit 700f6657 authored by Dominik Seeger's avatar Dominik Seeger :ghost:
Browse files

Resolve "Update Django"

parent c8c7b6e5
No related branches found
No related tags found
1 merge request!248Resolve "Update Django"
Pipeline #156311 failed
......@@ -27,7 +27,7 @@ cache:
# ========================== Build Testing section =========================== #
build_test_env:
image: python:3.6
image: python:3.8
stage: build
script:
- pip install pipenv
......@@ -93,7 +93,7 @@ build_test_image:
# ============================== Testing section ============================= #
# ----------------------------- Backend subsection --------------------------- #
.test_template_virtualenv: &test_definition_virtualenv
image: python:3.6
image: python:3.8
before_script:
- pip install pipenv
- VENV=$(pipenv --venv)
......
......@@ -9,23 +9,23 @@ RUN yarn
COPY frontend/ .
RUN yarn build
FROM python:3.6-alpine
FROM alpine:edge
WORKDIR /code
# This set is needed otherwise the postgres driver wont work
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev curl \
&& apk add --no-cache postgresql-dev
&& apk add build-base gcc curl libzmq musl-dev zeromq-dev python3 python3-dev py3-pip \
&& apk add --no-cache postgresql-dev git
RUN apk add --no-cache git
# Create symlink for python
RUN ln -sf python3 /usr/bin/python
RUN pip install pipenv
COPY Pipfile .
COPY Pipfile.lock .
RUN pipenv install --system --deploy && rm -rf /root/.cache
# CACHED
COPY . .
COPY --from=node /app/dist /code/frontend/dist
......@@ -34,6 +34,8 @@ COPY --from=node /app/dist/index.html /code/core/templates/index.html
ENV PYTHONUNBUFFERED 1
RUN python util/format_index.py
RUN python manage.py collectstatic --noinput
RUN apk del build-deps
# Reduces image size
RUN apk del build-base musl-dev python3-dev zeromq-dev
CMD ["./deploy.sh"]
......@@ -33,4 +33,4 @@ coverage:
coverage html
db:
docker run -d --name $(DB_NAME) -p 5432:5432 postgres:9.5
docker run -d --name $(DB_NAME) -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:13
......@@ -4,36 +4,37 @@ url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
flake8 = "~=3.6.0"
flake8 = "~=3.8.3"
pre-commit = "~=1.13.0"
pytest = "~=4.4"
pytest-cov = "~=2.6.0"
pytest-xdist = "~=1.29"
pytest-django = "~=3.5.0"
pytest = "~=6.1.0"
pytest-cov = "~=2.10.1"
pytest-xdist = "~=2.1.0"
pytest-django = "~=3.10.0"
selenium = "~=3.141.0"
factory-boy = "~=2.11.0"
Faker = "~=1.0.0"
factory-boy = "~=3.0.1"
Faker = "~=4.1.3"
[packages]
django-cors-headers = "~=2.4.0"
django-extensions = "~=2.1"
pyzmq = "~=19.0.2"
django-cors-headers = "~=3.5.0"
django-extensions = "~=3.0.9"
djangorestframework-jwt = "~=1.11.0"
djangorestframework = ">=3.9,<3.10"
django-silk = "~=4.0.1"
djangorestframework = "~=3.11.0"
django-silk = "~=4.1.0"
djangorestframework-camel-case = {git = "https://gitlab.gwdg.de/grady-corp/djangorestframework-camel-case.git"}
drf-yasg = "~=1.12.0"
gunicorn = "~=19.9.0"
psycopg2-binary = "~=2.7.0"
python-json-logger = "~=0.1.0"
whitenoise = "~=4.1.0"
drf-yasg = "~=1.17.1"
gunicorn = "~=20.0.4"
psycopg2-binary = "~=2.8.6"
whitenoise = "~=5.2.0"
xlrd = "~=1.2.0"
xkcdpass = "==1.17.0"
django-constance = {extras = ["database"],version = "~=2.3.1"}
semver = "~=2.8.1"
Django = "<3.0,>=2.2"
nbformat = "~=4.4.0"
nbconvert = "~=5.6.0"
JSON-log-formatter = "~=0.3.0"
xkcdpass = "~=1.17.3"
django-constance = {extras = ["database"],version = "~=2.7.0"}
semver = "~=2.10.2"
Django = "~=3.1.1"
nbformat = "~=5.0.7"
nbconvert = "~=6.0.6"
[requires]
python_version = "3.6"
python_version = "3.8"
This diff is collapsed.
# Generated by Django 2.2.16 on 2020-09-29 12:02
import core.models.user_account
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_feedback_modified'),
]
operations = [
migrations.AlterField(
model_name='useraccount',
name='exercise_groups',
field=models.ManyToManyField(blank=True, default=core.models.user_account.group_default, related_name='users', to='core.Group'),
),
]
......@@ -22,10 +22,10 @@ class ConfigurationViewTestCase(APITestCase):
def setUp(self):
self.client.force_authenticate(user=self.reviewer)
self.rev_list_response = self.client.get(f'/api/config/')
self.rev_list_response = self.client.get('/api/config/')
self.client.force_authenticate(user=self.student)
self.stud_list_response = self.client.get(f'/api/config/')
self.stud_list_response = self.client.get('/api/config/')
stud_patch_data = {
"singleCorrection": True,
......@@ -37,10 +37,10 @@ class ConfigurationViewTestCase(APITestCase):
}
self.client.force_authenticate(user=self.reviewer)
self.rev_patch_response = self.client.patch(f'/api/config/change_config/', rev_patch_data)
self.rev_patch_response = self.client.patch('/api/config/change_config/', rev_patch_data)
self.client.force_authenticate(user=self.student)
self.stud_patch_response = self.client.patch(f'/api/config/change_config/', stud_patch_data)
self.stud_patch_response = self.client.patch('/api/config/change_config/', stud_patch_data)
def test_student_can_access(self):
self.assertEqual(status.HTTP_200_OK, self.stud_list_response.status_code)
......
......@@ -104,7 +104,7 @@ class ExportInstanceTest(APITestCase):
# submissionTypes fields
self.assertIn('submissionTypes', instance)
self.assertEquals(2, len(instance['submissionTypes']))
self.assertEqual(2, len(instance['submissionTypes']))
self.assertIn('pk', instance['submissionTypes'][0])
self.assertEqual('01. Sort', instance['submissionTypes'][0]['name'])
self.assertEqual(35, instance['submissionTypes'][0]['fullScore'])
......
......@@ -131,8 +131,8 @@ LOGIN_URL = '/'
AUTH_USER_MODEL = 'core.UserAccount'
AUTH_PASSWORD_VALIDATORS = []
CORS_ORIGIN_WHITELIST = (
'localhost:8080'
'localhost:8000'
'http://localhost:8080'
'http://localhost:8000'
)
REST_FRAMEWORK = {
......@@ -178,8 +178,7 @@ LOGGING = {
'format': '[%(asctime)s] [%(levelname)s] %(name)-20s %(message)s',
},
'json': {
'class': 'pythonjsonlogger.jsonlogger.JsonFormatter',
'format': '(asctime) (levelname) (name) (funcName) (message)'
'()': 'json_log_formatter.JSONFormatter',
},
},
'handlers': {
......
......@@ -3,8 +3,8 @@ from factory.django import DjangoModelFactory
from faker import Faker
from core import models
Faker.seed(42)
fake = Faker()
fake.seed(42)
class ExamTypeFactory(DjangoModelFactory):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment