mirror of
				https://github.com/retspen/webvirtcloud
				synced 2025-07-31 12:41:08 +00:00 
			
		
		
		
	Django 3.2.4 LTS upgrade
This commit is contained in:
		
							parent
							
								
									d7c0f9445d
								
							
						
					
					
						commit
						5aa22ac042
					
				
					 28 changed files with 58 additions and 28 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% load icons %}
 | 
			
		||||
{% block title %}{% trans "Instances" %} - {{ compute.name }}{% endblock %}
 | 
			
		||||
{% block style %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% load icons %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "Overview" %} - {{ compute.name }}{% endblock %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
from secrets.views import secrets
 | 
			
		||||
from virtsecrets.views import secrets
 | 
			
		||||
 | 
			
		||||
from django.urls import include, path
 | 
			
		||||
# from instances.views import create_instance, create_instance_select_type
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
Django==2.2.22
 | 
			
		||||
Django==3.2.4
 | 
			
		||||
django-bootstrap4==3.0.1
 | 
			
		||||
django-icons==4.0.0
 | 
			
		||||
django-login-required-middleware==0.6.1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
<html>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,7 +24,7 @@
 | 
			
		|||
-->
 | 
			
		||||
{% extends "console-base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block head %}
 | 
			
		||||
<title>WebVirtCloud - Spice Client - Full</title>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,7 +24,7 @@
 | 
			
		|||
-->
 | 
			
		||||
{% extends "console-base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block head %}
 | 
			
		||||
<title>WebVirtCloud - Spice - Lite</title>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "console-base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block head %}
 | 
			
		||||
<!--
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "console-base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block head %}
 | 
			
		||||
<!--
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load icons %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% block title %}{% trans "Instances" %}{% endblock %}
 | 
			
		||||
{% block style %}
 | 
			
		||||
    <link rel="stylesheet" href="{% static 'css/sortable-theme-bootstrap.css' %}" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "Create new instance" %} - {% trans "Select Type" %}{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% load icons %}
 | 
			
		||||
{% block title %}{% trans "Create new instance" %}{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "Instance" %} - {{ instance.name }}{% endblock %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "Interfaces" %} - {{ compute.name }}{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "Network" %} - {{ pool }}{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "NWFilter" %}: {{ name }}{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{% trans "NWFilters" %} - {{ compute.name }}{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% block title %}{{ compute }} - {% trans "Storage" %}: {{ pool }}{% endblock %}
 | 
			
		||||
{% block style %}
 | 
			
		||||
    <link rel="stylesheet" href="{% static "css/sortable-theme-bootstrap.css" %}"/>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{% extends "base.html" %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
{% load staticfiles %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
{% block title %}{% trans "Secrets" %} - {{ compute.name }}{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block style %}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
from secrets.forms import AddSecret
 | 
			
		||||
from virtsecrets.forms import AddSecret
 | 
			
		||||
 | 
			
		||||
from admin.decorators import superuser_only
 | 
			
		||||
from computes.models import Compute
 | 
			
		||||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ from libvirt import (
 | 
			
		|||
    VIR_SECRET_USAGE_TYPE_VOLUME,
 | 
			
		||||
    libvirtError,
 | 
			
		||||
)
 | 
			
		||||
from vrtManager.secrets import wvmSecrets
 | 
			
		||||
from vrtManager.virtsecrets import wvmSecrets
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@superuser_only
 | 
			
		||||
| 
						 | 
				
			
			@ -3,10 +3,10 @@ Django settings for webvirtcloud project.
 | 
			
		|||
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
from pathlib import Path
 | 
			
		||||
 | 
			
		||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
 | 
			
		||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 | 
			
		||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
 | 
			
		||||
BASE_DIR = Path(__file__).resolve().parent.parent
 | 
			
		||||
 | 
			
		||||
SECRET_KEY = ""
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +63,7 @@ TEMPLATES = [
 | 
			
		|||
    {
 | 
			
		||||
        "BACKEND": "django.template.backends.django.DjangoTemplates",
 | 
			
		||||
        "DIRS": [
 | 
			
		||||
            os.path.join(BASE_DIR, "templates"),
 | 
			
		||||
            Path.joinpath(BASE_DIR, "templates"),
 | 
			
		||||
        ],
 | 
			
		||||
        "APP_DIRS": True,
 | 
			
		||||
        "OPTIONS": {
 | 
			
		||||
| 
						 | 
				
			
			@ -83,6 +83,7 @@ TEMPLATES = [
 | 
			
		|||
 | 
			
		||||
WSGI_APPLICATION = "webvirtcloud.wsgi.application"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Settings for django-icons
 | 
			
		||||
DJANGO_ICONS = {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -96,19 +97,20 @@ DJANGO_ICONS = {
 | 
			
		|||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Database
 | 
			
		||||
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
 | 
			
		||||
 | 
			
		||||
DATABASES = {
 | 
			
		||||
    "default": {
 | 
			
		||||
        "ENGINE": "django.db.backends.sqlite3",
 | 
			
		||||
        "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
 | 
			
		||||
        "NAME": Path.joinpath(BASE_DIR, "db.sqlite3"),
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AUTHENTICATION_BACKENDS = [
 | 
			
		||||
    "django.contrib.auth.backends.ModelBackend",
 | 
			
		||||
    "webvirtcloud.ldapbackend.LdapAuthenticationBackend",
 | 
			
		||||
    #"webvirtcloud.ldapbackend.LdapAuthenticationBackend",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
LOGIN_URL = "/accounts/login/"
 | 
			
		||||
| 
						 | 
				
			
			@ -128,13 +130,35 @@ USE_TZ = True
 | 
			
		|||
STATIC_URL = "/static/"
 | 
			
		||||
 | 
			
		||||
STATICFILES_DIRS = [
 | 
			
		||||
    os.path.join(BASE_DIR, "static"),
 | 
			
		||||
    Path.joinpath(BASE_DIR, "static"),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Default primary key field type
 | 
			
		||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
 | 
			
		||||
 | 
			
		||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
LOCALE_PATHS = [
 | 
			
		||||
    "locale/",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Settings for django-icons
 | 
			
		||||
DJANGO_ICONS = {
 | 
			
		||||
 | 
			
		||||
    'DEFAULTS': {
 | 
			
		||||
        'renderer': 'fontawesome4',
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    'RENDERERS': {
 | 
			
		||||
        'fontawesome4': 'FontAwesome4Renderer',
 | 
			
		||||
        'bootstrap3': 'Bootstrap3Renderer',
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
LOGGING = {
 | 
			
		||||
    "version": 1,
 | 
			
		||||
    "disable_existing_loggers": False,
 | 
			
		||||
| 
						 | 
				
			
			@ -150,6 +174,7 @@ LOGGING = {
 | 
			
		|||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# WebVirtCloud settings
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -223,10 +248,15 @@ ALLOW_EMPTY_PASSWORD = False
 | 
			
		|||
NEW_USER_DEFAULT_INSTANCES = []
 | 
			
		||||
SHOW_PROFILE_EDIT_PASSWORD = True
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# OTP Config
 | 
			
		||||
OTP_ENABLED = False
 | 
			
		||||
 | 
			
		||||
LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ["accounts:login", "accounts:email_otp"]
 | 
			
		||||
 | 
			
		||||
# LDAP Config
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
LDAP_ENABLED = False
 | 
			
		||||
LDAP_URL = ''
 | 
			
		||||
LDAP_PORT = 389
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue