diff --git a/.gitignore b/.gitignore index 01773fd..d12fb43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .venv __pycache__ db.sqlite3 -env.* \ No newline at end of file +env.* +.env \ No newline at end of file diff --git a/app/bartool_ovh/settings.py b/app/bartool_ovh/settings.py index 3d7f5f1..bb800c4 100644 --- a/app/bartool_ovh/settings.py +++ b/app/bartool_ovh/settings.py @@ -12,6 +12,9 @@ https://docs.djangoproject.com/en/5.1/ref/settings/ from pathlib import Path import os +from dotenv import load_dotenv + +load_dotenv() from django.core.management.commands.runserver import Command as runserver runserver.default_port = "7100" @@ -25,15 +28,15 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-snqnsca90!r=^iu6yyhpxy^+mjm%7dvrg(lb!6fr3(!9yh(c30' -# SECRET_KEY = os.environ.get("SECRET_KEY") +# SECRET_KEY = 'django-insecure-snqnsca90!r=^iu6yyhpxy^+mjm%7dvrg(lb!6fr3(!9yh(c30' +SECRET_KEY = os.getenv("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True -# DEBUG = bool(os.environ.get("DEBUG", default=0)) +# DEBUG = True +DEBUG = bool(os.getenv("DEBUG", default=0)) -ALLOWED_HOSTS = ['192.168.1.146'] -# ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ") +# ALLOWED_HOSTS = ['192.168.1.146'] +ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS").split(" ") # Application definition @@ -46,7 +49,8 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', - 'homepage' + 'homepage', + 'odoo_hours' ] MIDDLEWARE = [ diff --git a/app/bartool_ovh/urls.py b/app/bartool_ovh/urls.py index f61c5f2..cad2f3a 100644 --- a/app/bartool_ovh/urls.py +++ b/app/bartool_ovh/urls.py @@ -18,8 +18,10 @@ from django.contrib import admin from django.urls import path from homepage import views as homepage +from odoo_hours import views as odoo_hours urlpatterns = [ path('admin/', admin.site.urls), - path('', homepage.index, name="homepage") + path('', homepage.index, name="homepage"), + path("odoo-hours/", odoo_hours.index, name="odoo-hours"), ] diff --git a/app/homepage/templates/homepage.html b/app/homepage/templates/homepage.html index 8d5732c..0f7fea6 100644 --- a/app/homepage/templates/homepage.html +++ b/app/homepage/templates/homepage.html @@ -23,7 +23,7 @@
Oblicz godziny pracy na podstawie tabeli odoo.
- ENTER + ENTER diff --git a/app/odoo_hours/templates/calendar.html b/app/odoo_hours/templates/calendar.html new file mode 100644 index 0000000..b88cf93 --- /dev/null +++ b/app/odoo_hours/templates/calendar.html @@ -0,0 +1,104 @@ + + + + + +{{ error }}
+