diff --git a/src/khoj/app/settings.py b/src/khoj/app/settings.py index 721bcc87..1b92cc02 100644 --- a/src/khoj/app/settings.py +++ b/src/khoj/app/settings.py @@ -14,7 +14,7 @@ from pathlib import Path import os # Build paths inside the project like this: BASE_DIR / 'subdir'. -BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent +BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production @@ -143,7 +143,7 @@ USE_TZ = True # https://docs.djangoproject.com/en/4.2/howto/static-files/ STATIC_ROOT = BASE_DIR / "static" -STATICFILES_DIRS = [BASE_DIR / "src/khoj/interface/web"] +STATICFILES_DIRS = [BASE_DIR / "interface/web"] STATIC_URL = "/static/" # Default primary key field type diff --git a/src/khoj/main.py b/src/khoj/main.py index c5e1f277..67e840b2 100644 --- a/src/khoj/main.py +++ b/src/khoj/main.py @@ -107,10 +107,10 @@ def run(should_start_server=True): # Mount Django and Static Files app.mount("/server", django_app, name="server") - static_dir = "static" + static_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "static") if not os.path.exists(static_dir): os.mkdir(static_dir) - app.mount(f"/{static_dir}", StaticFiles(directory=static_dir), name=static_dir) + app.mount(f"/static", StaticFiles(directory=static_dir), name=static_dir) # Configure Middleware configure_middleware(app)