diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a81c8ee121952cf06bfaf9ff9988edd8cded763c --- /dev/null +++ b/.gitignore @@ -0,0 +1,138 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ diff --git a/backend/migrations/0001_initial.py b/backend/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..60a2034f1e412732becb9b9b7d315dfc1b8faaf9 --- /dev/null +++ b/backend/migrations/0001_initial.py @@ -0,0 +1,40 @@ +# Generated by Django 4.2.8 on 2023-12-11 07:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='cluster', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=50)), + ], + ), + migrations.CreateModel( + name='hosts', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('ipaddress', models.CharField(max_length=50)), + ('user', models.CharField(max_length=50)), + ('password', models.CharField(max_length=50)), + ('port', models.IntegerField(blank=True, null=True)), + ('cluster', models.CharField(max_length=50)), + ], + ), + migrations.CreateModel( + name='users', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.CharField(max_length=50)), + ('password', models.CharField(max_length=50)), + ], + ), + ] diff --git a/backend/models.py b/backend/models.py index 71a836239075aa6e6e4ecb700e9c42c95c022d91..855c5ef7425e006a629a840794c0322f58ade814 100644 --- a/backend/models.py +++ b/backend/models.py @@ -1,3 +1,16 @@ from django.db import models -# Create your models here. +class hosts(models.Model): + ipaddress = models.CharField(max_length=50) + user = models.CharField(max_length=50) + password = models.CharField(max_length=50) + port = models.IntegerField(null=True, blank=True) + cluster = models.CharField(max_length=50) + +class users(models.Model): + user = models.CharField(max_length=50) + password = models.CharField(max_length=50) + +class cluster(models.Model): + name = models.CharField(max_length=50) + diff --git a/safeguard_web/__pycache__/__init__.cpython-39.pyc b/safeguard_web/__pycache__/__init__.cpython-39.pyc index d1ec9108d9589b691401093303d9e8097a821340..e93afb5d9e8b3fac386606106a6f2ffafb73ba01 100644 Binary files a/safeguard_web/__pycache__/__init__.cpython-39.pyc and b/safeguard_web/__pycache__/__init__.cpython-39.pyc differ diff --git a/safeguard_web/__pycache__/settings.cpython-39.pyc b/safeguard_web/__pycache__/settings.cpython-39.pyc index 402de0db8aa99e0a312eed850f2024bc6e184055..51ead38da154322885bb8eaca7c3e3bda9f9280c 100644 Binary files a/safeguard_web/__pycache__/settings.cpython-39.pyc and b/safeguard_web/__pycache__/settings.cpython-39.pyc differ diff --git a/safeguard_web/__pycache__/urls.cpython-39.pyc b/safeguard_web/__pycache__/urls.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e437a816c6353ed6891d110bf40ff00900254903 Binary files /dev/null and b/safeguard_web/__pycache__/urls.cpython-39.pyc differ diff --git a/safeguard_web/settings.py b/safeguard_web/settings.py index f04c4c4a872d7b366d545d268ae79f28f0f7c79a..93472a028a62a5d1788007d1d5e1c42c5b5c9f8a 100644 --- a/safeguard_web/settings.py +++ b/safeguard_web/settings.py @@ -25,12 +25,13 @@ SECRET_KEY = 'django-insecure-yz49(#t@v!yygcm5-@3d5z7w08ma&w6fh=2u$cev$&2u4nz^9e # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition INSTALLED_APPS = [ + 'backend.apps.BackendConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -75,8 +76,12 @@ WSGI_APPLICATION = 'safeguard_web.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'safeguard', + 'USER': 'root', + 'PASSWORD': 'safeguard', + 'HOST': '', + 'PORT': '', } }