{"id":14065445,"url":"https://github.com/italomaia/flask-empty","last_synced_at":"2025-04-04T19:11:53.436Z","repository":{"id":55506425,"uuid":"2648604","full_name":"italomaia/flask-empty","owner":"italomaia","description":"An empty project skeleton / boilerplate for flask projects. Powered by CookieCutter.","archived":false,"fork":false,"pushed_at":"2023-07-13T20:24:29.000Z","size":237,"stargazers_count":666,"open_issues_count":10,"forks_count":92,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-12T10:14:39.147Z","etag":null,"topics":["blueprint","boilerplate","flask","hacktoberfest","python","skeleton-application"],"latest_commit_sha":null,"homepage":"","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/italomaia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2011-10-26T03:31:18.000Z","updated_at":"2024-10-04T23:15:56.000Z","dependencies_parsed_at":"2024-10-25T18:27:53.468Z","dependency_job_id":"d8f36563-a144-491d-b9aa-dfd4ff04a5fe","html_url":"https://github.com/italomaia/flask-empty","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italomaia%2Fflask-empty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italomaia%2Fflask-empty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italomaia%2Fflask-empty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italomaia%2Fflask-empty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/italomaia","download_url":"https://codeload.github.com/italomaia/flask-empty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234922,"owners_count":20905854,"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":["blueprint","boilerplate","flask","hacktoberfest","python","skeleton-application"],"created_at":"2024-08-13T07:04:29.748Z","updated_at":"2025-04-04T19:11:53.409Z","avatar_url":"https://github.com/italomaia.png","language":"Python","funding_links":[],"categories":["介绍","Python"],"sub_categories":[],"readme":"Flask Empty\n===========\n\n**version 0.6.5**\n\nFlask-Empty is a simple **flask boilerplate** for fast prototyping. Just\nuse cookiecutter and create a new project in no time.\n\n```shell\n# if cookiecutter is not installed\npip3 install cookiecutter\n\n# using cookiecutter // linux/Mac\ncookiecutter https://github.com/italomaia/flask-empty\n\n# answer the prompt and you're done!\n```\n\nGetting Started\n===============\n\nYou're advised to use [venv](https://docs.python.org/3/library/venv.html) from here on.\nIn your project folder, create and enable it like this:\n\n```shell\npython3 -m venv venv\n. venv/bin/activate  # [.csh|.fish]\n\n# install required packages\npip3 install -r requirements.txt\n\n# loads env variables and runs the project in development mode\nmake run-dev\n```\n\nGetting Started With Docker\n===========================\n\nGiven you have up-to-date docker installed in your machine,\nall you need to do is:\n\n```shell\n# build container image\ndocker build . -t my-project-name\n# run container in development mode\ndocker run --rm -p 5000:5000 my-project-name\n```\n\nEnvironment Variables\n=====================\n\nFor flask to run correctly, some environment variables need to be set. The ones **needed** by your project can be seen in the **Dockerfile** or **Makefile** files.\nFor a list of all other optional environment variables, [check this link](https://flask.palletsprojects.com/en/1.1.x/config/). When using **docker**, you can easely set them inline before each run. When using **docker-compose**, set them in the yaml configuration file for each environment.\n\nImportant files to be aware of\n==============================\n\n**\u003cproject\u003e/extensions.py** all extension instances that need initialization should be available\nhere, so [Empty](https://pypi.org/project/Empty/) can see and initialize them for you. If instantiated somewhere else, just import them here and you should be fine.\n\n**\u003cproject\u003e/config.py** has pre-set configuration classes for you to meddle with. They're are all self explanatory and commented.\n\n**\u003cproject\u003e/main.py** instantiates your project's main class. Override it to quickly add custom extension setups, simple views, context processors, etc. It already has some sensitive defaults for most use cases. See https://github.com/italomaia/empty for the available options.\n\n`\u003cproject\u003e/\u003cproject\u003e.ini` is the configuration file used with\n[uwsgi](https://github.com/unbit/uwsgi). Use it like this:\n\n```\nuwsgi --ini your_project.ini\n```\n\n**commands.py** adds few very useful commandline commands (...) to help your development productivity. You can also add your own. Check available commands by running `FLASK_ENV=development FLASK_CONFIG_DEFAULT=Dev flask` in the terminal.\n\n## Heroku\n\nEmpty comes with a pre-configured _procfile_ and _heroku()_ wrapper for _app_factory_. No setup required.\n\nOther topics\n============\n\n## Templates\n\nThere are some error templates bundled with flask-empty by default. All empty right now. Just fill them up for your project.\n\n## Macros\n\nYou can use the jinja2 macros available in **templates/macros** to easily integrate your jinja2 templates with flask extensions like wtforms and common tasks like showing flash messages.\n\nAvailable macros, **formhelpers** and **flashing** are very useful.\n\n## Blueprints\n\nYou can create blueprints easily with `make new-app`. The will live, by default\nat **apps** folder. Remember to configure your blueprints in **config.py** so that they\ncan be properly loaded.\n\n## Json Friendly\n\nVariables `true`, `false` and `null` are now supported as aliases for `True`, `False` and `None`.\nThis way, valid json can be copy-pasted directly into your code and will be interpreted\nas valid python. Ex: `data = {\"x\": true, \"y\": false, \"z\": null}`\n\n# Supported Extensions\n\n## Flask-SQLAlchemy\n\nWhile creating your project, Flask-Empty will ask you if you wish to enable SQL support. Confirm if you do so and Flask-SQLAlchemy will be made available. See **config.py** for its default configuration.\n\n_ps: currently, db-create will only create your models if they are imported somewhere in your application.\n\nBy **somewhere**, try the same module where your Blueprint instance is defined.\n\n## Flask-Mongoengine\n\nAs mongodb is really cool, supporting it is a must. Just say yes at the prompt when asked\nand Flask-Mongoengine will be setup for you.\n\n## Flask-WTF\n\nFlask-WTF is the \"the facto\" extension for handling forms with Flask. It is simply great, and Flask-Empty\nsupports it! Just say \"yes\" during project creation and Flask-WTF support will be on.\n\n## Flask-Admin\n\nJust create an admin.py file in your blueprint, define your admin models inside and change\n**LOAD_MODULES_EXTENSIONS** to also pre-load admin, like this:\n\n## Flask-Marshmallow\n\nGives you, almost for free, model serialization, deserialization and validation. Also\nquite handy for fast development of rest applications.\n\n## Flask-Security\n\nGet user session and permissioning out-of-the-box with this great project.\n\nExamples\n========\n\nThe blog example in this project is probably outdated by now, so, just create a new project\nand mess around to your heart's content for quick learning.\n\nFAQ\n===\n**Is flask-empty _boilerplate_ compatible with flask 0.x? Cuz' that's what my app uses.**\n\nRight now, flask-empty is a very simple project where many good practices and code examples were glued together.\n\nUntil recently I was focused in keeping backward compatibility with flask 0.8. Well, **that goal is no more**.\n\nFlask-empty will be compatible with the latest version of Flask and, by chance, with previous versions. Things will be easier (for me!) this way.\n\n**So, which is the oldest version where flask-empty works?**\n\nIn my last test, version 1.0.\n\n**I think flask-empty should have _this_ and _that_ configured by default. Will you add support?**\n\nMy current goals are:\n\n* Make flask-empty real easy to start a project with\n* Keep things simple and robust\n\nIf your suggestion is simple, **VERY** useful and has little overhead, I'll probably consider adding it to the project.\n\nIf you make the code and send a pull request, then I'll consider it real hard. Now, if your suggestion is rejected or advised in a different approach, don't get sad (you're awesome ;).\n\n**I just made a cool example with flask-empty and want to add it to examples.**\n\nPull request it for evaluation ;)\nJust keep in mind that good examples are short (not really...) and focused in it's showcase.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitalomaia%2Fflask-empty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitalomaia%2Fflask-empty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitalomaia%2Fflask-empty/lists"}