Created
February 16, 2018 11:30
-
-
Save mrhumster/1f5c44521966bf525adce73f9bcd8947 to your computer and use it in GitHub Desktop.
16022018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Django settings for casite project. | |
Generated by 'django-admin startproject' using Django 1.9.13. | |
For more information on this file, see | |
https://docs.djangoproject.com/en/1.9/topics/settings/ | |
For the full list of settings and their values, see | |
https://docs.djangoproject.com/en/1.9/ref/settings/ | |
""" | |
import os | |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
# Quick-start development settings - unsuitable for production | |
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ | |
# SECURITY WARNING: keep the secret key used in production secret! | |
SECRET_KEY = 'v^vi_t41c9_v=9$32wj*fl#rsroqqw)&_#9p6dzz5!#!b(7*%n' | |
# SECURITY WARNING: don't run with debug turned on in production! | |
DEBUG = True | |
ALLOWED_HOSTS = [] | |
# Application definition | |
INSTALLED_APPS = [ | |
'crlcontrol.apps.CrlcontrolConfig', | |
'django.contrib.admin', | |
'django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.staticfiles', | |
] | |
MIDDLEWARE_CLASSES = [ | |
'django.middleware.security.SecurityMiddleware', | |
'django.contrib.sessions.middleware.SessionMiddleware', | |
'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', | |
] | |
ROOT_URLCONF = 'casite.urls' | |
TEMPLATES = [ | |
{ | |
'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
'DIRS': [], | |
'APP_DIRS': True, | |
'OPTIONS': { | |
'context_processors': [ | |
'django.template.context_processors.debug', | |
'django.template.context_processors.request', | |
'django.contrib.auth.context_processors.auth', | |
'django.contrib.messages.context_processors.messages', | |
], | |
}, | |
}, | |
] | |
WSGI_APPLICATION = 'casite.wsgi.application' | |
# Database | |
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |
} | |
} | |
# Password validation | |
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators | |
AUTH_PASSWORD_VALIDATORS = [ | |
{ | |
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | |
}, | |
{ | |
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', | |
}, | |
{ | |
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', | |
}, | |
{ | |
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', | |
}, | |
] | |
# Internationalization | |
# https://docs.djangoproject.com/en/1.9/topics/i18n/ | |
LANGUAGE_CODE = 'ru-RU' | |
TIME_ZONE = 'Asia/Omsk' | |
USE_I18N = True | |
USE_L10N = True | |
USE_TZ = True | |
# Static files (CSS, JavaScript, Images) | |
# https://docs.djangoproject.com/en/1.9/howto/static-files/ | |
STATIC_URL = '/static/' | |
LOGIN_URL = '/accounts/login/' | |
LOGIN_REDIRECT_URL = '/crlcontrol/' | |
LOGOUT_REDIRECT_URL = '/crlcontrol/' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""casite URL Configuration | |
The `urlpatterns` list routes URLs to views. For more information please see: | |
https://docs.djangoproject.com/en/1.9/topics/http/urls/ | |
Examples: | |
Function views | |
1. Add an import: from my_app import views | |
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') | |
Class-based views | |
1. Add an import: from other_app.views import Home | |
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') | |
Including another URLconf | |
1. Import the include() function: from django.conf.urls import url, include | |
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) | |
""" | |
from django.conf.urls import url, include | |
from django.contrib.auth import views as auth_views | |
from django.contrib import admin | |
urlpatterns = [ | |
url(r'^admin/', admin.site.urls), | |
url(r'^accounts/login/', auth_views.login, name='login'), | |
url(r'^accounts/logout/', auth_views.logout, {'next_page': '/accounts/login/'}, name='logout'), | |
url(r'^accounts/password_reset/', auth_views.password_reset, name='password-reset'), | |
url(r'^crlcontrol/', include('crlcontrol.urls')), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
WSGI config for casite project. | |
It exposes the WSGI callable as a module-level variable named ``application``. | |
For more information on this file, see | |
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ | |
""" | |
import os | |
from django.core.wsgi import get_wsgi_application | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "casite.settings") | |
application = get_wsgi_application() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from .models import * | |
# Register your models here. | |
admin.site.register(Certification_Authority) | |
admin.site.register(Certification_Authority_System) | |
admin.site.register(Keys_for_checking) | |
admin.site.register(Cdp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.apps import AppConfig | |
class CrlcontrolConfig(AppConfig): | |
name = 'crlcontrol' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms import ModelForm, Select, TextInput, SelectDateWidget | |
from .models import Certification_Authority, Certification_Authority_System, Keys_for_checking, Cdp | |
class CaForm(ModelForm): | |
class Meta: | |
model = Certification_Authority | |
fields = '__all__' | |
pack = len(Certification_Authority_System.objects.all()) | |
widgets = { | |
'pack': Select( | |
attrs={'multiple': 'multiple', | |
'id': 'id_pack', | |
'name': 'pack', | |
'size': pack}), | |
'name': TextInput( | |
attrs={'id': 'id_name', | |
'name': 'name', | |
'type': 'text', | |
'maxlength': '128', | |
'required': ''}), | |
'organization_name': TextInput( | |
attrs={'id': 'id_organization_name', | |
'name': 'organization_name', | |
'type': 'text', | |
'maxlength': '128', | |
'required': ''}), | |
'INN': TextInput( | |
attrs={'id': 'id_INN', | |
'name': 'INN', | |
'type': 'number', | |
'max': '999999999999', | |
'min': '1000000000', | |
'required': '', }), | |
'OGRN': TextInput( | |
attrs={'id': 'id_OGRN', | |
'name': 'OGRN', | |
'type': 'number', | |
'max': '999999999999999', | |
'min': '1000000000000', | |
'required': '', }), | |
} | |
class CasForm(ModelForm): | |
class Meta: | |
model = Certification_Authority_System | |
fields = '__all__' | |
key = len(Keys_for_checking.objects.all()) | |
cdp = len(Cdp.objects.all()) | |
widgets = { | |
'pack_name': TextInput( | |
attrs={'id': 'id_pack_name', | |
'name': 'pack_name', | |
'type': 'text', | |
'maxlength': '128', | |
'required': ''}), | |
'id': TextInput( | |
attrs={'id': 'id_id', | |
'name': 'id', | |
'type': 'text', | |
'maxlength': '40', | |
'required': '', | |
'pattern': '[0-9A-Za-z]'}), | |
'address_pack': TextInput( | |
attrs={'id': 'id_address_pack', | |
'name': 'address_pack', | |
'type': 'text', | |
'maxlength': '128', | |
'required': ''}), | |
'key': Select( | |
attrs={'multiple': 'multiple', | |
'id': 'id_pack', | |
'name': 'pack', | |
'size': key}), | |
'cdp': Select( | |
attrs={'multiple': 'multiple', | |
'id': 'id_cdp', | |
'name': 'cdp', | |
'size': cdp}), | |
} | |
class KeyForm(ModelForm): | |
class Meta: | |
model = Keys_for_checking | |
fields = '__all__' | |
widgets = { | |
'sn': TextInput( | |
attrs={'id': 'id_sn', | |
'maxlength': '256', | |
'name': 'sn', | |
'required': '', | |
'pattern': '[0-9A-Za-z]', | |
}), | |
'issued_to': TextInput( | |
attrs={'required': '', | |
'maxlength': '1024', | |
'name': 'issued_to', | |
'id': 'id_issued_to', | |
}), | |
'issued_by': TextInput( | |
attrs={'required': '', | |
'maxlength': '1024', | |
'name': 'issued_by', | |
'id': 'id_issued_by', | |
}), | |
'imprint': TextInput( | |
attrs={'required': '', | |
'maxlength': '128', | |
'name': 'imprint', | |
'id': 'id_imprint', | |
'pattern': '[0-9A-Za-z]', | |
}), | |
'expiration_date': SelectDateWidget( | |
attrs={'required': '', | |
'name': 'expiration_date', | |
'id': 'id_expiration_date'}, | |
months={1: 'ЯНВ', 2: 'ФЕВ', 3: 'МАР', | |
4: 'АПР', 5: 'МАЙ', 6: 'ИЮН', | |
7: 'ИЮЛ', 8: 'АВГ', 9: 'СЕН', | |
10: 'ОКТ', 11: 'НОЯ', 12: 'ДЕК'}, | |
years=['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020']), | |
'release_date': SelectDateWidget( | |
attrs={'required': '', | |
'name': 'release_date', | |
'id': 'id_release_date', | |
'input_format': '[%Y-%m-%d]'}, | |
months={1: 'ЯНВ', 2: 'ФЕВ', 3: 'МАР', | |
4: 'АПР', 5: 'МАЙ', 6: 'ИЮН', | |
7: 'ИЮЛ', 8: 'АВГ', 9: 'СЕН', | |
10: 'ОКТ', 11: 'НОЯ', 12: 'ДЕК'}, | |
years=['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020']), | |
} | |
class CdpForm(ModelForm): | |
class Meta: | |
model = Cdp | |
fields = '__all__' | |
widgets = { | |
'url': TextInput( | |
attrs={'name': 'url', | |
'id': 'id_url', | |
'required': '', | |
'maxlength': '200', | |
'pattern': '^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$' | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
if __name__ == "__main__": | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "casite.settings") | |
from django.core.management import execute_from_command_line | |
execute_from_command_line(sys.argv) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Generated by Django 1.9.13 on 2018-01-29 09:05 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
import django.db.models.deletion | |
import django.utils.timezone | |
class Migration(migrations.Migration): | |
initial = True | |
dependencies = [ | |
] | |
operations = [ | |
migrations.CreateModel( | |
name='Cdp', | |
fields=[ | |
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | |
('url', models.CharField(default='http://', max_length=200)), | |
], | |
), | |
migrations.CreateModel( | |
name='Certification_Authority', | |
fields=[ | |
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | |
('name', models.CharField(max_length=128, verbose_name='Название центра сертифкации')), | |
('organization_name', models.CharField(max_length=128, verbose_name='Название юридического лица')), | |
('INN', models.CharField(max_length=12, unique=True, verbose_name='ИНН')), | |
('OGRN', models.CharField(max_length=13, unique=True, verbose_name='ОГРН')), | |
('email', models.EmailField(max_length=128, verbose_name='Адрес электронной почты')), | |
('web', models.URLField(verbose_name='WEB сайт')), | |
('address', models.CharField(max_length=128, verbose_name='Адрес')), | |
('city', models.CharField(max_length=64, verbose_name='Город')), | |
('country', models.CharField(default='RU', max_length=2, verbose_name='Страна')), | |
('status', models.CharField(choices=[('Действует', 'Действует'), ('Приостановлена', 'Приостановлена'), ('Прекращена', 'Прекращена'), ('Отозвана', 'Отозвана')], max_length=64, verbose_name='Статус аккредитации')), | |
('stat_day', models.PositiveIntegerField(default=0, editable=False, verbose_name='Дневная статистика')), | |
('stat_week', models.PositiveIntegerField(default=0, editable=False, verbose_name='Недельная статистика')), | |
('stat_month', models.PositiveIntegerField(default=0, editable=False, verbose_name='Месячная статистика')), | |
], | |
), | |
migrations.CreateModel( | |
name='Certification_Authority_System', | |
fields=[ | |
('id', models.CharField(max_length=40, primary_key=True, serialize=False, unique=True, verbose_name='Идентификатор ключ')), | |
('pack_name', models.CharField(max_length=128, verbose_name='Наименование ПАК УЦ')), | |
('class_es', models.CharField(choices=[('КС1', 'КС1'), ('КС2', 'КС2'), ('КС3', 'КС3'), ('КБ1', 'КБ1'), ('КБ2', 'КБ2'), ('КА1', 'КА1')], max_length=3, verbose_name='Класс средств ЭП')), | |
('vendor', models.CharField(choices=[('КриптоПРО УЦ 2.0', 'КриптоПРО УЦ 2.0'), ('КриптоПРО УЦ 1.5', 'КриптоПРО УЦ 1.5'), ('VIPNet КС2', 'VIPNet КС2'), ('VIPNet KC3', 'VIPNet KC3'), ('VIPNet УЦ 4', 'VIPNet УЦ 4'), ('Notary-PRO 2.6', 'Notary-PRO 2.6'), ('Notary-PRO 2.7', 'Notary-PRO 2.7'), ('АПК Валидата УЦ', 'АПК Валидата УЦ'), ('АПК Верба-сертификат МВ', 'АПК Верба-сертификат МВ'), ('АПК УЦ ММВБ версия 1.0', 'АПК УЦ ММВБ версия 1.0'), ('Атлант-УЦ', 'Атлант-УЦ'), ('КУЦ "Автограф"', 'КУЦ "Автограф"'), ('ЛИССИ-УЦ', 'ЛИССИ-УЦ'), ('ПАК "Головной УЦ"', 'ПАК "Головной УЦ"'), ('ПАК Юнисерт ГОСТ версия 2.1', 'ПАК Юнисерт ГОСТ версия 2.1'), ('ПАК Бикрипт-УЦ', 'ПАК Бикрипт-УЦ'), ('AtlasCert версия 1.1', 'AtlasCert версия 1.1')], max_length=40, verbose_name='Средства УЦ')), | |
('address_pack', models.CharField(max_length=128, verbose_name='Адрес ПАК')), | |
('cdp', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='crlcontrol.Cdp')), | |
], | |
), | |
migrations.CreateModel( | |
name='Keys_for_checking', | |
fields=[ | |
('issued_to', models.CharField(max_length=1024, verbose_name='Кому выдан')), | |
('issued_by', models.CharField(max_length=1024, verbose_name='Кем выдан')), | |
('sn', models.CharField(max_length=256, primary_key=True, serialize=False, unique=True, verbose_name='Серийный номер')), | |
('release_date', models.DateField(default=django.utils.timezone.now, verbose_name='Действует с')), | |
('expiration_date', models.DateField(default=django.utils.timezone.now, verbose_name='Действует по')), | |
('imprint', models.CharField(max_length=128, verbose_name='Отпечаток')), | |
], | |
), | |
migrations.AddField( | |
model_name='certification_authority_system', | |
name='key', | |
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crlcontrol.Keys_for_checking'), | |
), | |
migrations.AddField( | |
model_name='certification_authority', | |
name='pack', | |
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crlcontrol.Certification_Authority_System'), | |
), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Generated by Django 1.9.13 on 2018-01-29 09:12 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
dependencies = [ | |
('crlcontrol', '0001_initial'), | |
] | |
operations = [ | |
migrations.RemoveField( | |
model_name='certification_authority_system', | |
name='key', | |
), | |
migrations.AddField( | |
model_name='certification_authority_system', | |
name='key', | |
field=models.ManyToManyField(to='crlcontrol.Keys_for_checking'), | |
), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Generated by Django 1.9.13 on 2018-01-29 09:14 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
dependencies = [ | |
('crlcontrol', '0002_auto_20180129_1512'), | |
] | |
operations = [ | |
migrations.RemoveField( | |
model_name='certification_authority', | |
name='pack', | |
), | |
migrations.AddField( | |
model_name='certification_authority', | |
name='pack', | |
field=models.ManyToManyField(to='crlcontrol.Certification_Authority_System'), | |
), | |
migrations.RemoveField( | |
model_name='certification_authority_system', | |
name='cdp', | |
), | |
migrations.AddField( | |
model_name='certification_authority_system', | |
name='cdp', | |
field=models.ManyToManyField(to='crlcontrol.Cdp'), | |
), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Generated by Django 1.9.13 on 2018-01-31 04:22 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
dependencies = [ | |
('crlcontrol', '0003_auto_20180129_1514'), | |
] | |
operations = [ | |
migrations.AlterField( | |
model_name='certification_authority', | |
name='pack', | |
field=models.ManyToManyField(to='crlcontrol.Certification_Authority_System', verbose_name='Програмно-аппратный комплекс'), | |
), | |
migrations.AlterField( | |
model_name='certification_authority_system', | |
name='cdp', | |
field=models.ManyToManyField(to='crlcontrol.Cdp', verbose_name='Точка доступа CRL'), | |
), | |
migrations.AlterField( | |
model_name='certification_authority_system', | |
name='key', | |
field=models.ManyToManyField(to='crlcontrol.Keys_for_checking', verbose_name='Ключи проверки ЭП'), | |
), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.urlresolvers import reverse | |
from django.db import models | |
class Cdp(models.Model): | |
url = models.CharField(max_length=200, default='http://') | |
def __str__(self): | |
return self.url | |
def get_absolute_url(self): | |
return reverse('detail', kwargs={'pk', self.pk}) | |
class Meta: | |
ordering = ['url'] | |
class Keys_for_checking (models.Model): | |
# Ключ проверки ЭП | |
issued_to = models.CharField('Кому выдан', max_length=1024) | |
issued_by = models.CharField('Кем выдан', max_length=1024) | |
sn = models.CharField('Серийный номер', max_length=256, unique=True, primary_key=True) | |
release_date = models.DateField('Действует с', default='YYYY-MM-DD') | |
expiration_date = models.DateField('Действует по', default='YYYY-MM-DD') | |
imprint = models.CharField('Отпечаток', max_length=128) | |
def __str__(self): | |
return self.issued_to | |
class Meta: | |
ordering = ['issued_to'] | |
class Certification_Authority_System(models.Model): | |
# ПЕРМЕННЫЕ ПАКА | |
# Переменные ссылок списков отзыва | |
id = models.CharField('Идентификатор ключ', max_length=40, unique=True, primary_key=True) | |
pack_name = models.CharField('Наименование ПАК УЦ', max_length=128) | |
KC1 = 'КС1' | |
KC2 = 'КС2' | |
KC3 = 'КС3' | |
KB1 = 'КБ1' | |
KB2 = 'КБ2' | |
KA1 = 'КА1' | |
CLASS_ES = ( | |
(KC1, 'КС1'), | |
(KC2, 'КС2'), | |
(KC3, 'КС3'), | |
(KB1, 'КБ1'), | |
(KB2, 'КБ2'), | |
(KA1, 'КА1'), | |
) | |
class_es = models.CharField('Класс средств ЭП', max_length=3, choices=CLASS_ES) | |
v1 = 'КриптоПРО УЦ 2.0' | |
v2 = 'КриптоПРО УЦ 1.5' | |
v3 = 'VIPNet КС2' | |
v4 = 'VIPNet KC3' | |
v5 = 'VIPNet УЦ 4' | |
v6 = 'Notary-PRO 2.6' | |
v7 = 'Notary-PRO 2.7' | |
v8 = 'АПК Валидата УЦ' | |
v9 = 'АПК Верба-сертификат МВ' | |
v10 = 'АПК УЦ ММВБ версия 1.0' | |
v11 = 'Атлант-УЦ' | |
v12 = 'КУЦ "Автограф"' | |
v13 = 'ЛИССИ-УЦ' | |
v14 = 'ПАК "Головной УЦ"' | |
v15 = 'ПАК Юнисерт ГОСТ версия 2.1' | |
v16 = 'ПАК Бикрипт-УЦ' | |
v17 = 'AtlasCert версия 1.1' | |
VENDOR = ( | |
(v1, 'КриптоПРО УЦ 2.0'), | |
(v2, 'КриптоПРО УЦ 1.5'), | |
(v3, 'VIPNet КС2'), | |
(v4, 'VIPNet KC3'), | |
(v5, 'VIPNet УЦ 4'), | |
(v6, 'Notary-PRO 2.6'), | |
(v7, 'Notary-PRO 2.7'), | |
(v8, 'АПК Валидата УЦ'), | |
(v9, 'АПК Верба-сертификат МВ'), | |
(v10, 'АПК УЦ ММВБ версия 1.0'), | |
(v11, 'Атлант-УЦ'), | |
(v12, 'КУЦ "Автограф"'), | |
(v13, 'ЛИССИ-УЦ'), | |
(v14, 'ПАК "Головной УЦ"'), | |
(v15, 'ПАК Юнисерт ГОСТ версия 2.1'), | |
(v16, 'ПАК Бикрипт-УЦ'), | |
(v17, 'AtlasCert версия 1.1'), | |
) | |
vendor = models.CharField('Средства УЦ', max_length=40, choices=VENDOR) | |
address_pack = models.CharField('Адрес ПАК', max_length=128) | |
cdp = models.ManyToManyField(Cdp, verbose_name='Точка доступа CRL') | |
key = models.ManyToManyField(Keys_for_checking, verbose_name='Ключи проверки ЭП') | |
def __str__(self): | |
return self.pack_name + '(' + self.id + ')' | |
class Meta: | |
ordering = ['pack_name'] | |
class Certification_Authority(models.Model): | |
# Общие переменные | |
name = models.CharField('Название центра сертифкации', max_length=128, blank=False) | |
organization_name = models.CharField('Название юридического лица', max_length=128, blank=False) | |
INN = models.CharField('ИНН', max_length=12, unique=True, blank=False) | |
OGRN = models.CharField('ОГРН', max_length=13, unique=True, blank=False) | |
email = models.EmailField('Адрес электронной почты', max_length=128, blank=False) | |
web = models.URLField('WEB сайт') | |
address = models.CharField('Адрес', max_length=128) | |
city = models.CharField('Город', max_length=64) | |
country = models.CharField('Страна', max_length=2, default='RU') | |
active = 'Действует' | |
suspended = 'Приостановлена' | |
discontinued = 'Прекращена' | |
revoked = 'Отозвана' | |
STATUS = ( | |
(active, 'Действует'), | |
(suspended, 'Приостановлена'), | |
(discontinued, 'Прекращена'), | |
(revoked, 'Отозвана') | |
) | |
status = models.CharField('Статус аккредитации', max_length=64, choices=STATUS) | |
# Переменные статистики | |
stat_day = models.PositiveIntegerField(default=0, editable=False, | |
verbose_name='Дневная статистика') | |
stat_week = models.PositiveIntegerField(default=0, editable=False, | |
verbose_name='Недельная статистика') | |
stat_month = models.PositiveIntegerField(default=0, editable=False, | |
verbose_name='Месячная статистика') | |
#Связи | |
pack = models.ManyToManyField(Certification_Authority_System, verbose_name='Програмно-аппратный комплекс') | |
def __str__(self): | |
return self.name | |
def get_absolute_url(self): | |
return reverse('detail', kwargs={'pk', self.pk}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background: #FFFFFF; | |
font-family:"Ubuntu"; | |
} | |
input { | |
background: #FFFFFF; | |
color: #000000; | |
font-family:"Ubuntu"; | |
border: none; | |
} | |
input#id_organization_name { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_pack_name { | |
width: 100%; | |
height: 37px; | |
font-size: 35px; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_INN { | |
width: 110px; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_OGRN { | |
width: 110px; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_email { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_web { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_address { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_city { | |
width: 110px; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_country { | |
width: 20px; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_name { | |
width: 100%; | |
height: 37px; | |
font-size: 35px; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_id { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_address_pack { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_sn { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_issued_to { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_issued_by { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_imprint { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input#id_url { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #E95420; | |
} | |
input:invalid { | |
background-color: #fa8072; | |
} | |
input#submit { | |
border: 1px solid green; | |
color: #fff; | |
background: green; | |
font-size: 18px; | |
} | |
input:-webkit-autofill { | |
color: #000000 !important; | |
} | |
input:focus { | |
outline: none; | |
} | |
input[type=number]::-webkit-inner-spin-button, | |
input[type=number]::-webkit-outer-spin-button { | |
-webkit-appearance: none; | |
margin: 0; | |
} | |
select { | |
background: #ffffff; | |
color: #000000; | |
width: 100%; | |
border: none; | |
font-family:"Ubuntu"; | |
} | |
select#id_status { | |
width: 160px; | |
margin: left; | |
} | |
select#id_class_es { | |
width: 60px; | |
margin: left; | |
} | |
select#id_vendor { | |
width: 230px; | |
margin: left; | |
} | |
select#id_pack { | |
height: 100%; | |
overflow-y: hidden; | |
} | |
select#id_cdp { | |
height: 100%; | |
overflow-y: hidden; | |
} | |
select:focus{ | |
outline: none; | |
cursor: pointer; | |
} | |
select#id_expiration_date_day { | |
width: 40px; | |
} | |
select#id_expiration_date_month { | |
width: 60px; | |
} | |
select#id_expiration_date_year { | |
width: 60px; | |
} | |
select#id_release_date_day { | |
width: 40px; | |
} | |
select#id_release_date_month { | |
width: 60px; | |
} | |
select#id_release_date_year { | |
width: 60px; | |
} | |
option { | |
background: #ffffff; | |
color: #000000; | |
width: 100%; | |
border: none; | |
font: "Ubuntu"; | |
} | |
h1 { | |
font-size: 33px; | |
color: #000000; | |
margin: auto; | |
align: center; | |
padding: 20px; | |
} | |
table { | |
width: 95%; | |
border: none; | |
margin: auto; | |
border-collapse: collapse; | |
} | |
table#cas_1 { | |
border: none; | |
} | |
table#cas_2 { | |
border: none; | |
width: 100%; | |
} | |
table#cas_options { | |
width: 100%; | |
border: none; | |
} | |
table#indexlist { | |
border: none; | |
color: white; | |
} | |
table#cdp_list { | |
width: 50%; | |
} | |
.reg { | |
width: 100%; | |
} | |
th { | |
color: #E95420; | |
background: #ffffff; | |
border-bottom: 1px dotted | |
} | |
td { | |
color: #000000; | |
background: #ffffff; | |
border: 1px none #E95420; | |
padding: 3px; | |
} | |
td#left { | |
text-align: right; | |
width: 220px; | |
border: none; | |
} | |
td#left_k { | |
text-align: right; | |
width: 150px; | |
border: none; | |
} | |
td#left_cr { | |
text-align: right; | |
vertical-align: top; | |
width: 120px; | |
border: none; | |
} | |
td#right { | |
border: none; | |
text-align: left; | |
} | |
td#left_options { | |
border: none; | |
vertical-align: top; | |
} | |
td#right_options { | |
border: none; | |
vertical-align: top; | |
} | |
a { | |
color: #3399ff; | |
text-decoration: none; | |
padding: 3px; | |
} | |
fieldset { | |
width: 70%; | |
border: 1px solid #E95420; | |
color: #000000; | |
margin: auto; | |
padding: 10px; | |
margin-top: 10px; | |
} | |
.warning { | |
background: #cd2900; | |
color: white; | |
font-size: 18px; | |
height: 22px; | |
width: 180px; | |
} | |
.start { | |
background: green; | |
color: white; | |
font-size: 18px; | |
height: 22px; | |
width: 180px; | |
} | |
.details { | |
width: 98%; | |
border: none; | |
} | |
.stat { | |
width: 400px; | |
margin: left; | |
} | |
hr { | |
border: 1px dotted #E95420; | |
} | |
fieldset#cert { | |
width: 95%; | |
margin-left: 0; | |
} | |
fieldset#cdp { | |
width: 95%; | |
margin-left: 0; | |
} | |
fieldset#reg { | |
width: 380px; | |
margin: auto; | |
} | |
div#cdpadd { | |
margin-top: 20px; | |
} | |
.login { | |
border: 1px solid #E95420; | |
} | |
#centerLayer { | |
position: absolute; /* Абсолютное позиционирование */ | |
width: 400px; /* Ширина слоя в пикселах */ | |
height: 300px; /* Высота слоя в пикселах */ | |
left: 50%; /* Положение слоя от левого края */ | |
top: 50%; /* Положение слоя от верхнего края */ | |
margin-left: -211px; /* Отступ слева, включает padding и border */ | |
margin-top: -150px; /* Отступ сверху */ | |
background: #fff; /* Цвет фона */ | |
padding: 10px; /* Поля вокруг текста */ | |
overflow: auto; /* Добавление полосы прокрутки */ | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background: #000000; | |
font-family:"Alien Encounters(RUS BY LYAJKA)"; | |
} | |
input { | |
background: #000000; | |
color: #0080ff; | |
font-family:"Alien Encounters(RUS BY LYAJKA)"; | |
border: none; | |
} | |
input#id_organization_name { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_pack_name { | |
width: 100%; | |
height: 37px; | |
font-size: 35px; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_INN { | |
width: 110px; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_OGRN { | |
width: 110px; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_email { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_web { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_address { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_city { | |
width: 110px; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_country { | |
width: 20px; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_name { | |
width: 100%; | |
height: 37px; | |
font-size: 35px; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_id { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_address_pack { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_sn { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_issued_to { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_issued_by { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_imprint { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input#id_url { | |
width: 100%; | |
border: none; | |
border-bottom: 1px dashed #0fad03; | |
} | |
input:invalid { | |
background-color: #330000; | |
} | |
input#submit { | |
border: 1px solid #0fad03; | |
color: #fff; | |
background: #0fad03; | |
font-size: 18px; | |
} | |
input:-webkit-autofill { | |
color: #000000 !important; | |
} | |
input:focus { | |
outline: none; | |
} | |
input[type=number]::-webkit-inner-spin-button, | |
input[type=number]::-webkit-outer-spin-button { | |
-webkit-appearance: none; | |
margin: 0; | |
} | |
select { | |
background: #000000; | |
color: #0080ff; | |
width: 100%; | |
border: none; | |
font-family:"Alien Encounters(RUS BY LYAJKA)"; | |
} | |
select#id_status { | |
width: 160px; | |
margin: left; | |
} | |
select#id_class_es { | |
width: 60px; | |
margin: left; | |
} | |
select#id_vendor { | |
width: 230px; | |
margin: left; | |
} | |
select#id_pack { | |
height: 100%; | |
overflow-y: hidden; | |
} | |
select#id_cdp { | |
height: 100%; | |
overflow-y: hidden; | |
} | |
select:focus{ | |
outline: none; | |
cursor: pointer; | |
} | |
select#id_expiration_date_day { | |
width: 40px; | |
} | |
select#id_expiration_date_month { | |
width: 60px; | |
} | |
select#id_expiration_date_year { | |
width: 60px; | |
} | |
select#id_release_date_day { | |
width: 40px; | |
} | |
select#id_release_date_month { | |
width: 60px; | |
} | |
select#id_release_date_year { | |
width: 60px; | |
} | |
option { | |
background: #000000; | |
color: #0080ff; | |
width: 100%; | |
border: none; | |
font: "Alien Encounters(RUS BY LYAJKA)"; | |
} | |
h1 { | |
font-size: 33px; | |
color: #0fad03; | |
margin: auto; | |
align: center; | |
padding: 20px; | |
} | |
table { | |
width: 95%; | |
border: none; | |
margin: auto; | |
border-collapse: collapse; | |
} | |
table#cas_1 { | |
border: none; | |
} | |
table#cas_2 { | |
border: none; | |
width: 100%; | |
} | |
table#cas_options { | |
width: 100%; | |
border: none; | |
} | |
table#indexlist { | |
border: none; | |
color: white; | |
} | |
table#cdp_list { | |
width: 50%; | |
} | |
th { | |
color: #0fad03; | |
background: #000000; | |
border-bottom: 1px dotted | |
} | |
td { | |
color: #0fad03; | |
background: #000000; | |
border: 1px none #0fad03; | |
padding: 3px; | |
} | |
td#left { | |
text-align: right; | |
width: 220px; | |
border: none; | |
} | |
td#left_k { | |
text-align: right; | |
width: 150px; | |
border: none; | |
} | |
td#left_cr { | |
text-align: right; | |
vertical-align: top; | |
width: 120px; | |
border: none; | |
} | |
td#right { | |
border: none; | |
text-align: left; | |
} | |
td#left_options { | |
border: none; | |
vertical-align: top; | |
} | |
td#right_options { | |
border: none; | |
vertical-align: top; | |
} | |
a { | |
color: white; | |
text-decoration: none; | |
padding: 3px; | |
} | |
fieldset { | |
width: 70%; | |
border: 1px solid #0fad03; | |
color: #0fad03; | |
margin: auto; | |
padding: 10px; | |
margin-top: 10px; | |
} | |
.warning { | |
background: #cd2900; | |
color: white; | |
font-size: 18px; | |
height: 22px; | |
width: 180px; | |
} | |
.start { | |
background: #0fad03; | |
color: white; | |
font-size: 18px; | |
height: 22px; | |
width: 180px; | |
} | |
.details { | |
width: 98%; | |
border: none; | |
} | |
.stat { | |
width: 400px; | |
margin: left; | |
} | |
hr { | |
border: 1px dotted #0fad03; | |
} | |
fieldset#cert { | |
width: 95%; | |
margin-left: 0; | |
} | |
fieldset#cdp { | |
width: 95%; | |
margin-left: 0; | |
} | |
div#cdpadd { | |
margin-top: 20px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend> | |
Регистрационная информация пользователя | |
</legend> | |
<table> | |
<tbody> | |
<tr> | |
<td>Логин:</td> | |
<td>{{ user.username }}</td> | |
</tr> | |
<tr> | |
<td>Имя:</td> | |
<td>{{ user.first_name }}</td> | |
</tr> | |
<tr> | |
<td>Фамилия:</td> | |
<td>{{ user.last_name }}</td> | |
</tr> | |
<tr> | |
<td>Адрес электронной почты:</td> | |
<td>{{ user.email }}</td> | |
</tr> | |
<tr> | |
<td>Дата последнего входа:</td> | |
<td>{{ user.last_login }}</td> | |
</tr> | |
<tr> | |
<td>Дата регистрации:</td> | |
<td>{{ user.date_joined }}</td> | |
</tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
{% load staticfiles %} | |
<link rel="stylesheet" type="text/css" href="{% static 'crlcontrol/style.css' %}" /> | |
<title>{% block title %}CRLCONTROL by OMRA{% endblock %}</title> | |
</head> | |
<body> | |
{% block sidebar %} | |
<div> | |
<table> | |
<tbody> | |
<tr> | |
<td><a href="{% url 'crlcontrol:index' %}"> ▼ Список УЦ</a></td> | |
<td><a href="{% url 'crlcontrol:cas-list'%}"> ▼ Список ПАК</a></td> | |
<td><a href="{% url 'crlcontrol:key-list'%}"> ▼ Список ЭП</a></td> | |
<td><a href="{% url 'crlcontrol:cdp-list'%}"> ▼ Список CDP</a></td> | |
{% if user.id %} | |
<td align="right"> | |
<a href="{% url 'crlcontrol:user' user.pk %}">{{ user.get_username }}</a> | |
<a href="{% url 'logout' %}">Выход</a> | |
</td> | |
{% else %} | |
<td> | |
<a href="{% url 'django.contrib.auth.views.login' %}">Вход</a> | |
</td> | |
{% endif %} | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
{% endblock %} | |
<div id="content"> | |
{% block content %}{% endblock %} | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<h1 align="center">{{ object.pack_name }}</h1> | |
<fieldset> | |
<legend>{{ object.pack_name }}</legend> | |
<table> | |
<tbody> | |
<tr> | |
<td> | |
Класс средств: | |
</td> | |
<td> | |
{{ object.class_es }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
Средства УЦ: | |
</td> | |
<td> | |
{{ object.vendor }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
Адрес: | |
</td> | |
<td> | |
{{ object.address_pack }} | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
<p>Ключи проверки ЭП уполномученных лиц:</p> | |
<fieldset class="details"> | |
<legend> | |
Идентификатор ключа: {{ object.id }} | |
</legend> | |
<p>Сертификаты ключа проверки ЭП:</p> | |
{% for key in object.key.all %} | |
<fieldset class="details"> | |
<table> | |
<tbody> | |
<tr> | |
<td> | |
Кому выдан: | |
</td> | |
<td> | |
{{ key.issued_to }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
Кем выдан: | |
</td> | |
<td> | |
{{ key.issued_by }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
Серийный номер: | |
</td> | |
<td> | |
<a href="{% url 'crlcontrol:key-detail' key.sn %}">{{ key.sn }}</a> | |
</td> | |
</tr> | |
<tr> | |
<td> | |
Действует: | |
</td> | |
<td> | |
c {{ key.release_date }} по {{ key.expiration_date }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
Отпечаток: | |
</td> | |
<td> | |
{{ key.imprint }} | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% empty %} | |
<fieldset> | |
<legend>Записи в БД отсутсвуют</legend> | |
<p>Пусто</p> | |
</fieldset> | |
{% endfor %} | |
</fieldset> | |
<p>Адреса публикации списков анулированных сертификатов:</p> | |
<ul> | |
{% for cdp in object.cdp.all %} | |
<li> | |
<a href="{{ cdp.url }}">{{ cdp.url }}</a> | |
</li> | |
{% empty %} | |
<li>Записи в БД отсутсвуют</li> | |
{% endfor %} | |
</ul> | |
</fieldset> | |
<fieldset> | |
<a class="warning" href="{% url 'crlcontrol:cas-del' object.id %}">✘ Удалить</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<form action="" method="post"> | |
{% csrf_token %} | |
<fieldset> | |
<legend>Вы действительно хотите удалить запись?</legend> | |
<table> | |
<tbody> | |
<tr><td>URL:</td><td>{{ object.url }}</td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
<fieldset> | |
<input class="warning" type="submit" value="✘ Удалить" /> | |
</fieldset> | |
</form> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend> | |
CDP № {{ object.id }} | |
</legend> | |
<table> | |
<tbody> | |
<tr> | |
<td> | |
URL: | |
</td> | |
<td> | |
<a href="{{ object.url }}">{{ object.url }}</a> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
</fieldset> | |
<fieldset> | |
<a class="warning" href="{% url 'crlcontrol:cdp-del' object.id %}">✘ Удалить</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<form action="" method="post"> | |
{% csrf_token %} | |
<fieldset> | |
<legend>URL точки доступа</legend> | |
{{ form.url }} | |
</fieldset> | |
<fieldset> | |
<input type="submit" id="submit" value="✔ Добавить"> | |
</fieldset> | |
</form> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend> | |
Список точек распространения CRL | |
</legend> | |
<table> | |
<tr> | |
<th> | |
№ | |
</th> | |
<th> | |
URL | |
</th> | |
</tr> | |
{% for cdp in object_list %} | |
<tr> | |
<td> | |
{{ cdp.id }} | |
</td> | |
<td> | |
<a href="{% url 'crlcontrol:cdp-detail' cdp.id %}">{{ cdp.url }}</a> | |
</td> | |
</tr> | |
{% empty %} | |
<tr> | |
<td> | |
Записей не найдено | |
</td> | |
</tr> | |
{% endfor %} | |
</table> | |
</fieldset> | |
<fieldset> | |
<a class="start" href="{% url 'crlcontrol:cdp-add'%}">✚ Новая запись</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<h1 align="center">{{ object.name }}</h1> | |
<fieldset> | |
<legend>Общие сведения</legend> | |
<table> | |
<tbody> | |
<tr><td id="left">Статус аккредитации:</td><td id="right">{{ object.status }}</td></tr> | |
<tr><td id="left">Название ЮЛ:</td><td id="right">{{ object.organization_name }}</td></tr> | |
<tr><td id="left">ИНН:</td><td id="right">{{ object.INN }}</td></tr> | |
<tr><td id="left">ОГРН:</td><td id="right">{{ object.OGRN }}</td></tr> | |
<tr><td id="left">Электронная почта:</td><td id="right">{{ object.email }}</td></tr> | |
<tr><td id="left">WEB сайт:</td><td id="right"><a href="{{ object.web }}">{{ object.web }}</a></td></tr> | |
<tr><td id="left">Адрес:</td><td id="right">{{ object.address }}</td></tr> | |
<tr><td id="left">Город:</td><td id="right">{{ object.city }}</td></tr> | |
<tr><td id="left">Страна:</td><td id="right">{{ object.country }}</td></tr> | |
</tbody> | |
</table> | |
<div style="margin-bottom: 15px"> | |
<table class="stat"> | |
<tbody> | |
<tr><td colspan="3">Доступность сервисов * (за последние)</td></tr> | |
<tr><td>Сутки</td><td>Неделя</td><td>Месяц</td></tr> | |
<tr><td>{{ object.stat_day }}</td><td>{{ object.stat_week }}</td><td>{{ object.stat_month }}</td></tr> | |
</tbody> | |
</table> | |
</div> | |
</fieldset> | |
{% for pack in object.pack.all %} | |
<fieldset> | |
<legend> ► <a href="{% url 'crlcontrol:cas-detail' pack.id %}">{{ pack.pack_name }}</a></legend> | |
<div> | |
<table> | |
<tbody> | |
<tr><td id="left">Класс средств:</td><td id="right">{{ pack.class_es }}</td></tr> | |
<tr><td id="left">Средства УЦ:</td><td id="right">{{ pack.vendor }}</td></tr> | |
<tr><td id="left">Адрес:</td><td id="right">{{ pack.address_pack }}</td></tr> | |
</tbody> | |
</table> | |
</div> | |
<hr> | |
<div>Ключи проверки ЭП уполномученных лиц:</div> | |
<fieldset class="details"> | |
<legend>Идентификатор ключа: {{ pack.id }}</legend> | |
<div>Сертификаты ключа проверки ЭП:</div> | |
{% for key in pack.key.all %} | |
<fieldset class="details"> | |
<legend> ► <a href="{% url 'crlcontrol:key-detail' key.sn %}">{{ key.sn }}</a></legend> | |
<table> | |
<tbody> | |
<tr><td id="left_cr">Кому выдан:</td><td id="right">{{ key.issued_to }}</td></tr> | |
<tr><td id="left_cr">Кем выдан:</td><td id="right">{{ key.issued_by }}</td></tr> | |
<tr><td id="left_cr">Действует:</td><td id="right">c {{ key.release_date }} по {{ key.expiration_date }}</td></tr> | |
<tr><td id="left_cr">Отпечаток:</td><td id="right">{{ key.imprint }}</td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% empty %} | |
<fieldset> | |
<legend>Записи в БД отсутсвуют</legend> | |
<div>Пусто</div> | |
</fieldset> | |
{% endfor %} | |
</fieldset> | |
<div id="cdpadd">Адреса публикации списков анулированных сертификатов:</div> | |
<ul> | |
{% for cdp in pack.cdp.all %} | |
<li><a href="{{ cdp.url }}">{{ cdp.url }}</a></li> | |
{% empty %} | |
<li>Записи в БД отсутсвуют</li> | |
{% endfor %} | |
</ul> | |
</fieldset> | |
{% empty %} | |
<fieldset> | |
<legend>Записи в БД отсутсвуют</legend> | |
<div>Пусто</div> | |
</fieldset> | |
{% endfor %} | |
<fieldset> | |
<a class="warning" href="{% url 'crlcontrol:ca-del' object.id %}">✘ Удалить</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend> | |
Реестр удостоверяющих центров | |
</legend> | |
<table id="indexlist"> | |
<tr> | |
<th>Наименование УЦ</th> | |
<th>Город</th> | |
<th>Статус</th> | |
</tr> | |
{% for ca in object_list %} | |
<tr> | |
<td> | |
<a href="{% url 'crlcontrol:detail' ca.id %}">{{ ca.name }}</a> | |
</td> | |
<td> | |
{{ ca.city }} | |
</td> | |
<td> | |
{{ ca.status }} | |
</td> | |
</tr> | |
{% empty %} | |
<tr> | |
<td> | |
Записей не найдено | |
</td> | |
</tr> | |
{% endfor %} | |
</table> | |
</fieldset> | |
<fieldset> | |
<a class="start" href="{% url 'crlcontrol:ca-add' %}">✚ Новая запись</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<form action="" method="post"> | |
{% csrf_token %} | |
<div> | |
<fieldset> | |
<legend>Вы действительно хотите удалить запись?</legend> | |
<table> | |
<tbody> | |
<tr><td>Серийный номер:</td><td>{{ object.sn }}</td></tr> | |
<tr><td>Кому выдан:</td><td>{{ object.issued_to }}</td></tr> | |
<tr><td>Кем выдан:</td><td>{{ object.issued_by }}</td></tr> | |
<tr><td>Действителен с:</td><td>{{ object.release_date }}</td></tr> | |
<tr><td>Действителен по:</td><td>{{ object.expiration_date }}</td></tr> | |
<tr><td>Отпечаток:</td><td>{{ object.imprint }}</td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
</div> | |
<fieldset> | |
<input type="submit" class="warning" value="✘ Удалить"/> | |
</fieldset> | |
</form> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<h1 align="center">Ключ проверки ЭП уполномоченных лиц:</h1> | |
<fieldset> | |
<legend>Сертификат ключа проверки ЭП</legend> | |
<table> | |
<tbody> | |
<tr><td>Кому выдан: </td><td>{{ object.issued_to }}</td></tr> | |
<tr><td>Кем выдан: </td><td>{{ object.issued_by }}</td></tr> | |
<tr><td>Серийный номер: </td><td>{{ object.sn }}</td></tr> | |
<tr><td>Действует: </td><td>c {{ object.release_date }} по {{ object.expiration_date }}</td></tr> | |
<tr><td>Отпечаток: </td><td>{{ object.imprint }}</td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
<fieldset> | |
<a class="warning" href="{% url 'crlcontrol:key-del' object.sn %}">✘ Удалить запись</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<form action="" method="post">{% csrf_token %} | |
<fieldset> | |
<table id="cas_1"> | |
<tbody> | |
<tr><td id="left_k">Кому выдан:</td><td id="right">{{ form.issued_to }}</td></tr> | |
<tr><td id="left_k">Кем выдан:</td><td id="right">{{ form.issued_by }}</td></tr> | |
<tr><td id="left_k">Серийный номер:</td><td id="right">{{ form.sn }}</td></tr> | |
<tr><td id="left_k">Действует:</td><td id="right">c {{ form.release_date }} по {{ form.expiration_date }}</td></tr> | |
<tr><td id="left_k">Отпечаток:</td><td id="right">{{ form.imprint }}</td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
<fieldset> | |
<div> | |
<input type="submit" id="submit" value="✔ Сохранить"> | |
</div> | |
</fieldset> | |
</form> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend> | |
Список ключей ЭП уполномоченных лиц УЦ | |
</legend> | |
<table> | |
<tr> | |
<th> | |
Серийный номер | |
</th> | |
<th> | |
Кому выдан | |
</th> | |
<th> | |
Дата окончания | |
</th> | |
</tr> | |
{% for key in object_list %} | |
<tr> | |
<td> | |
<a href="{% url 'crlcontrol:key-detail' key.sn %}">{{ key.sn }}</a> | |
</td> | |
<td> | |
{{ key.issued_to }} | |
</td> | |
<td> | |
{{ key.expiration_date }} | |
</td> | |
</tr> | |
{% empty %} | |
<tr> | |
<td> | |
Записей не найдено | |
</td> | |
</tr> | |
{% endfor %} | |
</table> | |
</fieldset> | |
<fieldset> | |
<a class="start" href="{% url 'crlcontrol:key-add' %}">✚ Новая запись</a> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend>Новая запись</legend> | |
<div>Новый Удостоверящий Центр добавлен</div> | |
<table> | |
<tbody> | |
<tr><td><a href="{% url 'crlcontrol:index' %}">Все УЦ</a></td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend>Новая запись</legend> | |
<div>Новый ПАК добавлен</div> | |
<table> | |
<tbody> | |
<tr><td><a href="{% url 'crlcontrol:cas-list' %}">Все УЦ</a></td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend>Новая запись</legend> | |
<div>Новая CDP добавлена</div> | |
<table> | |
<tbody> | |
<tr><td><a href="{% url 'crlcontrol:cdp-list' %}">Все CDP</a></td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<fieldset> | |
<legend>Новая запись</legend> | |
<div>Новый ключ проверки ЭП добавлен</div> | |
<table> | |
<tbody> | |
<tr><td><a href="{% url 'crlcontrol:key-list' %}">Все УЦ</a></td></tr> | |
</tbody> | |
</table> | |
</fieldset> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru" > | |
<head> | |
<meta charset="UTF-8"> | |
<title>CA Site</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> | |
<style> | |
/* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ | |
@import url(https://fonts.googleapis.com/css?family=Open+Sans); | |
.btn { display: inline-block; *display: inline; *zoom: 1; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; color: #333333; text-align: center;text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); vertical-align: middle; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(top, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffffff, endColorstr=#e6e6e6, GradientType=0); border-color: #e6e6e6 #e6e6e6 #e6e6e6; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); border: 1px solid #e6e6e6; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); cursor: pointer; *margin-left: .3em; } | |
.btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { background-color: #e6e6e6; } | |
.btn-large { padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } | |
.btn:hover { color: #333333; text-decoration: none; background-color: #e6e6e6; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; } | |
.btn-primary, .btn-primary:hover { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); color: #ffffff; } | |
.btn-primary.active { color: rgba(255, 255, 255, 0.75); } | |
.btn-primary { background-color: #4a77d4; background-image: -moz-linear-gradient(top, #6eb6de, #4a77d4); background-image: -ms-linear-gradient(top, #6eb6de, #4a77d4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#6eb6de), to(#4a77d4)); background-image: -webkit-linear-gradient(top, #6eb6de, #4a77d4); background-image: -o-linear-gradient(top, #6eb6de, #4a77d4); background-image: linear-gradient(top, #6eb6de, #4a77d4); background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#6eb6de, endColorstr=#4a77d4, GradientType=0); border: 1px solid #3762bc; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.5); } | |
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { filter: none; background-color: #4a77d4; } | |
.btn-block { width: 100%; display:block; } | |
* { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -ms-box-sizing:border-box; -o-box-sizing:border-box; box-sizing:border-box; } | |
html { width: 100%; height:100%; overflow:hidden; } | |
body { | |
width: 100%; | |
height:100%; | |
font-family: 'Open Sans', sans-serif; | |
background: #092756; | |
background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%),-moz-linear-gradient(top, rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), -moz-linear-gradient(-45deg, #670d10 0%, #092756 100%); | |
background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -webkit-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -webkit-linear-gradient(-45deg, #670d10 0%,#092756 100%); | |
background: -o-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -o-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -o-linear-gradient(-45deg, #670d10 0%,#092756 100%); | |
background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -ms-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -ms-linear-gradient(-45deg, #670d10 0%,#092756 100%); | |
background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), linear-gradient(to bottom, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), linear-gradient(135deg, #670d10 0%,#092756 100%); | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3E1D6D', endColorstr='#092756',GradientType=1 ); | |
} | |
.login { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin: -150px 0 0 -150px; | |
width:300px; | |
height:300px; | |
} | |
.login h1 { color: #fff; text-shadow: 0 0 10px rgba(0,0,0,0.3); letter-spacing:1px; text-align:center; } | |
input { | |
width: 100%; | |
margin-bottom: 10px; | |
background: rgba(0,0,0,0.3); | |
border: none; | |
outline: none; | |
padding: 10px; | |
font-size: 13px; | |
color: #fff; | |
text-shadow: 1px 1px 1px rgba(0,0,0,0.3); | |
border: 1px solid rgba(0,0,0,0.3); | |
border-radius: 4px; | |
box-shadow: inset 0 -5px 45px rgba(100,100,100,0.2), 0 1px 1px rgba(255,255,255,0.2); | |
-webkit-transition: box-shadow .5s ease; | |
-moz-transition: box-shadow .5s ease; | |
-o-transition: box-shadow .5s ease; | |
-ms-transition: box-shadow .5s ease; | |
transition: box-shadow .5s ease; | |
} | |
input:focus { box-shadow: inset 0 -5px 45px rgba(100,100,100,0.4), 0 1px 1px rgba(255,255,255,0.2); } | |
</style> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script> | |
</head> | |
<body> | |
<div class="login"> | |
<h1>ॐ</h1> | |
<form method="post" action="{% url 'django.contrib.auth.views.login' %}"> | |
{% csrf_token %} | |
<input type="text" name="username" placeholder="Имя пользователя" required="required" /> | |
<input type="password" name="password" placeholder="Пароль" required="required" /> | |
<button type="submit" class="btn btn-primary btn-block btn-large">Авторизоваться</button> | |
<input type="hidden" name="next" value="{{ next }}" /> | |
</form> | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
{% load staticfiles %} | |
<link rel="stylesheet" type="text/css" href="{% static 'crlcontrol/style.css' %}" /> | |
<title>{% block title %}CRLCONTROL by OMRA{% endblock %}</title> | |
</head> | |
<body> | |
<div id="centerLayer"> | |
{% if form.errors %} | |
<fieldset> | |
Имя пользователя и пароль не распознаны. Попробуйте еще раз. | |
</fieldset> | |
{% endif %} | |
{% if next %} | |
{% if user.is_authenticated %} | |
<fieldset> | |
У ваша учётной записи нет доступа к этой странице. Что бы продолжить войдите под другой учёткой. | |
</fieldset> | |
{% else %} | |
<fieldset> | |
Войдите в учётку для просмотра этой страницы. | |
</fieldset> | |
{% endif %} | |
{% endif %} | |
<form action="{% url 'django.contrib.auth.views.login' %}" method="post"> | |
{% csrf_token %} | |
<fieldset id="reg"> | |
<table class="reg"> | |
<tbody> | |
<tr> | |
<td> | |
{{ form.username.label_tag }} | |
</td> | |
<td> | |
{{ form.username }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
{{ form.password.label_tag }} | |
</td> | |
<td> | |
{{ form.password }} | |
</td> | |
</tr> | |
<tr> | |
<td> | |
<a href="{% url 'password-reset' %}">Забыли пароль?</a> | |
</td> | |
<td> | |
<input id="submit" type="submit" value="✔ Войти" /> | |
<input type="hidden" name="next" value="{{ next }}" /> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
< | |
</fieldset> | |
</form> | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
# Create your tests here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import url | |
from . import views | |
app_name = 'crlcontrol' | |
urlpatterns = [ | |
url(r'^$', views.IndexView.as_view(), name='index'), | |
url(r'^(?P<pk>[0-9]+)/$', views.DetailCaView.as_view(), name='detail'), | |
url(r'^(?P<pk>[0-9]+)/del/$', views.CaDel.as_view(), name='ca-del'), | |
url(r'^add/$', views.CaAdd.as_view(), name='ca-add'), | |
url(r'^add/cas/$', views.CasAdd.as_view(), name='cas-add'), | |
url(r'^add/cas/new/$', views.NewCasView.as_view(), name='cas-new'), | |
url(r'^add/key/$', views.KeyAdd.as_view(), name='key-add'), | |
url(r'^add/key/new/$', views.NewKeyView.as_view(), name='key-new'), | |
url(r'^add/cdp/$', views.CdpAdd.as_view(), name='cdp-add'), | |
url(r'^add/cdp/new/$', views.NewCdpView.as_view(), name='cdp-new'), | |
url(r'^cas/$', views.CasList.as_view(), name='cas-list'), | |
url(r'^cas/(?P<pk>[0-9A-Za-z]+)/$', views.CasDetail.as_view(), name='cas-detail'), | |
url(r'^cas/(?P<pk>[0-9A-Za-z]+)/del/$', views.CasDel.as_view(), name='cas-del'), | |
url(r'^key/$', views.KeyList.as_view(),name='key-list'), | |
url(r'^key/(?P<pk>[0-9A-Za-z]+)/$', views.KeyDetail.as_view(), name='key-detail'), | |
url(r'^key/(?P<pk>[0-9A-Za-z]+)/del/$', views.KeyDel.as_view(), name='key-del'), | |
url(r'^add/new/$', views.NewCaView.as_view(), name='ca-new'), | |
url(r'^cdp/$', views.CdpList.as_view(), name='cdp-list'), | |
url(r'^cdp/(?P<pk>[0-9A-Za-z]+)/$', views.CdpDetail.as_view(), name='cdp-detail'), | |
url(r'^cdp/(?P<pk>[0-9A-Za-z]+)/del/$', views.CdpDel.as_view(), name='cdp-del'), | |
url(r'^user/(?P<pk>[0-9]+)/$', views.UserView.as_view(), name='user') | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.decorators import login_required | |
from django.contrib.auth.mixins import AccessMixin, LoginRequiredMixin | |
from django.contrib.auth.models import User | |
from django.core.urlresolvers import reverse_lazy | |
from django.http import HttpResponse, HttpResponseRedirect | |
from django.shortcuts import render | |
from django.utils import timezone | |
from django.views.generic import ListView, DetailView, CreateView, DeleteView | |
from django.views.generic.base import View, TemplateView | |
from .models import * | |
from .forms import * | |
class IndexView(LoginRequiredMixin, ListView): | |
model = Certification_Authority | |
template_name = 'crlcontrol/index.html' | |
def get_context_data(self, **kwargs): | |
context = super(IndexView, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class DetailCaView(LoginRequiredMixin, DetailView): | |
model = Certification_Authority | |
template_name = 'crlcontrol/detail.html' | |
def get_context_data(self, **kwargs): | |
context = super(DetailCaView, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class CaAdd(LoginRequiredMixin, CreateView): | |
model = Certification_Authority | |
pack = Certification_Authority_System | |
fields = '__all__' | |
form_class = CaForm | |
template_name = 'crlcontrol/certification_authority_form.html' | |
initial = {'key': 'value'} | |
def post(self, request, *args, **kwargs): | |
form = self.form_class(request.POST) | |
data = request.POST | |
if self.form_valid: | |
new_ca = self.model.objects.create(name=data['name'], | |
organization_name=data['organization_name'], | |
INN=data['INN'], | |
OGRN=data['OGRN'], | |
email=data['email'], | |
web=data['web'], | |
address=data['address'], | |
city=data['city'], | |
country=data['country'], | |
status=data['status'], | |
) | |
pack = data.getlist('pack') | |
new_ca.pack.set(pack) | |
return HttpResponseRedirect('new/') | |
else: | |
print(request.POST) | |
return render(request, self.template_name, {'form': form}) | |
def get(self, request, *arg, **kwargs): | |
form = self.form_class(initial=self.initial) | |
return render(request, self.template_name, {'form': form}) | |
class CasAdd(LoginRequiredMixin, CreateView): | |
model = Certification_Authority_System | |
fields = '__all__' | |
form_class = CasForm | |
template_name = 'crlcontrol/certification_authority_system_form.html' | |
initial = {'key': 'value'} | |
def post(self, request, *args, **kwargs): | |
form = self.form_class(request.POST) | |
data = request.POST | |
if self.form_valid: | |
new_cas = self.model.objects.create(id=data['id'], | |
pack_name=data['pack_name'], | |
class_es=data['class_es'], | |
vendor=data['vendor'], | |
address_pack=data['address_pack'], | |
) | |
key = data.getlist('key') | |
new_cas.key.set(key) | |
cdp = data.getlist('cdp') | |
new_cas.cdp.set(cdp) | |
return HttpResponseRedirect('new/') | |
else: | |
print(request.POST) | |
return render(request, self.template_name, {'form': form}) | |
def get(self, request, *arg, **kwargs): | |
form = self.form_class(initial=self.initial) | |
return render(request, self.template_name, {'form': form}) | |
class NewCasView(LoginRequiredMixin, TemplateView): | |
template_name = "crlcontrol/newcas.html" | |
def get_context_data(self, **kwargs): | |
context = super(NewCasView, self).get_context_data(**kwargs) | |
return context | |
class NewCaView(LoginRequiredMixin, TemplateView): | |
template_name = "crlcontrol/newca.html" | |
def get_context_data(self, **kwargs): | |
context = super(NewCaView, self).get_context_data(**kwargs) | |
return context | |
class NewKeyView(LoginRequiredMixin, TemplateView): | |
template_name = "crlcontrol/newkey.html" | |
def get_context_data(self, **kwargs): | |
context = super(NewKeyView, self).get_context_data(**kwargs) | |
return context | |
class NewCdpView(LoginRequiredMixin, TemplateView): | |
template_name = "crlcontrol/newcdp.html" | |
def get_context_data(self, **kwargs): | |
context = super(NewCdpView, self).get_context_data(**kwargs) | |
return context | |
class KeyAdd(LoginRequiredMixin, CreateView): | |
model = Keys_for_checking | |
fields = '__all__' | |
form_class = KeyForm | |
template_name = 'crlcontrol/keys_for_checking_form.html' | |
initial = {'key': 'value'} | |
def post(self, request, *args, **kwargs): | |
form = self.form_class(request.POST) | |
data = request.POST.copy() | |
if self.form_valid: | |
release_data = data.pop('release_date') | |
release_data_year = release_data[2] | |
if len(release_data[1]) == 1: release_data_month = '0'+release_data[1] | |
elif len(release_data[1]) == 2: release_data_month = release_data[1] | |
if len(release_data[0]) == 1: release_data_day = '0'+release_data[0] | |
elif len(release_data[0]) == 2: release_data_day = release_data[0] | |
release_data_format = release_data_year + '-' + release_data_month + '-' +release_data_day | |
expiration_date = data.pop('expiration_date') | |
expiration_date_year = expiration_date[2] | |
if len(expiration_date[1]) == 1: expiration_date_month = '0' + expiration_date[1] | |
elif len(expiration_date[1]) == 2: expiration_date_month = expiration_date[1] | |
if len(expiration_date[0]) == 1: expiration_date_day = '0' + expiration_date[0] | |
elif len(expiration_date[0]) == 2: expiration_date_day = expiration_date[0] | |
expiration_date_format = expiration_date_year + '-' + expiration_date_month + '-' + expiration_date_day | |
new_key = self.model.objects.create(issued_to=data['issued_to'], | |
issued_by=data['issued_by'], | |
sn=data['sn'], | |
release_date=release_data_format, | |
expiration_date=expiration_date_format, | |
imprint=data['imprint']) | |
return HttpResponseRedirect('new/') | |
else: | |
print(request.POST) | |
return render(request, self.template_name, {'form': form}) | |
def get(self, request, *arg, **kwargs): | |
form = self.form_class(initial=self.initial) | |
return render(request, self.template_name, {'form': form}) | |
class CdpAdd(LoginRequiredMixin, CreateView): | |
model = Cdp | |
fields = '__all__' | |
form_class = CdpForm | |
template_name = 'crlcontrol/cdp_form.html' | |
initial = {'key': 'value'} | |
def post(self, request, *args, **kwargs): | |
form = self.form_class(request.POST) | |
data = request.POST | |
if self.form_valid: | |
new_cdp = self.model.objects.create(url=data['url']) | |
return HttpResponseRedirect('new/') | |
else: | |
print(request.POST) | |
return render(request, self.template_name, {'form': form}) | |
def get(self, request, *arg, **kwargs): | |
form = self.form_class(initial=self.initial) | |
return render(request, self.template_name, {'form': form}) | |
class CaDel(LoginRequiredMixin, DeleteView): | |
model = Certification_Authority | |
success_url = reverse_lazy('crlcontrol:index') | |
class CasDel(LoginRequiredMixin, DeleteView): | |
model = Certification_Authority_System | |
success_url = reverse_lazy('crlcontrol:cas-list') | |
class CdpDel(LoginRequiredMixin, DeleteView): | |
model = Cdp | |
success_url = reverse_lazy('crlcontrol:cdp-list') | |
class KeyDel(LoginRequiredMixin, DeleteView): | |
model = Keys_for_checking | |
success_url = reverse_lazy('crlcontrol:key-list') | |
class CasList(LoginRequiredMixin, ListView): | |
model = Certification_Authority_System | |
def get_context_data(self, **kwargs): | |
context = super(CasList, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class CasDetail(LoginRequiredMixin, DetailView): | |
model = Certification_Authority_System | |
template_name = 'crlcontrol/casdetail.html' | |
def get_context_data(self, **kwargs): | |
context = super(CasDetail, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class KeyList(LoginRequiredMixin, ListView): | |
model = Keys_for_checking | |
def get_context_data(self, **kwargs): | |
context = super(KeyList, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class KeyDetail(LoginRequiredMixin, DetailView): | |
model = Keys_for_checking | |
def get_context_data(self, **kwargs): | |
context = super(KeyDetail, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class CdpList(LoginRequiredMixin, ListView): | |
model = Cdp | |
def get_context_data(self, **kwargs): | |
context = super(CdpList, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class CdpDetail(LoginRequiredMixin, DetailView): | |
model = Cdp | |
def get_context_data(self, **kwargs): | |
context = super(CdpDetail, self).get_context_data(**kwargs) | |
context['now'] = timezone.now() | |
return context | |
class UserView(LoginRequiredMixin, DetailView): | |
model = User |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
if __name__ == "__main__": | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "casite.settings") | |
from django.core.management import execute_from_command_line | |
execute_from_command_line(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment