Skip to content

Commit

Permalink
Updates to work with latest django + requirements.txt/dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Apr 30, 2024
1 parent 3380cbe commit 4c5fe70
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion ui/backend/server/requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ colorlog
ddtrace
django
django-extensions
django-ninja==1.0b1
django-ninja>=1.1.0
passlib
propelauth_py
psycopg2-binary
pydantic
sf-hamilton
6 changes: 3 additions & 3 deletions ui/backend/server/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def get_from_env(
}
}
LOGGING["handlers"]["console"]["filters"] = ["truncate_sql"]
SILKY_PYTHON_PROFILER = True
MIDDLEWARE.insert(0, "silk.middleware.SilkyMiddleware")
SILKY_PYTHON_PROFILER = False
# MIDDLEWARE.insert(0, "silk.middleware.SilkyMiddleware")
MIDDLEWARE.append("trackingserver_base.middleware.timing_middleware.TimingMiddleware")
INSTALLED_APPS.append("silk")
# INSTALLED_APPS.append("silk")
6 changes: 3 additions & 3 deletions ui/backend/server/server/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os

from django.contrib import admin
from django.urls import include, path # include,
from django.urls import path # include,

from . import api, default_views

Expand All @@ -33,5 +33,5 @@
]

HAMILTON_ENV = os.environ.get("HAMILTON_ENV", "dev")
if HAMILTON_ENV == "dev":
urlpatterns += [path("silk/", include("silk.urls", namespace="silk"))]
# if HAMILTON_ENV == "dev":
# urlpatterns += [path("silk/", include("silk.urls", namespace="silk"))]
3 changes: 1 addition & 2 deletions ui/backend/server/trackingserver_base/auth/propelauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from cachetools.keys import hashkey
from django.conf import settings
from django.http import HttpRequest
from ninja.compatibility import get_headers
from ninja.security import APIKeyQuery, HttpBearer
from propelauth_py import UnauthorizedException, init_base_auth
from trackingserver_auth.models import Team, User
Expand Down Expand Up @@ -105,7 +104,7 @@ async def __call__(self, request: HttpRequest) -> Optional[Any]:
@param request:
@return:
"""
headers = get_headers(request)
headers = request.headers
auth_value = headers.get(self.header)
if not auth_value:
return None
Expand Down
4 changes: 3 additions & 1 deletion ui/frontend/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
REACT_APP_API_URL=localhost:8241
REACT_APP_API_URL=https://localhost:8241
REACT_APP_USE_POSTHOG=false
REACT_APP_AUTH_MODE=local

~

0 comments on commit 4c5fe70

Please sign in to comment.