Compare commits

..

1 Commits

Author SHA1 Message Date
0948519267 Merge pull request 'fix' (#2) from master into prod
Reviewed-on: #2
2024-10-11 16:25:12 +03:00
29 changed files with 62 additions and 461 deletions

View File

@@ -6,17 +6,16 @@ services:
platform-nginx:
image: mathwave/sprint-repo:platform
networks:
- common-infra-nginx-development
- configurator-development
- postgres-development
- minio-development
- common-infra-nginx
environment:
DB_HOST: "postgres"
DB_HOST: "pg.develop.sprinthub.ru"
DB_PASSWORD: $DB_PASSWORD_DEV
MINIO_HOST: "minio"
MINIO_HOST: "minio.develop.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
REDIS_HOST: "redis.dev.chocomarsh.com"
REDIS_HOST: "redis.develop.sprinthub.ru"
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
RABBITMQ_HOST: "rabbitmq.develop.sprinthub.ru"
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_DEV
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
@@ -37,16 +36,15 @@ services:
fetch_stats:
image: mathwave/sprint-repo:platform
networks:
- postgres-development
- minio-development
environment:
DB_HOST: "postgres"
DB_HOST: "pg.develop.sprinthub.ru"
DB_PASSWORD: $DB_PASSWORD_DEV
MINIO_HOST: "minio"
MINIO_HOST: "minio.develop.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
REDIS_HOST: "redis.dev.chocomarsh.com"
REDIS_HOST: "redis.develop.sprinthub.ru"
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
RABBITMQ_HOST: "rabbitmq.develop.sprinthub.ru"
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_DEV
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
@@ -61,19 +59,11 @@ services:
migrate:
image: mathwave/sprint-repo:platform
networks:
- postgres-development
- minio-development
environment:
DB_HOST: "postgres"
DB_HOST: "pg.develop.sprinthub.ru"
DB_PASSWORD: $DB_PASSWORD_DEV
MINIO_HOST: "minio"
MINIO_HOST: "minio.develop.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
REDIS_HOST: "redis.dev.chocomarsh.com"
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
command: migrate
deploy:
mode: replicated
@@ -84,11 +74,5 @@ services:
order: start-first
networks:
common-infra-nginx-development:
external: true
configurator-development:
external: true
postgres-development:
external: true
minio-development:
external: true
common-infra-nginx:
external: true

View File

@@ -7,20 +7,18 @@ services:
image: mathwave/sprint-repo:platform
networks:
- common-infra-nginx
- configurator
- postgres
- minio
environment:
DB_HOST: "postgres"
DB_HOST: "pg.sprinthub.ru"
DB_PASSWORD: $DB_PASSWORD_PROD
MINIO_HOST: "minio"
MINIO_HOST: "minio.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
REDIS_HOST: "redis.chocomarsh.com"
REDIS_HOST: "redis.sprinthub.ru"
REDIS_PASSWORD: $REDIS_PASSWORD_PROD
RABBITMQ_HOST: "rabbitmq.chocomarsh.com"
RABBITMQ_HOST: "rabbitmq.sprinthub.ru"
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_PROD
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
command: runserver 0.0.0.0:1238
healthcheck:
@@ -33,23 +31,24 @@ services:
mode: replicated
restart_policy:
condition: any
placement:
constraints:
- node.role == worker
- node.labels.zone == ru
update_config:
parallelism: 1
order: start-first
fetch_stats:
image: mathwave/sprint-repo:platform
networks:
- postgres
- minio
environment:
DB_HOST: "postgres"
DB_HOST: "pg.sprinthub.ru"
DB_PASSWORD: $DB_PASSWORD_PROD
MINIO_HOST: "minio"
MINIO_HOST: "minio.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
REDIS_HOST: "redis.chocomarsh.com"
REDIS_HOST: "redis.sprinthub.ru"
REDIS_PASSWORD: $REDIS_PASSWORD_PROD
RABBITMQ_HOST: "rabbitmq.chocomarsh.com"
RABBITMQ_HOST: "rabbitmq.sprinthub.ru"
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_PROD
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
@@ -65,14 +64,12 @@ services:
migrate:
image: mathwave/sprint-repo:platform
networks:
- postgres
- minio
environment:
DB_HOST: "postgres"
DB_HOST: "pg.sprinthub.ru"
DB_PASSWORD: $DB_PASSWORD_PROD
MINIO_HOST: "minio"
MINIO_HOST: "minio.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO _SECRET_KEY_PROD
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
command: migrate
deploy:
mode: replicated
@@ -85,9 +82,3 @@ services:
networks:
common-infra-nginx:
external: true
configurator:
external: true
postgres:
external: true
minio:
external: true

View File

@@ -28,7 +28,7 @@ jobs:
run: docker push mathwave/sprint-repo:platform
deploy-dev:
name: Deploy dev
runs-on: [prod]
runs-on: [dev]
needs: push
steps:
- name: login
@@ -46,4 +46,4 @@ jobs:
RABBITMQ_PASSWORD: ${{ secrets.RABBITMQ_PASSWORD_DEV }}
VK_SERVICE_TOKEN: ${{ secrets.VK_SERVICE_TOKEN }}
YANDEX_SERVICE_TOKEN: ${{ secrets.YANDEX_SERVICE_TOKEN }}
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml platform-development
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml platform

View File

@@ -1,58 +0,0 @@
from requests import get, put, post, delete
from json import dumps
URL_CONFIGS = 'http://configurator/api/v1/configs'
URL_EXPERIMENTS = 'http://configurator/api/v1/experiments'
def get_configs(project, stage):
response = get(URL_CONFIGS, params={'project': project, 'stage': stage})
if response.status_code != 200:
return []
data = response.json()
for config in data:
config['value_pretty'] = dumps(config['value'], indent=4, ensure_ascii=False)
return data
def create_config(project, stage, name):
post(URL_CONFIGS, json={'project': project, 'stage': stage, 'name': name})
def update_config(id, value):
put(URL_CONFIGS, json={'id': id, 'value': value})
def delete_config(id):
delete(URL_CONFIGS, json={'id': id})
def get_experiments(project, stage):
response = get(URL_EXPERIMENTS, params={'project': project, 'stage': stage})
if response.status_code != 200:
return []
data = response.json()
for exp in data:
if exp['condition'] == 'False':
exp['exp_type'] = 0
elif exp['condition'] == 'user.is_superuser':
exp['exp_type'] = 1
elif exp['condition'] == 'user.platform_staff':
exp['exp_type'] = 2
elif exp['condition'] == 'True':
exp['exp_type'] = 3
else:
exp['exp_type'] = 4
return data
def create_experiment(project, stage, name):
post(URL_EXPERIMENTS, json={'project': project, 'stage': stage, 'name': name})
def update_experiment(id, enabled, condition):
put(URL_EXPERIMENTS, json={'id': id, 'enabled': enabled, 'condition': condition})
def delete_experiment(id):
delete(URL_CONFIGS, json={'id': id})

View File

@@ -48,8 +48,7 @@ INSTALLED_APPS = [
'web.apps.WebConfig',
'configs.apps.ConfigsConfig',
'experiments.apps.ExperimentsConfig',
'stats.apps.StatsConfig',
'schemas.apps.SchemasConfig',
'stats.apps.StatsConfig'
]
MIDDLEWARE = [

View File

@@ -21,6 +21,5 @@ urlpatterns = [
path('configs/', include('configs.urls')),
path('experiments/', include('experiments.urls')),
path('stats/', include('stats.urls')),
path('schemas/', include('schemas.urls')),
path('', include('web.urls'))
]

View File

@@ -3,7 +3,6 @@ from json import loads
from django.http import HttpResponse, JsonResponse
from BaseLib.BaseView import BaseView
from BaseLib.configurator import *
from Platform import settings
from configs.models import Config
@@ -21,35 +20,31 @@ class ConfigsView(BaseView):
return '/configs/?stage=production'
self.stage = self.request.GET['stage']
self.context['stage'] = self.stage
# self.context['configs'] = Config.objects.filter(project=self.request.user.selected_project,
# stage=self.stage).order_by('name')
self.context['configs'] = get_configs(self.request.user.selected_project.name, self.stage)
self.context['configs'] = Config.objects.filter(project=self.request.user.selected_project,
stage=self.stage).order_by('name')
def post_create_config(self):
create_config(self.request.user.selected_project.name, self.stage, self.request.POST['name'])
# Config.objects.create(name=self.request.POST['name'], project=self.request.user.selected_project, stage=self.stage)
Config.objects.create(name=self.request.POST['name'], project=self.request.user.selected_project, stage=self.stage)
return '/configs/?stage=' + self.stage
def post_delete(self):
# config = Config.objects.get(id=self.request.POST['config'])
# config.delete()
delete_config(self.request.POST['config'])
return '/configs/?stage=' + self.stage
config = Config.objects.get(id=self.request.POST['config'])
config.delete()
return '/configs/?stage=' + config.stage
def post_save(self):
data = self.request.POST['data']
# config = Config.objects.get(id=self.request.POST['config'])
config = Config.objects.get(id=self.request.POST['config'])
try:
data = loads(data)
except:
self.context['incorrect_config'] = self.request.POST['config']
self.context['incorrect_config'] = config
self.context['incorrect_data'] = data
self.context['error'] = True
return
update_config(self.request.POST['config'], data)
# config.data = data
# config.save()
return '/configs/?stage=' + self.stage
config.data = data
config.save()
return '/configs/?stage=' + config.stage
def get_config(request):

View File

@@ -1,7 +1,6 @@
from django.http import HttpResponse, JsonResponse
from BaseLib.BaseView import BaseView
from BaseLib.configurator import *
from Platform import settings
from experiments.models import Experiment
@@ -18,48 +17,31 @@ class ExperimentsView(BaseView):
self.context['stage'] = self.stage
def get(self):
# self.context['experiments'] = Experiment.objects.filter(project=self.request.user.selected_project,
# stage=self.stage).order_by('name')
self.context['experiments'] = get_experiments(self.request.user.selected_project.name, self.stage)
self.context['experiments'] = Experiment.objects.filter(project=self.request.user.selected_project,
stage=self.stage).order_by('name')
def post_create(self):
# Experiment.objects.create(project=self.request.user.selected_project, stage=self.stage, name=self.request.POST['name'])
create_experiment(self.request.user.selected_project.name, self.stage, self.request.POST['name'])
Experiment.objects.create(project=self.request.user.selected_project, stage=self.stage, name=self.request.POST['name'])
return '/experiments/?stage=' + self.stage
def post_delete(self):
# Experiment.objects.get(id=self.request.POST['experiment_id']).delete()
delete_experiment(self.request.POST['experiment_id'])
Experiment.objects.get(id=self.request.POST['experiment_id']).delete()
return '/experiments/?stage=' + self.stage
def post_change(self):
# exp = Experiment.objects.get(id=self.request.POST['experiment_id'])
# exp.enabled = 'enabled' in self.request.POST
# condition = self.request.POST['condition_select']
# if condition == 'Другое (только для техлидов)':
# exp.condition = self.request.POST['condition']
# elif condition == 'Никому':
# exp.condition = 'False'
# elif condition == 'Только админам':
# exp.condition = 'user.is_superuser'
# elif condition == 'Только сотрудникам':
# exp.condition = 'user.platform_staff'
# else:
# exp.condition = 'True'
# exp.save()
enabled = 'enabled' in self.request.POST
exp = Experiment.objects.get(id=self.request.POST['experiment_id'])
exp.enabled = 'enabled' in self.request.POST
condition = self.request.POST['condition_select']
if condition == 'Другое (только для техлидов)':
condition = self.request.POST['condition']
exp.condition = self.request.POST['condition']
elif condition == 'Никому':
condition = 'False'
exp.condition = 'False'
elif condition == 'Только админам':
condition = 'user.is_superuser'
exp.condition = 'user.is_superuser'
elif condition == 'Только сотрудникам':
condition = 'user.platform_staff'
exp.condition = 'user.platform_staff'
else:
condition = 'True'
update_experiment(self.request.POST['experiment_id'], enabled, condition)
exp.condition = 'True'
exp.save()
return '/experiments/?stage=' + self.stage

View File

@@ -1,37 +0,0 @@
import json
import urllib.request
import os
import shutil
projects = {
'queues': 'tasks.proto'
}
try:
shutil.rmtree('schemas')
except:
pass
try:
os.mkdir('schemas')
except:
pass
for project in projects:
response = urllib.request.urlopen(f'https://platform.sprinthub.ru/schemas/get?project={project}').read()
data = json.loads(response)
os.mkdir(f'schemas/{project}')
for key, value in data.items():
with open(f'schemas/{project}/{key}', 'w+') as fp:
fp.write(value)
for key, value in projects.items():
os.system(f'python -m grpc_tools.protoc --proto_path schemas --python_out=. --pyi_out=. --grpc_python_out=. ./schemas/{key}/{value}')
try:
shutil.rmtree('schemas')
except:
pass

View File

View File

@@ -1,6 +0,0 @@
from django.contrib import admin
# Register your models here.
from .models import Schema
admin.site.register(Schema)

View File

@@ -1,6 +0,0 @@
from django.apps import AppConfig
class SchemasConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'schemas'

View File

@@ -1,28 +0,0 @@
# Generated by Django 5.1.4 on 2024-12-08 11:56
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('web', '0007_customuser_telegram_id_customuser_telegram_username'),
]
operations = [
migrations.CreateModel(
name='Schema',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.TextField()),
('data', models.BinaryField(blank=True, null=True)),
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.project')),
],
options={
'indexes': [models.Index(fields=['project'], name='schemas_sch_project_18fee8_idx')],
},
),
]

