{"id":15569298,"url":"https://github.com/tony/cookiecutter-flask-pythonic","last_synced_at":"2025-10-02T23:34:56.780Z","repository":{"id":31500428,"uuid":"35064692","full_name":"tony/cookiecutter-flask-pythonic","owner":"tony","description":"Pythonic starter boilerplate for Flask","archived":false,"fork":false,"pushed_at":"2023-05-01T21:06:53.000Z","size":68,"stargazers_count":37,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T21:17:05.963Z","etag":null,"topics":["cookiecutter","flask","python","pythonic","template"],"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/tony.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","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":"2015-05-04T22:52:20.000Z","updated_at":"2023-09-03T04:49:37.000Z","dependencies_parsed_at":"2024-10-10T05:19:49.812Z","dependency_job_id":"b78a8d0a-899b-420f-9716-e74c1741f05d","html_url":"https://github.com/tony/cookiecutter-flask-pythonic","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fcookiecutter-flask-pythonic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fcookiecutter-flask-pythonic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fcookiecutter-flask-pythonic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fcookiecutter-flask-pythonic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tony","download_url":"https://codeload.github.com/tony/cookiecutter-flask-pythonic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235048982,"owners_count":18927715,"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":["cookiecutter","flask","python","pythonic","template"],"created_at":"2024-10-02T17:25:25.612Z","updated_at":"2025-10-02T23:34:56.470Z","avatar_url":"https://github.com/tony.png","language":"Python","readme":"===========================\ncookiecutter-flask-pythonic\n===========================\n\n.. image:: https://img.shields.io/travis/tony/cookiecutter-flask-pythonic.svg\n   :target: https://travis-ci.org/tony/cookiecutter-flask-pythonic\n\nForked from `cookiecutter`_ template for a Python package. Forked from\n`audreyr/cookiecutter-pypackage`_ +\n`tony/cookiecutter-pypackage-pythonic`_.\n\nIt is inspired by `flask`_ and `werkzeug`_'s project style patterns. It is\nused on the `tmuxp`_, `cihai-python`_ and `vcspull`_ projects. The app\nobject is based on early versions `pypa/warehouse`_, when it used\n`werkzeug`_ (see `warehouse's old app object`_).\n\n- Free software: BSD license\n- Vanilla testing setup with `unittest` and `python setup.py test`\n- Travis-CI_: Ready for Travis Continuous Integration testing\n- Tox_ testing: Setup to easily test for Python 2.6, 2.7, 3.3\n- Sphinx_ docs: Documentation ready for generation with, for example, \n  ReadTheDocs_. Note: You can install sphinx docs requirements with \n  ``$ pip install -r docs/requirements.txt``.\n  \n.. _warehouse's old app object: https://github.com/pypa/warehouse/blob/werkzeug/warehouse/application.py#L68\n\nAdditions and changes\n---------------------\n\n- (feature) app factory can be configured with ini, yaml or json\n  (`pypa/warehouse`_, `cihai`_ style) and by specifying options via CLI.\n  Flask-Script only supports ``-c config_file``. Application factory can\n  be wired to support option args and config file (pypa/warehouse, cihai)\n- (feature / removal) - use `flask testing client`_ for tests, remove\n  dependency on `flask-testing`_.\n- (feature) config file declaratively pulls blueprints from python paths\n  add them in the app factory.\n- (coverage) unittests against flask api, blueprint example module.\n\n.. _pypa/warehouse: https://github.com/pypa/warehouse\n.. _cihai: https://github.com/cihai/cihai-python\n.. _flask testing client: http://flask.pocoo.org/docs/testing/\n.. _flask-testing: https://pythonhosted.org/Flask-Testing/\n\nTesting\n~~~~~~~\n\n- `flask`_/`werkzeug`_-style testsuites. See `werkzeug testsuite`_ on\n  github.\n- Use ``run-tests.py`` to run all tests, or pass in arguments to test a\n  particular ``TestSuite``, ``TestCase`` or ``Test``:\n\n  .. code-block:: bash\n\n      $ ./run-tests.py\n      $ ./run-tests.py yourpackage\n      $ ./run-tests.py repo_name.repo_name  # package_name.TestSuite\n      $ ./run-tests.py yourpackage.testsuite.test_something\n      $ ./run-tests.py testsuite.test_something\n      $ ./run-tests.py test_something\n      $ ./run-tests.py test_something test_something_docstring\n\n- ``setup.py`` downloads ``unittest2`` for python 2.6.\n\nPython 2.7+3.3\n~~~~~~~~~~~~~~\n\n- .. code-block:: python\n\n      from __future__ import absolute_import, division, print_function, \\\n          with_statement, unicode_literals\n- ``repo_name/_compat.py`` module (derived from flask, werkzeug and\n  jinja2.) Why a compatibility module? See Armin Ronacher's post `Porting\n  to Python 3 Redux`_.\n\n.. _Porting to Python 3 Redux: http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/\n\nPackaging\n~~~~~~~~~\n\n- ``repo_name/__init__.py`` + ``repo_name/__about__.py``: Metadata in\n  ``repo_name/__init__.py`` e.g. ``__title__``, ``__author__`` can be\n  accessed via:\n\n  .. code-block:: python\n\n      \u003e\u003e\u003e about = {}\n      \u003e\u003e\u003e with open(\"repo_name/__about__.py\") as fp:\n      \u003e\u003e\u003e     exec(fp.read(), about)\n      \u003e\u003e\u003e print(about['__title__'])\n      Your project name\n\n  Keeps ``setup.py`` and ``doc/conf.py`` in sync with package metadata.\n  pypi and readthedocs distributions build off the latest package data.\n\n  This method avoids cost of tokenizing and importing python file and\n  avoids encountering potential import errors that may arise. It simply\n  opens a vanilla python file and evals it.\n\n  Derived from `pypa/warehouse`_.\n\n- Relative imports in ``repo_name/__init__.py``.\n- Relative imports in ``repo_name/testsuite/__init__.py``.\n- Relative imports in ``repo_name/testsuite/{{ cookiecutter.package_name }}.py``.\n\n.. _pypa/warehouse: https://github.com/pypa/warehouse\n\nDocs\n~~~~\n\n- ``README.rst`` reStructuredText table for project information.\n- vim modelines for ``rst`` in ``TODO`` and ``CHANGELOG``.\n- ``docs/requirements.txt``, which can be targetted to install `sphinx\n  changelog`_ package on `ReadTheDocs`. It will also trigger `-r\n  ../requirements.txt`.\n- `sphinx changelog`_ module, (imitation of `sqlalchemy`_, see `sqlalchemy\n  changelog`_)\n- Add ``TODO`` and ``docs/roadmap.rst``.\n- Rename ``CHANGELOG.rst`` -\u003e ``CHANGELOG``.\n- Add ``docs/api.rst`` for documentation of API code. Initial class\n  imported with docstring example.\n- Automatically generate header spacing based on length of\n  ``cookiecutter`` variables.\n\nExample data\n~~~~~~~~~~~~\n\n- Example TestCase.\n- Example Class w/ docstrings.\n\n.. _flask: http://flask.pocoo.org\n.. _werkzeug: http://werkzeug.pocoo.org\n.. _werkzeug testsuite: https://github.com/mitsuhiko/werkzeug/tree/master/werkzeug/testsuite\n.. _sqlalchemy: http://sqlalchemy.org\n.. _sqlalchemy changelog: http://docs.sqlalchemy.org/en/latest/changelog/ \n.. _sphinx changelog: https://pypi.python.org/pypi/changelog\n.. _cookiecutter: https://github.com/audreyr/cookiecutter\n.. _cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage\n.. _How can I get the version defined in setup.py setuptools in my package?: http://stackoverflow.com/a/3619714\n\nUsage\n-----\n\nInstall `cookiecutter`_:\n\n.. code-block:: bash\n\n    $ sudo pip install cookiecutter\n\nGenerate a Python package project:\n\n.. code-block:: bash\n\n    $ cookiecutter https://github.com/tony/cookiecutter-flask-pythonic.git\n\nThen:\n\n* Create a repo and put it there.\n* Add the repo to your `Travis-CI`_ account.\n* Add the repo to your `ReadTheDocs`_ account + turn on the ReadTheDocs \n  service hook.\n* Release your package the standard Python way. Here's a release \n  checklist: https://gist.github.com/audreyr/5990987\n\nNot Exactly What You Want?\n--------------------------\n\nDon't worry, you have options:\n\nSimilar Cookiecutter Templates\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* `audreyr/cookiecutter-pypackage`_: Forked from\n  ``tony/cookiecutter-pypackage-pythonic``.\n* `tony/cookiecutter-pypackage-pythonic`_: This package's fork. Includes\n  python 2 + 3, sphinx, unit tests, and more.\n* `sloria/cookiecutter-flask`_: A flask template with Bootstrap 3, asset\n  bundling + minification, starter templates and user accounts.\n* Also see the `network`_ and `family tree`_ for this repo. (If you find\n  anything that should be listed here, please add it and send a pull\n  request!)\n\n.. _tony/cookiecutter-pypackage-pythonic: https://github.com/tony/cookiecutter-pypackage-pythonic\n.. _sloria/cookiecutter-flask: https://github.com/sloria/cookiecutter-flask\n\nTesting\n~~~~~~~\n\n.. code-block:: shell\n\n   $ pip install -r dev-requirements.txt\n   $ sniffer\n   # edit any file in {{cookiecutter.repo_name}}\n   # todo: add run-tests.py for one-time runs\n\nFork This / Create Your Own\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you have differences in your preferred setup, I encourage you to fork this\nto create your own version. Or create your own; it doesn't strictly have to\nbe a fork.\n\n* Once you have your own version working, add it to the Similar Cookiecutter\n  Templates list above with a brief description. \n\n* It's up to you whether or not to rename your fork/own version. Do whatever\n  you think sounds good.\n\nOr Submit a Pull Request\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nI also accept pull requests on this, if they're small, atomic, and if they\nmake my own packaging experience better.\n\n\n.. _Travis-CI: http://travis-ci.org/\n.. _Tox: http://testrun.org/tox/\n.. _Sphinx: http://sphinx-doc.org/\n.. _ReadTheDocs: https://readthedocs.org/\n.. _`Nekroze/cookiecutter-pypackage`: https://github.com/Nekroze/cookiecutter-pypackage\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`network`: https://github.com/audreyr/cookiecutter-pypackage/network\n.. _`family tree`: https://github.com/audreyr/cookiecutter-pypackage/network/members\n.. _tmuxp: https://github.com/tony/tmuxp\n.. _vcspull: https://github.com/tony/vcspull\n.. _cihai-python: https://github.com/cihai/cihai-python\n","funding_links":[],"categories":["介绍"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony%2Fcookiecutter-flask-pythonic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony%2Fcookiecutter-flask-pythonic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony%2Fcookiecutter-flask-pythonic/lists"}