Commit 2038fdda authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Fix the broken import paths

parent db04b3d1
import logging
from django.contrib.auth import logout
from django.contrib.auth.models import Group
from django.shortcuts import get_object_or_404
from django.contrib.auth import logout
from rest_framework import status
from rest_framework import views
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework import status
from . import serializers
from .. import models, serializers as model_serializers
from ..models import models
from ..models.serializers import webpage as serializers, serializers as model_serializers
LOGGER = logging.getLogger(__name__)
......
from django.conf.urls import url
from . import views
from . import webpage as views
URLPATTERNS = [
url(r'^state', views.StateView.as_view()),
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-15 13:10
from __future__ import unicode_literals
import datetime
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('user_type', models.CharField(choices=[('apiclient', 'API-Client'), ('oidcuser', 'OIDC User'), ('admin', 'Admin')], default='oidcuser', max_length=20)),
('sub', models.CharField(blank=True, max_length=150, null=True)),
('password', models.CharField(blank=True, max_length=150, null=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'abstract': False,
'verbose_name_plural': 'users',
'verbose_name': 'user',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Deployment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('last_change', models.DateTimeField(default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=utc), editable=False)),
],
),
migrations.CreateModel(
name='Service',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True)),
('description', models.TextField(blank=True, max_length=300)),
('groups', models.ManyToManyField(blank=True, related_name='services', to='auth.Group')),
],
),
migrations.CreateModel(
name='Site',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True)),
('description', models.TextField(blank=True, max_length=300)),
('last_fetch', models.DateTimeField(default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=utc), editable=False)),
('client', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='site', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='SSHPublicKey',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True)),
('key', models.TextField(max_length=1000)),
('deleted', models.BooleanField(default=False, editable=False)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='_ssh_keys', to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='service',
name='site',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='services', to='backend.Site'),
),
migrations.AddField(
model_name='deployment',
name='service',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to='backend.Service'),
),
migrations.AddField(
model_name='deployment',
name='ssh_keys',
field=models.ManyToManyField(blank=True, related_name='deployments', to='backend.SSHPublicKey'),
),
migrations.AddField(
model_name='deployment',
name='ssh_keys_to_withdraw',
field=models.ManyToManyField(blank=True, related_name='withdrawn_deployments', to='backend.SSHPublicKey'),
),
migrations.AddField(
model_name='deployment',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to=settings.AUTH_USER_MODEL),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-15 15:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='service',
name='site',
),
migrations.AddField(
model_name='service',
name='site',
field=models.ManyToManyField(related_name='services', to='backend.Site'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-18 15:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0002_auto_20171215_1519'),
]
operations = [
migrations.AddField(
model_name='deployment',
name='site_saw_change',
field=models.BooleanField(default=False, editable=False),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-19 12:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0003_deployment_site_saw_change'),
]
operations = [
migrations.CreateModel(
name='DeploymentUpdate',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.RemoveField(
model_name='deployment',
name='site_saw_change',
),
migrations.RemoveField(
model_name='site',
name='last_fetch',
),
migrations.AddField(
model_name='deploymentupdate',
name='deployment',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployment_updates', to='backend.Deployment'),
),
migrations.AddField(
model_name='deploymentupdate',
name='site',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployment_updates', to='backend.Site'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-19 15:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_auto_20171219_1210'),
]
operations = [
migrations.CreateModel(
name='OIDCConfig',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('client_id', models.CharField(max_length=200)),
('client_secret', models.CharField(max_length=200)),
('redirect_uri', models.CharField(max_length=200)),
('issuer_uri', models.CharField(max_length=200)),
],
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-22 15:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0005_oidcconfig'),
]
operations = [
migrations.AddField(
model_name='oidcconfig',
name='enabled',
field=models.BooleanField(default=True),
preserve_default=False,
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-22 16:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0006_oidcconfig_enabled'),
]
operations = [
migrations.AlterField(
model_name='oidcconfig',
name='enabled',
field=models.BooleanField(default=False),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-22 13:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0007_auto_20180122_1658'),
]
operations = [
migrations.CreateModel(
name='RabbitMQInstance',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('host', models.CharField(default='localhost', max_length=150)),
('exchange', models.CharField(default='deployments', max_length=150)),
('port', models.IntegerField(default=15672)),
('path', models.CharField(default='api', max_length=150)),
('username', models.CharField(default='guest', max_length=150)),
('password', models.CharField(default='guest', max_length=150)),
],
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-22 13:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0008_rabbitmqinstance'),
]
operations = [
migrations.AddField(
model_name='rabbitmqinstance',
name='enabled',
field=models.BooleanField(default=False),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-26 12:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0009_rabbitmqinstance_enabled'),
]
operations = [
migrations.CreateModel(
name='Deploy',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deployment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deploys', to='backend.Deployment')),
('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deploys', to='backend.SSHPublicKey')),
('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deploys', to='backend.Site')),
],
),
migrations.CreateModel(
name='Withdrawal',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deployment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='withdrawals', to='backend.Deployment')),
('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='withdrawals', to='backend.SSHPublicKey')),
('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Withdrawals', to='backend.Site')),
],
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-27 10:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0010_deploy_withdrawal'),
]
operations = [
migrations.CreateModel(
name='DeploymentTaskItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('action', models.CharField(choices=[('deploy', 'deploy'), ('withdraw', 'withdraw')], max_length=10)),
('deployment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployment_task_items', to='backend.Deployment')),
('key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployment_task_items', to='backend.SSHPublicKey')),
('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployment_task_items', to='backend.Site')),
],
),
migrations.RemoveField(
model_name='deploy',
name='deployment',
),
migrations.RemoveField(
model_name='deploy',
name='key',
),
migrations.RemoveField(
model_name='deploy',
name='site',
),
migrations.RemoveField(
model_name='deploymentupdate',
name='deployment',
),
migrations.RemoveField(
model_name='deploymentupdate',
name='site',
),
migrations.RemoveField(
model_name='withdrawal',
name='deployment',
),
migrations.RemoveField(
model_name='withdrawal',
name='key',
),
migrations.RemoveField(
model_name='withdrawal',
name='site',
),
migrations.DeleteModel(
name='Deploy',
),
migrations.DeleteModel(
name='DeploymentUpdate',
),
migrations.DeleteModel(
name='Withdrawal',
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-27 16:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0011_auto_20180227_1053'),
]
operations = [
migrations.CreateModel(
name='DeploymentTask',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('action', models.CharField(choices=[('deploy', 'deploy'), ('withdraw', 'withdraw')], max_length=10)),
],
),
migrations.RemoveField(
model_name='deployment',
name='last_change',
),
migrations.RemoveField(
model_name='deploymenttaskitem',
name='action',
),
migrations.RemoveField(
model_name='deploymenttaskitem',
name='deployment',
),
migrations.RemoveField(
model_name='deploymenttaskitem',
name='key',
),
migrations.AlterField(
model_name='deploymenttaskitem',
name='site',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_items', to='backend.Site'),
),
migrations.AddField(
model_name='deploymenttask',
name='deployment',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_items', to='backend.Deployment'),
),
migrations.AddField(
model_name='deploymenttask',
name='key',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_items', to='backend.SSHPublicKey'),
),
migrations.AddField(
model_name='deploymenttaskitem',
name='task',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='task_items', to='backend.DeploymentTask'),
preserve_default=False,
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-28 14:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0012_auto_20180227_1601'),
]
operations = [
migrations.AddField(
model_name='deployment',
name='disabled',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='deploymenttask',
name='deployment',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='backend.Deployment'),
),
migrations.AlterField(
model_name='deploymenttask',
name='key',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='backend.SSHPublicKey'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-28 14:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0013_auto_20180228_1418'),
]
operations = [
migrations.RemoveField(
model_name='deployment',
name='disabled',
),
migrations.AddField(
model_name='deployment',
name='is_active',
field=models.BooleanField(default=True),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-28 15:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0014_auto_20180228_1435'),
]
operations = [
migrations.RemoveField(