View File

@@ -1,18 +0,0 @@
# Generated by Django 5.1.4 on 2024-12-08 12:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schemas', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='schema',
name='data',
field=models.TextField(blank=True, null=True),
),
]

View File

@@ -1,18 +0,0 @@
# Generated by Django 5.1.4 on 2024-12-08 12:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schemas', '0002_alter_schema_data'),
]
operations = [
migrations.AlterField(
model_name='schema',
name='data',
field=models.TextField(blank=True, default=''),
),
]

View File

@@ -1,14 +0,0 @@
from django.db import models
# Create your models here.
class Schema(models.Model):
project = models.ForeignKey('web.Project', on_delete=models.CASCADE)
name = models.TextField()
data = models.TextField(default='', blank=True)
class Meta:
indexes = [
models.Index(fields=['project'])
]

View File

@@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@@ -1,9 +0,0 @@
from django.contrib import admin
from django.urls import path
from .views import *
urlpatterns = [
path(*SchemasView.as_path()),
path('get', get_schemas)
]

View File

@@ -1,46 +0,0 @@
from json import loads
from django.http import HttpResponse, JsonResponse
from BaseLib.BaseView import BaseView
from BaseLib.configurator import *
from Platform import settings
from schemas.models import Schema
# Create your views here.
class SchemasView(BaseView):
required_login = True
endpoint = ''
view_file = 'schemas.html'
def pre_handle(self):
self.context['schemas'] = Schema.objects.filter(project=self.request.user.selected_project)
def post_create_schema(self):
Schema.objects.create(project=self.request.user.selected_project, name=self.request.POST['name'])
return '/schemas'
def post_delete(self):
Schema.objects.get(id=self.request.POST['schema']).delete()
return '/schemas'
def post_save(self):
schema = Schema.objects.get(id=self.request.POST['schema'])
schema.data = self.request.POST['data']
schema.save()
return '/schemas'
def get_schemas(request):
project = request.GET.get('project')
if project is None:
return HttpResponse('', status=400)
data = {
schema.name: schema.data
for schema in Schema.objects.filter(project__name=project)
}
return JsonResponse(data, safe=False)

