{"id":21253575,"url":"https://github.com/gamadorh/flask-hello-world","last_synced_at":"2025-04-14T04:12:14.526Z","repository":{"id":121589395,"uuid":"331199333","full_name":"gAmadorH/flask-hello-world","owner":"gAmadorH","description":"A simple Flask hello world application.","archived":false,"fork":false,"pushed_at":"2023-07-24T19:11:01.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":30,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T04:12:05.650Z","etag":null,"topics":["flask","flask-app","flask-application","hello-world","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gAmadorH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-20T05:10:11.000Z","updated_at":"2023-10-23T11:34:16.000Z","dependencies_parsed_at":"2023-04-10T06:02:29.735Z","dependency_job_id":null,"html_url":"https://github.com/gAmadorH/flask-hello-world","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gAmadorH%2Fflask-hello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gAmadorH%2Fflask-hello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gAmadorH%2Fflask-hello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gAmadorH%2Fflask-hello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gAmadorH","download_url":"https://codeload.github.com/gAmadorH/flask-hello-world/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819403,"owners_count":21166477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["flask","flask-app","flask-application","hello-world","python3"],"created_at":"2024-11-21T03:52:08.521Z","updated_at":"2025-04-14T04:12:14.504Z","avatar_url":"https://github.com/gAmadorH.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flask-hello-world\n\n[![license](https://img.shields.io/github/license/gAmadorH/flask-hello-world.svg?color=blue)](https://github.com/gAmadorH/flask-hello-world/blob/master/LICENSE)\n\nA simple Flask hello world application.\n\n## Requirements\n\n- [Python3.8](https://www.python.org/downloads/release/python-380/)\n\n## Create the project\n\nCreate a project folder and create a virtual environment and activate it.\n\n```bash\nmkdir flask-hello-world \u0026\u0026 cd $_\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\n## Install Flask\n\nFirst create a file to save dependencies (only Flask dependency in this case).  \nThe must common name for this file is `requirements.txt`, so:\n\n```bash\ntouch requirements.txt\n```\n\nNow you need to define your dependencies, and the file looks like this:\n\n```txt\nflask==1.1.2\n```\n\nYou can check Flask releases in: [https://github.com/pallets/flask/releases](https://github.com/pallets/flask/releases).  \nTo install it, you just to need run:\n\n```bash\npip install -r requirements.txt\n```\n\nNow, you can check installed dependencies (Flask and its dependencies).\n\n```bash\npip freeze\n```\n\nAnd the output should be like this:\n\n```bash\nclick==7.1.2\nFlask==1.1.2\nitsdangerous==1.1.0\nJinja2==2.11.2\nMarkupSafe==1.1.1\nWerkzeug==1.0.1\n```\n\nWOW Flask has very few dependencies to be a web application framework,  \nit is because Flask is a `microframework`\n\n## Create a Hello World app\n\nCreate a main file call `main.py` (The name does not matter, it could be another).\n\n```bash\ntouch main.py\n```\n\nAnd then put the next code:\n\n```python\nfrom flask import Flask\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef hello():\n  return 'Hello world with Flask'\n```\n\n## Run your new app\n\nTo run your app, first you need to set a environment variable called `FLASK_APP`  \nand its value is the name of your file where your app is (`main.py` in this case).  \nOptionally you can set the _debug mode_ for developing suing `FLASK_DEBUG` env var to 1.\n\n```bash\nexport FLASK_APP=main.py\nexport FLASK_DEBUG=1\n```\n\nCheck the env var:\n\n```bash\necho $FLASK_APP\n$ main.py\n```\n\nAnd then you can run your app:\n\n```bash\nflask run\n```\n\nAnd it outputs something like:\n\n```bash\n* Serving Flask app \"main.py\"\n* Environment: production\n  WARNING: This is a development server. Do not use it in a production deployment.\n  Use a production WSGI server instead.\n* Debug mode: on\n* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n```\n\nBy default Flask app run a server in the 5000 port in localhost.  \nNow you can send a request to your app:\n\n```bash\ncurl http://127.0.0.1:5000/\n```\n\nThe output should be like:\n\n```bash\nHello world with Flask\n```\n\nTo stop your new app, just press `CTRL + c`\n\n## License\n\n[MIT.](./LICENSE) Copyright (c)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamadorh%2Fflask-hello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamadorh%2Fflask-hello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamadorh%2Fflask-hello-world/lists"}