TT#121955 update django to 3.0

- Features deprecated in 2.1:
  * {% load staticfiles %} and {% load admin_static %} are deprecated in
    favor of {% load static %}, which works the same.

- Features deprecated in 1.10:
  * Session verification will be enabled regardless of whether or not
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware' is
    in MIDDLEWARE_CLASSES.

- django-filters:
  * https://django-filter.readthedocs.io/en/stable/guide/rest_framework.html

- django-rest-framework:
  https://www.django-rest-framework.org/api-guide/pagination/
  "Note that you need to set both the pagination class, and the page size that
  should be used. Both DEFAULT_PAGINATION_CLASS and PAGE_SIZE are None by default."

- t/Dockerfile: migrate to bullseye

Change-Id: Ia225eba15ca46446700fa2699e89d7e4601bf1a2
pull/4/head
Victor Seva 3 years ago
parent ca54503eaf
commit c0d0206cf2

@ -0,0 +1,2 @@
[flake8]
max-line-length = 79

@ -1,5 +1,5 @@
<!DOCTYPE html>
{% load staticfiles %}
{% load static %}
<html lang="en">
<head>
<meta charset="utf-8">

@ -1,5 +1,5 @@
{% extends "panel/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}{{ project }}{% endblock %}
{% block navlist%}
<li><a href="{% url 'panel:index' %}">Panel</a></li>

@ -1,6 +1,6 @@
{% extends "panel/base.html" %}
{% load jsonify %}
{% load staticfiles %}
{% load static %}
{% block title %}{{ project }}{% endblock %}
{% block navlist %}
<!-- hello -->

@ -1,6 +1,6 @@
{% extends "panel/base.html" %}
{% load jsonify %}
{% load staticfiles %}
{% load static %}
{% block title %}{{ release }}{% endblock %}
{% block navlist %}
<li><a href="{% url 'panel:index' %}">Panel</a></li>

@ -1,6 +1,6 @@
{% extends "panel/base.html" %}
{% load jsonify %}
{% load staticfiles %}
{% load static %}
{% block title %}{{ release }}{% endblock %}
{% block navlist %}
<li><a href="{% url 'panel:index' %}">Panel</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build release{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index_old'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build dependences{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index_old'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build docker images per project{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build release{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build release{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build release{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build release{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index_old'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build release{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index_old'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build dependences{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index_old'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build docker images per project{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Build docker images per project{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Hotfixes{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Refresh GIT{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -1,5 +1,5 @@
{% extends "release_dashboard/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}Refresh Docker{% endblock %}
{% block navlist %}
<li><a href="{% url 'release_dashboard:index'%}">Release Dashboard</a></li>

@ -51,7 +51,6 @@ MIDDLEWARE = (
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.auth.middleware.SessionAuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django.middleware.security.SecurityMiddleware",
@ -109,7 +108,11 @@ STATIC_ROOT = os.path.join(BASE_DIR, "static_media/")
REST_FRAMEWORK = {
"PAGE_SIZE": 10,
"DEFAULT_FILTER_BACKENDS": ("rest_framework.filters.DjangoFilterBackend",),
"DEFAULT_PAGINATION_CLASS": "rest_framework"
".pagination.LimitOffsetPagination",
"DEFAULT_FILTER_BACKENDS": (
"django_filters.rest_framework.DjangoFilterBackend",
),
}
SWAGGER_SETTINGS = {

@ -1,18 +1,18 @@
celery>4.4,<5.0
Django==1.11.29
celery
Django==3.0.14
django-appconf
django-assets
django-celery-beat<2.0
django-celery-beat
django-celery-results
django-export
django-extensions<3.0
django-filter<2.3
django-extensions
django-filter
django-jsonify
django-object-tools
django-rest-swagger
django-structlog
django-timezone-field>=3.1,<4.0 # last version supporting django 1.11
djangorestframework>=3.6,<3.7
django-timezone-field
djangorestframework>=3.6
drfapikey
flower>=0.9.5
markdown

@ -1,20 +1,13 @@
# DOCKER_NAME=repoapi-buster
FROM docker.mgm.sipwise.com/sipwise-buster:latest
# DOCKER_NAME=repoapi-bullseye
FROM docker.mgm.sipwise.com/sipwise-bullseye:latest
# Important! Update this no-op ENV variable when this Dockerfile
# is updated with the current date. It will force refresh of all
# of the base images and things like `apt-get update` won't be using
# old cached versions when the Dockerfile is built.
ENV REFRESHED_AT 2020-10-25
ENV REFRESHED_AT 2022-01-13
# test execution; we need the backport of python3-junitxml from our own
# repository since it's not part of Debian/buster
# files that get-code generates
COPY t/sources.list.d/builddeps.list /etc/apt/sources.list.d/
COPY t/sources.list.d/preferences /etc/apt/preferences.d/
RUN apt-get update
RUN apt-get install --assume-yes python3 python3-dev \
RUN apt-get update && apt-get install --assume-yes python3 python3-dev \
python3-pytest python3-pytest-django python3-pytest-pep8 \
python3-pytest-pylint python3-pytest-cov python3-junitxml \
python3-pip python3-virtualenv virtualenv sqlite3 git tmux
@ -33,12 +26,12 @@ WORKDIR /code/
# Instructions for usage
# ----------------------
# When you want to build the base image from scratch (jump to the next section if you don't want to build yourself!):
# % docker build --tag="repoapi-buster" -f t/Dockerfile .
# % docker run --rm -i -t -v $(pwd):/code:rw repoapi-buster:latest bash
# % docker build --tag="repoapi-bullseye" -f t/Dockerfile .
# % docker run --rm -i -t -v $(pwd):/code:rw repoapi-bullseye:latest bash
#
# Use the existing docker image:
# % docker pull docker.mgm.sipwise.com/repoapi-buster
# % docker run --rm -i -t -v $(pwd):/code:rw docker.mgm.sipwise.com/repoapi-buster:latest bash
# % docker pull docker.mgm.sipwise.com/repoapi-bullseye
# % docker run --rm -i -t -v $(pwd):/code:rw docker.mgm.sipwise.com/repoapi-bullseye:latest bash
#
# Inside docker (the command is in history, just press UP button):
# ./t/testrunner

Loading…
Cancel
Save