Skip to content

chore: improve example project and development environement #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading