{"id":20126609,"url":"https://github.com/thefloatingstring/bhx-4-python-web-dev","last_synced_at":"2026-05-28T23:31:15.976Z","repository":{"id":70750570,"uuid":"328077318","full_name":"TheFloatingString/bhx-4-python-web-dev","owner":"TheFloatingString","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-09T06:55:35.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-30T21:41:56.257Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/TheFloatingString.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-09T04:53:36.000Z","updated_at":"2021-01-09T06:55:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"f15432ea-092e-411d-b08d-86edac42f0b1","html_url":"https://github.com/TheFloatingString/bhx-4-python-web-dev","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheFloatingString/bhx-4-python-web-dev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFloatingString%2Fbhx-4-python-web-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFloatingString%2Fbhx-4-python-web-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFloatingString%2Fbhx-4-python-web-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFloatingString%2Fbhx-4-python-web-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheFloatingString","download_url":"https://codeload.github.com/TheFloatingString/bhx-4-python-web-dev/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFloatingString%2Fbhx-4-python-web-dev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33630999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-13T20:17:02.461Z","updated_at":"2026-05-28T23:31:15.953Z","avatar_url":"https://github.com/TheFloatingString.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BrebeufHx 4 - Python Workshop (Web Development Version) (Part 2/2)\n\nHello there!\n\nThis is the web development version of the workshop.\n\nIf you are a beginner to Python, it would be best to first master the [simple version\nof this workshop (part 1)](https://github.com/TheFloatingString/bhx-4-python-simple) before\nstarting this web development version.\n\nThe goal is to integrate an HTML frontend that can call Python functions through a \n[Flask](https://flask.palletsprojects.com/en/1.1.x/) web app.\n\nThe concepts that are used are:\n- variable types\n- if/else statements\n- functions\n- modules \n- package installation\n- HTTP routing\n- HTML layout\n\n## Python Installation\n\nPython installation instructions are also found in \nthe [simple workshop repository's `README.md` file](https://github.com/TheFloatingString/bhx-4-python-simple).\n\n## Installing Flask locally\n\nFlask (version 1.1.2) can be installed through cmd or Terminal with the following command for Windows:\n\n```bash\npip install flask==1.1.2\n```\n\nand the following command for MacOs/Linux:\n\n```bash\npip3 install flask==1.1.2\n```\n\n## Installing Flask on Repl.it\n\nCreate a Python Repl. On the left sidebar, go to `Packages`, click the plus button, and add Flask.\n\n## Directory structure\n\n- `main.py` is the web app \n\n- `templates` is a mandatory folder for Flask to identify HTML pages\n\n- `index.html` is the HTML file that `main.py` renders\n\n## Running on Repl.it\n\nOn the right side of the screen, go to shell and type\n\n```bash\npython main.py\n```\n\nEnsure that in `app.run()`, host is `0.0.0.0` and port is `5000`.\n\nA web browswer should appear, containing the page corresponding to the `/` route.\n\n## Running Locally\n\nExecute `python main.py` (Windows) or `python3 main.py` (MacOS/Linux)\n\nOpen a browser (such as Google Chrome) at the address `http://localhost:5000`.\n\n## Using Various Pizza Parameters\n\nEnter the URL with the following parameters:\n\n```http://localhost:5000/identify/{cheese strips}/{pepperoni slices}/{pineapple chunks}```\n\nWhere cheese strips, pepperoni slices and pineapple chunks are all integers.\n\nWhen you submit this URL, it invokes the `identify()` function which returns a Python dictionary \nwith two keys: the estimated time to eat a pizza with those parameters, and \nthe type of pizza that was created.\n\n---\nWorkshop date: January 9, 2021\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefloatingstring%2Fbhx-4-python-web-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthefloatingstring%2Fbhx-4-python-web-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefloatingstring%2Fbhx-4-python-web-dev/lists"}