View File

@@ -24,8 +24,6 @@ class Command(BaseCommand):
if response.status_code != 200:
continue
Snapshot.objects.create(project=project, data=response.json())
if not project.stats_cron:
continue
cron = croniter.croniter(project.stats_cron, timezone.now())
next_date = cron.get_next(datetime.datetime)
project.next_stats_fetch_time = next_date

View File

@@ -28,7 +28,7 @@
</div>
{% if error %}
<div class="alert alert-danger" role="alert">
Конфиг не имеет вид JSON!
Конфиг {{ incorrect_config.name }} не имеет вид JSON!
</div>
{% endif %}
<table class="table">
@@ -52,7 +52,7 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<textarea style="width: 100%; height: 800px;{% if config.id == incorrect_config %}border: 1px solid #f00;{% endif %}" name="data">{% if config.id == incorrect_config %}{{ incorrect_data }}{% else %}{{ config.value_pretty }}{% endif %}</textarea>
<textarea style="width: 100%; height: 800px;{% if config.id == incorrect_config.id %}border: 1px solid #f00;{% endif %}" name="data">{% if config.id == incorrect_config.id %}{{ incorrect_data }}{% else %}{{ config.data_pretty }}{% endif %}</textarea>
</div>
<div class="modal-footer">
<button type="submit" name="action" value="save" class="btn btn-secondary">Сохранить</button>

