odoo_hours setup and ready

This commit is contained in:
2024-11-25 19:11:28 +00:00
parent 78241144e2
commit 111c51a072
8 changed files with 353 additions and 11 deletions

View File

@@ -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 = [

View File

@@ -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"),
]