Skip to content

Commit

Permalink
chore: improve example project and development environement (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarreau authored Jan 3, 2025
1 parent c076f00 commit 2989e54
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@
"Dateonly",
"sessionmaker"
],
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/venv*/**": true,
"**/__pycache__/**": true
},
}
9 changes: 5 additions & 4 deletions src/_example/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ RUN \

# Copy the source code into the container.
# we're using a volume for that, but for initialization
COPY ./ /app/

WORKDIR /app/src/_example/django/

RUN curl -sSL https://install.python-poetry.org | python3 - ;\
export PATH="/opt/poetry/bin:$PATH"

RUN /opt/poetry/bin/poetry install --no-cache
COPY ./ /app/

WORKDIR /app/src/_example/django/

RUN /opt/poetry/bin/poetry install --no-cache --no-interaction

# for a bind mount on running repo
VOLUME /app
Expand Down
2 changes: 1 addition & 1 deletion src/_example/django/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
PYTHON_VERSION: 3.11 # 3.11 is default if not set
environment:
# forest related
FOREST_VERIFY_SSL: "False"
FOREST_VERIFY_SSL: False
FOREST_SERVER_URL: 'https://api.development.forestadmin.com'
# django related
DJANGO_SECRET_KEY: "^=k+h&r(f7d+#@3f)%h2xef!zvsn2f5_^ahuo*9v7k^6gk=*ey"
Expand Down
26 changes: 13 additions & 13 deletions src/_example/django/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def run(self) -> None:
url = f"{self.options['server_url']}/liana/v4/subscribe-to-events"
headers = {"forest-secret-key": self.options["env_secret"], "Accept": "text/event-stream"}
try:
http = urllib3.PoolManager()
args = {}
if self.options["verify_ssl"] is False:
args["cert_reqs"] = "CERT_NONE"
http = urllib3.PoolManager(**args)
self.sse_client = SSEClient(http.request("GET", url, preload_content=False, headers=headers))

for msg in self.sse_client.events():
Expand Down

0 comments on commit 2989e54

Please sign in to comment.