Add orders tab for recent SystemGroup delivery notes
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,27 @@ from pathlib import Path
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def _load_env_file(path: Path) -> None:
|
||||
"""Fill unset variables from a local env file. The process environment wins."""
|
||||
if not path.is_file():
|
||||
return
|
||||
for raw in path.read_text(encoding='utf-8').splitlines():
|
||||
line = raw.strip()
|
||||
if not line or line.startswith('#') or '=' not in line:
|
||||
continue
|
||||
key, value = line.split('=', 1)
|
||||
key = key.strip()
|
||||
if not key or key in os.environ:
|
||||
continue
|
||||
value = value.strip()
|
||||
if len(value) >= 2 and value[0] == value[-1] and value[0] in '"\'':
|
||||
value = value[1:-1]
|
||||
os.environ[key] = value
|
||||
|
||||
|
||||
_load_env_file(BASE_DIR / '.env')
|
||||
|
||||
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'dev-secret-key-change-in-production')
|
||||
|
||||
DEBUG = os.environ.get('DJANGO_DEBUG', '1') == '1'
|
||||
|
||||
@@ -10,6 +10,7 @@ urlpatterns = [
|
||||
path('entry/', views.entry, name='entry'),
|
||||
path('products/', views.products, name='products'),
|
||||
path('print/', views.print_queue, name='print_queue'),
|
||||
path('crm-orders/', views.crm_orders, name='crm_orders'),
|
||||
path('print-page/<int:order_id>/', views.print_page, name='print_page'),
|
||||
path('calibrate/', views.calibrate, name='calibrate'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user