{"id":19745170,"url":"https://github.com/castle/castle-python-example","last_synced_at":"2026-02-09T22:03:51.778Z","repository":{"id":43183821,"uuid":"329636166","full_name":"castle/castle-python-example","owner":"castle","description":"Castle demo application: Python","archived":false,"fork":false,"pushed_at":"2022-03-15T10:23:37.000Z","size":58,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-18T17:43:16.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/castle.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-14T14:17:07.000Z","updated_at":"2021-09-21T11:12:39.000Z","dependencies_parsed_at":"2022-08-31T21:01:43.993Z","dependency_job_id":null,"html_url":"https://github.com/castle/castle-python-example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/castle/castle-python-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/castle%2Fcastle-python-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/castle%2Fcastle-python-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/castle%2Fcastle-python-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/castle%2Fcastle-python-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/castle","download_url":"https://codeload.github.com/castle/castle-python-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/castle%2Fcastle-python-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29283033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"ssl_error","status_checked_at":"2026-02-09T21:57:11.537Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T02:04:32.789Z","updated_at":"2026-02-09T22:03:51.761Z","avatar_url":"https://github.com/castle.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Castle demo application: Python\n\nThis project demonstrates key components of several essential Castle workflows, including login and reviewing a suspicious device. The application is built in Python on Flask/gunicorn.\n\n## How to engage with this application\n\nThere are three ways to engage with this application:\n\n1. Visit the public-facing web app: https://castle-demo-python.herokuapp.com\n\u003e This is the fastest way to get a sense of what the demo is all about. You do not need a Castle app id or api secret to use the public web app.\n\n2. Clone this repo and install \u0026 run locally (more details below)\n\n3. Run a Docker container\n\u003e A Dockerfile is included in this repo. Brief instructions for installing locally are below. Or, you can run a container locally immediately from the dockerhub image:\n\n`docker run -d -p 4005:80 -e castle_app_id={{castle_app_id} -e castle_api_secret={{castle_api_secret}} -e valid_password={{valid_password}} tomgsmith99/castle-demo-python`\n\n## Setting up this application locally\n\n### Set up a Castle tenant\n\nYou'll need a Castle tenant to run this app against. If you don't already have a Castle tenant, you can get a free trial at:\n\nhttps://castle.io\n\nOnce you have your Castle tenant set up, you'll need your app ID and API secret to run this app.\n\n### Install the app\n\nThis is a Python app built with Python 3.9.1. It has not been tested with other versions of Python.\n\nFirst, clone the git repo:\n\n`git clone https://github.com/castle/tomsmith-demo-python`\n\nChange to the repo's directory:\n\n`cd castle-demo-python`\n\nCreate a virtual environment and activate it:\n\n`python -m venv venv`\n\n`. venv/bin/activate`\n\nInstall the dependencies:\n\n`pip install -r requirements.txt`\n\nCopy the `.env_example` file to a file called `.env`\n\n`cp .env_example .env`\n\nUpdate the `.env` file with your Castle app id and api secret.\n\nRun the app:\n`flask run`\n * Running on http://127.0.0.1:5000/\n\nNote - the app also supports gunicorn:\n\n`gunicorn app:app`\n\n## Docker\n\n### Run from dockerhub\n\n`docker run -d -p 4005:80 -e castle_app_id={{castle_app_id} -e castle_api_secret={{castle_api_secret}} -e valid_password={{valid_password}} tomgsmith99/castle-demo-python`\n\n### Build image locally\n\nA Dockerfile is included in this repo as well.\n\nYou can build a Docker image and run a Docker container as follows:\n\n`docker build -t castle-demo-python .`\n\n`docker run -d -p 4005:80 -e castle_app_id={{castle_app_id}} -e castle_api_secret={{castle_api_secret}} -e valid_password={{valid_password}} castle-demo-python`\n\n## Disclaimer\nI’m sharing this sample app with the hope that other developers find it valuable. Although it is not an officially supported sample, we welcome questions and suggestions at `support@castle.io`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcastle%2Fcastle-python-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcastle%2Fcastle-python-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcastle%2Fcastle-python-example/lists"}