diff --git a/uncloud_v3/Makefile b/uncloud_v3/Makefile index de59802..cadb844 100644 --- a/uncloud_v3/Makefile +++ b/uncloud_v3/Makefile @@ -1,5 +1,8 @@ all: requirements +run: requirements + . ./env && python manage.py runserver + requirements: venv . ./venv/bin/activate && pip install -r requirements.txt diff --git a/uncloud_v3/README.md b/uncloud_v3/README.md new file mode 100644 index 0000000..2c66a09 --- /dev/null +++ b/uncloud_v3/README.md @@ -0,0 +1,14 @@ +## Kubernetes integration + +### Development / Minikube + +To setup a development environment, start minikube on your local +machine. Use `kubectl get nodes` to verify minikube is up and running. + +## Settings + +### Environment variables / Settings / Environment + +* `SECRET_KEY` +* `DEBUG` +* `DATABASE` diff --git a/uncloud_v3/app/__init__.py b/uncloud_v3/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/uncloud_v3/app/admin.py b/uncloud_v3/app/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/uncloud_v3/app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/uncloud_v3/app/apps.py b/uncloud_v3/app/apps.py new file mode 100644 index 0000000..ed327d2 --- /dev/null +++ b/uncloud_v3/app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'app' diff --git a/uncloud_v3/app/migrations/__init__.py b/uncloud_v3/app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/uncloud_v3/app/models.py b/uncloud_v3/app/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/uncloud_v3/app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/uncloud_v3/app/tests.py b/uncloud_v3/app/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/uncloud_v3/app/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/uncloud_v3/app/views.py b/uncloud_v3/app/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/uncloud_v3/app/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/uncloud_v3/uncloud/settings.py b/uncloud_v3/uncloud/settings.py index 3b1015e..2e43fe9 100644 --- a/uncloud_v3/uncloud/settings.py +++ b/uncloud_v3/uncloud/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.0/ref/settings/ """ from pathlib import Path +import os # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -20,7 +21,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-c9w3)1$s)n2c81&+i@=s5h$1frt9+)4to*i7_tbaei02=j-4bp' +SECRET_KEY = os.environ['SECRET_KEY'] if 'SECRET_KEY' in os.environ else 'a bad secret key' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True