diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/asgi.py b/asgi.py new file mode 100644 index 0000000..479e2ff --- /dev/null +++ b/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for pim project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pim.settings') + +application = get_asgi_application() diff --git a/main.py b/main.py new file mode 100644 index 0000000..cc74d77 --- /dev/null +++ b/main.py @@ -0,0 +1,10 @@ +import base64 + +# String, den du in Base64 kodieren möchtest +original_string = "adm.3dfx12" + +# Den String in ein Bytes-Objekt umwandeln und dann in Base64 kodieren + + +print("Originaler String:", original_string) +print("Base64-kodierter String:", base64_string) \ No newline at end of file diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..1b243ab --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..e027b11 --- /dev/null +++ b/settings.py @@ -0,0 +1,130 @@ +""" +Django settings for pim project. + +Generated by 'django-admin startproject' using Django 4.2.4. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" + +from pathlib import Path +import os + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-4#5!a=35j51i$-vv$&w*ax%46oizdgfsy&2*=7phgnc&9=x#&b' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'setup', + 'django_ssh', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'setup.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'setup/template')], + '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 = 'wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'Django', + 'USER': 'root', + 'PASSWORD': 'N53yBCswuawzBzS445VNAhWVMs3N59Gb9szEsrzXRBzarDqpdETpQeyt5v5CGe', + 'HOST':'172.17.1.21', + 'PORT':'3306', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.2/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/4.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/setup/template/setup.html b/setup/template/setup.html new file mode 100644 index 0000000..91efce3 --- /dev/null +++ b/setup/template/setup.html @@ -0,0 +1,58 @@ + + + + Meine Webseite + + +
+ {% csrf_token %} +

IP-Adresse

+ +

Password

+ +

Firmenname

+ +

Firmenkürzel (zb. STI für Stines)

+ +

Subnetz (zb. 172.17.1.1)

+ +

Domain

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Router

Terminal-Server

Exchange-Server

Mail-Server

App-Server

Daten-Server

Web-Server

Bitwarden-Server


+ +
+ + diff --git a/setup/template/ssh_terminal.html b/setup/template/ssh_terminal.html new file mode 100644 index 0000000..fd27810 --- /dev/null +++ b/setup/template/ssh_terminal.html @@ -0,0 +1,18 @@ + + + + + SSH Terminal + + + {% if output %} +

Verbindung zum Server herstellen:

+ + {% endif %} + +

Folgende Schritte sind durch zuführen:

+ + + + + \ No newline at end of file diff --git a/setup/urls.py b/setup/urls.py new file mode 100644 index 0000000..57b22cf --- /dev/null +++ b/setup/urls.py @@ -0,0 +1,8 @@ +from django.urls import path +from . import views + + +urlpatterns = [ + path('', views.daten_eingeben, name='index'), + path('ssh-terminal/', views.ssh_terminal, name='ssh-terminal'), +] \ No newline at end of file diff --git a/urls.py b/urls.py new file mode 100644 index 0000000..0380294 --- /dev/null +++ b/urls.py @@ -0,0 +1,8 @@ +from django.contrib import admin +from django.urls import include, path + + +urlpatterns = [ + path("", include("setup.urls")), + +] \ No newline at end of file diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..a8838e2 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for pim 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/4.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pim.settings') + +application = get_wsgi_application()