View File

@@ -98,14 +98,6 @@
<span class="sidebar-text">Статистика</span>
</a>
</li>
<li class="nav-item">
<a href="/schemas" class="nav-link">
<span class="sidebar-icon">
<i class="fa fa-file-code-o"></i>
</span>
<span class="sidebar-text">Схемы</span>
</a>
</li>
<li class="nav-item">
<button class="btn btn-secondary d-flex align-items-center justify-content-center btn-upgrade-pro">
{{ user.selected_project.name }}

View File

@@ -1,61 +0,0 @@
{% extends 'layouts/base.html' %}
{% block content %}
<h1>Схемы <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#create_config">+</button></h1>
<div class="modal fade" id="create_config" tabindex="-1" aria-labelledby="modal-default" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<form method="POST">
{% csrf_token %}
<div class="modal-header">
<h2 class="h6 modal-title">Создать схему</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="text" name="name" placeholder="Имя файла" style="width: 100%;" />
</div>
<div class="modal-footer">
<button type="submit" name="action" value="create_schema" class="btn btn-secondary">Создать</button>
<button type="button" class="btn btn-link text-gray-600 ms-auto" data-bs-dismiss="modal">Закрыть</button>
</div>
</form>
</div>
</div>
</div>
<table class="table">
<thead>
<th>Название</th>
<th>Действие</th>
</thead>
<tbody>
{% for schema in schemas %}
<tr>
<td>{{ schema.name }}</td>
<td><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#edit_{{ schema.id }}">Редактировать</button></td>
<div class="modal fade" id="edit_{{ schema.id }}" tabindex="-1" aria-labelledby="modal-default" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<form method="POST">
{% csrf_token %}
<input type="hidden" name="schema" value="{{ schema.id }}" />
<div class="modal-header">
<h2 class="h6 modal-title">Редактировать схему {{ config.name }}</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<textarea style="width: 100%; height: 800px;" name="data">{{ schema.data }}</textarea>
</div>
<div class="modal-footer">
<button type="submit" name="action" value="save" class="btn btn-secondary">Сохранить</button>
<button type="submit" name="action" value="delete" class="btn btn-danger" onclick="return confirm('Подтверди удаление. Это действие необратимо.');">Удалить</button>
<button type="button" class="btn btn-link text-gray-600 ms-auto" data-bs-dismiss="modal">Закрыть</button>
</div>
</form>
</div>
</div>
</div>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@@ -1,28 +0,0 @@
# Generated by Django 5.1.4 on 2024-12-08 12:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0007_customuser_telegram_id_customuser_telegram_username'),
]
operations = [
migrations.AlterField(
model_name='project',
name='next_stats_fetch_time',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='project',
name='stats_cron',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='project',
name='stats_link',
field=models.TextField(blank=True, null=True),
),
]

View File

@@ -3,10 +3,10 @@ from django.db import models
class Project(models.Model):
name = models.TextField()
stats_link = models.TextField(null=True, blank=True)
stats_cron = models.TextField(null=True, blank=True)
stats_link = models.TextField(null=True)
stats_cron = models.TextField(null=True)
stats_enabled = models.BooleanField(default=False)
next_stats_fetch_time = models.DateTimeField(null=True, blank=True)
next_stats_fetch_time = models.DateTimeField(null=True)
class Meta:
indexes = [

View File

@@ -15,5 +15,4 @@ urlpatterns = [
path(*YandexAuthView.as_path()),
path('is_staff', is_staff),
path('fetch', fetch),
path('generator', generator),
]

View File

@@ -9,4 +9,3 @@ from .vk_auth import VKAuthView
from .yandex_auth import YandexAuthView
from .is_staff import is_staff
from .fetch import fetch
from .generator import generator

View File

@@ -1,5 +0,0 @@
from django.http import HttpResponse
def generator(request):
return HttpResponse(open('generator.py', 'rb').read())