-# Configuration for mKrimi Verleihnix Gui
- Alias /SVBaL "/usr/share/php/SVBaL/gui"
- <Directory /usr/share/php/SVBaL/gui>
- Options +FollowSymlinks
- RewriteEngine On
- RewriteBase /SVBaL/
- RewriteRule ^.*php$ index.php
- </Directory>
-
+WSGIScriptAlias /eh-util /opt/eh_util/eh_util/wsgi.py
+#WSGIPythonHome /path/to/venv
+WSGIPythonPath /opt/eh_util
+<Directory /opt/eh_util>
+<Files wsgi.py>
+Require all granted
+</Files>
+</Directory>
--- /dev/null
+from django.contrib import admin
+
+# Register your models here.
+
+from django.contrib import admin
+
+from .models import ConfigData
+
+admin.site.register(ConfigData)
--- /dev/null
+from django.apps import AppConfig
+
+
+class AusweisConfig(AppConfig):
+ name = 'ausweis'
--- /dev/null
+from django import forms
+
+class UploadFileForm(forms.Form):
+ file1 = forms.FileField(label='S-Verein-Export')
+
+class DocumentForm(forms.Form):
+ docfile = forms.FileField(
+ label='Select a file',
+ help_text='max. 42 megabytes'
+ )
+
+class TextInputForm(forms.Form):
+ text = forms.CharField(
+ label = "Text für das Anschreiben",
+ empty_value = "Bitte Text eingeben ...",
+ widget=forms.Textarea,
+ )
\ No newline at end of file
--- /dev/null
+from django.db import models
+
+class ConfigData(models.Model):
+ verein = models.CharField(max_length=100)
+ datei = models.CharField(max_length=200)
+ data_path = models.CharField(max_length=200)
+
+"""
+Falls hier Änderungen gemacht werden:
+- ./manage.py makemigrations ausweis
+- ./manage.py migrate
+"""
\ No newline at end of file
--- /dev/null
+from django.test import TestCase
+
+# Create your tests here.
--- /dev/null
+from django.urls import path
+
+from . import views
+
+urlpatterns = [
+ path('', views.index, name='index'),
+ path('upload', views.upload),
+ path('anschreiben', views.anschreiben),
+ path('alle_ausweise', views.alle_ausweise),
+ path('einzelausweis', views.einzelausweis),
+]
\ No newline at end of file
--- /dev/null
+from .AWK import routines
+from .forms import UploadFileForm, DocumentForm, TextInputForm
+
+from django.http import HttpResponse, HttpResponseRedirect
+from django.shortcuts import render
+from django.template import loader
+
+
+def index(request, verein):
+
+ # check existence in DB
+ csv_datei_name = routines.getCsvDateiName(verein)
+ if not csv_datei_name:
+ template = loader.get_template('index.html')
+ context = {
+ 'csv_datei_name': csv_datei_name,
+ }
+ return HttpResponse(template.render(context, request))
+ return render(request, 'index.html', {'csv_datei_name': csv_datei_name})
+
+def upload(request, verein):
+ if request.method == 'POST':
+ form = UploadFileForm(request.POST, request.FILES)
+ if form.is_valid():
+ routines.handle_uploaded_file(verein, request.FILES['file1'])
+ return HttpResponseRedirect('')
+ return HttpResponse("Dateiverarbeitung fehlerhaft")
+ else:
+ form = UploadFileForm()
+ return render(request, 'upload.html', {'form': form})
+
+def anschreiben(request, verein):
+ if request.method == 'POST':
+ form = TextInputForm(request.POST)
+ if form.is_valid():
+ return HttpResponse("Dateiverarbeitung ok")
+ return HttpResponse("Dateiverarbeitung fehlerhaft")
+ else:
+ form = TextInputForm()
+ return render(request, 'anschreiben.html', {'form': form})
+
+def alle_ausweise(request, verein):
+ return HttpResponse("NIY")
+
+def einzelausweis(request, verein):
+ return HttpResponse("NIY")