├── .github ├── FUNDING.yml └── workflows │ └── run_tests.yml ├── .gitignore ├── .readthedocs.yaml ├── AUTHORS ├── LICENSE ├── Makefile ├── README.rst ├── bottle.py ├── docs ├── _locale │ ├── .tx │ │ └── config │ ├── README.txt │ ├── _pot │ │ ├── api.pot │ │ ├── async.pot │ │ ├── changelog.pot │ │ ├── configuration.pot │ │ ├── contact.pot │ │ ├── deployment.pot │ │ ├── development.pot │ │ ├── faq.pot │ │ ├── index.pot │ │ ├── plugindev.pot │ │ ├── plugins │ │ │ └── index.pot │ │ ├── recipes.pot │ │ ├── routing.pot │ │ ├── stpl.pot │ │ ├── tutorial.pot │ │ └── tutorial_app.pot │ ├── de_DE │ │ └── LC_MESSAGES │ │ │ ├── api.po │ │ │ ├── async.po │ │ │ ├── changelog.po │ │ │ ├── configuration.po │ │ │ ├── contact.po │ │ │ ├── deployment.po │ │ │ ├── development.po │ │ │ ├── faq.po │ │ │ ├── index.po │ │ │ ├── plugindev.po │ │ │ ├── plugins │ │ │ └── index.po │ │ │ ├── recipes.po │ │ │ ├── routing.po │ │ │ ├── stpl.po │ │ │ ├── tutorial.po │ │ │ └── tutorial_app.po │ ├── fr │ │ └── LC_MESSAGES │ │ │ ├── api.po │ │ │ ├── async.po │ │ │ ├── changelog.po │ │ │ ├── configuration.po │ │ │ ├── contact.po │ │ │ ├── deployment.po │ │ │ ├── development.po │ │ │ ├── faq.po │ │ │ ├── index.po │ │ │ ├── plugindev.po │ │ │ ├── plugins │ │ │ └── index.po │ │ │ ├── recipes.po │ │ │ ├── routing.po │ │ │ ├── stpl.po │ │ │ ├── tutorial.po │ │ │ └── tutorial_app.po │ ├── ja_JP │ │ └── LC_MESSAGES │ │ │ ├── api.po │ │ │ ├── async.po │ │ │ ├── changelog.po │ │ │ ├── configuration.po │ │ │ ├── contact.po │ │ │ ├── deployment.po │ │ │ ├── development.po │ │ │ ├── faq.po │ │ │ ├── index.po │ │ │ ├── plugindev.po │ │ │ ├── plugins │ │ │ └── index.po │ │ │ ├── recipes.po │ │ │ ├── routing.po │ │ │ ├── stpl.po │ │ │ ├── tutorial.po │ │ │ └── tutorial_app.po │ ├── pt_BR │ │ └── LC_MESSAGES │ │ │ ├── _pot │ │ │ ├── api.po │ │ │ ├── async.po │ │ │ ├── changelog.po │ │ │ ├── configuration.po │ │ │ ├── contact.po │ │ │ ├── deployment.po │ │ │ ├── development.po │ │ │ ├── faq.po │ │ │ ├── index.po │ │ │ ├── plugindev.po │ │ │ ├── plugins │ │ │ │ └── index.po │ │ │ ├── recipes.po │ │ │ ├── routing.po │ │ │ ├── stpl.po │ │ │ ├── tutorial.po │ │ │ └── tutorial_app.po │ │ │ ├── api.po │ │ │ ├── async.po │ │ │ ├── changelog.po │ │ │ ├── configuration.po │ │ │ ├── contact.po │ │ │ ├── deployment.po │ │ │ ├── development.po │ │ │ ├── faq.po │ │ │ ├── index.po │ │ │ ├── plugindev.po │ │ │ ├── plugins │ │ │ └── index.po │ │ │ ├── recipes.po │ │ │ ├── routing.po │ │ │ ├── stpl.po │ │ │ ├── tutorial.po │ │ │ └── tutorial_app.po │ ├── requirements.txt │ ├── ru_RU │ │ └── LC_MESSAGES │ │ │ ├── api.po │ │ │ ├── async.po │ │ │ ├── changelog.po │ │ │ ├── configuration.po │ │ │ ├── contact.po │ │ │ ├── deployment.po │ │ │ ├── development.po │ │ │ ├── faq.po │ │ │ ├── index.po │ │ │ ├── plugindev.po │ │ │ ├── plugins │ │ │ └── index.po │ │ │ ├── recipes.po │ │ │ ├── routing.po │ │ │ ├── stpl.po │ │ │ ├── tutorial.po │ │ │ └── tutorial_app.po │ └── zh_CN │ │ └── LC_MESSAGES │ │ ├── _pot │ │ ├── api.po │ │ ├── async.po │ │ ├── changelog.po │ │ ├── configuration.po │ │ ├── contact.po │ │ ├── deployment.po │ │ ├── development.po │ │ ├── faq.po │ │ ├── index.po │ │ ├── plugindev.po │ │ ├── plugins │ │ │ └── index.po │ │ ├── recipes.po │ │ ├── routing.po │ │ ├── stpl.po │ │ ├── tutorial.po │ │ └── tutorial_app.po │ │ ├── api.po │ │ ├── async.po │ │ ├── changelog.po │ │ ├── configuration.po │ │ ├── contact.po │ │ ├── deployment.po │ │ ├── development.po │ │ ├── faq.po │ │ ├── index.po │ │ ├── plugindev.po │ │ ├── plugins │ │ └── index.po │ │ ├── recipes.po │ │ ├── routing.po │ │ ├── stpl.po │ │ ├── tutorial.po │ │ └── tutorial_app.po ├── api.rst ├── async.rst ├── bottle.svg ├── changelog.rst ├── conf.py ├── configuration.rst ├── contributors.rst ├── deployment.rst ├── development.rst ├── faq.rst ├── index.rst ├── plugins │ ├── dev.rst │ ├── index.rst │ └── list.rst ├── routing.rst ├── stpl.rst ├── tutorial.rst └── tutorial_app.rst ├── pyproject.toml └── test ├── .coveragerc ├── __init__.py ├── build_python.sh ├── example_settings.py ├── test_app.py ├── test_auth.py ├── test_config.py ├── test_contextlocals.py ├── test_environ.py ├── test_exc.py ├── test_fileupload.py ├── test_formsdict.py ├── test_html_helper.py ├── test_importhook.py ├── test_jinja2.py ├── test_mako.py ├── test_mdict.py ├── test_mount.py ├── test_multipart.py ├── test_oorouting.py ├── test_outputfilter.py ├── test_plugins.py ├── test_resources.py ├── test_route.py ├── test_router.py ├── test_securecookies.py ├── test_sendfile.py ├── test_stpl.py ├── test_wsgi.py ├── tools.py └── views ├── jinja2_base.tpl ├── jinja2_inherit.tpl ├── jinja2_simple.tpl ├── mako_base.tpl ├── mako_inherit.tpl ├── mako_simple.tpl ├── stpl_include.tpl ├── stpl_no_vars.tpl ├── stpl_simple.tpl ├── stpl_t2base.tpl ├── stpl_t2inc.tpl ├── stpl_t2main.tpl └── stpl_unicode.tpl /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [defnull] 2 | liberapay: defnull 3 | -------------------------------------------------------------------------------- /.github/workflows/run_tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | on: [push, pull_request, workflow_call] 3 | 4 | jobs: 5 | build: 6 | runs-on: ubuntu-latest 7 | strategy: 8 | max-parallel: 6 9 | matrix: 10 | python-version: 11 | - "3.9" 12 | - "3.10" 13 | - "3.11" 14 | - "3.12" 15 | - "3.13" 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: actions/setup-python@v5 19 | with: 20 | python-version: ${{ matrix.python-version }} 21 | cache: pip 22 | - name: Install dev dependencies 23 | run: pip install .[dev] 24 | - name: Run tests 25 | run: pytest -ra -q --cov=bottle --cov-report=term 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *.db 4 | *.log 5 | *.mo 6 | ._* 7 | *.*~ 8 | __pycache__ 9 | 10 | dist/ 11 | build/ 12 | MANIFEST 13 | bottle.egg-info/ 14 | 15 | .idea/ 16 | 17 | htmlcov/ 18 | .htmlcoverage/ 19 | .coverage 20 | .name 21 | .tox/ 22 | .pytest_cache 23 | 24 | docs/_locale/_pot/.doctrees/ 25 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: latest 12 | 13 | # Build documentation in the "docs/" directory with Sphinx 14 | sphinx: 15 | configuration: docs/conf.py 16 | 17 | # Optional but recommended, declare the Python requirements required 18 | # to build your documentation 19 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 20 | python: 21 | install: 22 | - method: pip 23 | path: . 24 | extra_requirements: 25 | - docs -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Bottle is written and maintained by Marcel Hellkamp . 2 | 3 | Thanks to all the people who found bugs, sent patches, spread the word, helped each other on the mailing-list and made this project possible. I hope the following (alphabetically sorted) list is complete. If you miss your name on that list (or want your name removed) please file a pull request. 4 | 5 | * acasajus 6 | * Adam R. Smith 7 | * Alexey Borzenkov 8 | * Alexis Daboville 9 | * Anton I. Sipos 10 | * Anton Kolechkin 11 | * apexi200sx 12 | * apheage 13 | * BillMa 14 | * Brad Greenlee 15 | * Brandon Gilmore 16 | * Branko Vukelic 17 | * Brian Sierakowski 18 | * Brian Wickman 19 | * Carl Scharenberg 20 | * Damien Degois 21 | * David Buxton 22 | * Duane Johnson 23 | * fcamel 24 | * Frank Murphy 25 | * Frederic Junod 26 | * goldfaber3012 27 | * Greg Milby 28 | * gstein 29 | * Ian Davis 30 | * Itamar Nabriski 31 | * Iuri de Silvio 32 | * Jaimie Murdock 33 | * Jeff Nichols 34 | * Jeremy Kelley 35 | * joegester 36 | * Johannes Krampf 37 | * Jonas Haag 38 | * Joshua Roesslein 39 | * Judson Neer 40 | * Karl 41 | * Kevin Zuber 42 | * Kraken 43 | * Kyle Fritz 44 | * m35 45 | * Marcos Neves 46 | * masklinn 47 | * Michael Labbe 48 | * Michael Soulier 49 | * `reddit `_ 50 | * Nicolas Vanhoren 51 | * Oz N Tiram 52 | * Robert Rollins 53 | * rogererens 54 | * rwxrwx 55 | * Santiago Gala 56 | * Sean M. Collins 57 | * Sebastian Wollrath 58 | * Seth 59 | * Sigurd Høgsbro 60 | * Stuart Rackham 61 | * Sun Ning 62 | * Tomás A. Schertel 63 | * Tristan Zajonc 64 | * voltron 65 | * Wieland Hoffmann 66 | * zombat 67 | * Thiago Avelino 68 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2025, Marcel Hellkamp. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION = $(shell ./bottle.py --version) 2 | VENV = build/venv 3 | 4 | .PHONY: test 5 | test: venv 6 | $(VENV)/bin/pytest 7 | 8 | .PHONY: coverage 9 | coverage: venv 10 | $(VENV)/bin/pytest -q --cov=bottle --cov-report=term --cov-report=html:build/htmlcov 11 | 12 | .PHONY: build 13 | build: test 14 | $(VENV)/bin/python -m build 15 | 16 | .PHONY: docs 17 | docs: venv 18 | $(VENV)/bin/sphinx-build -b html docs build/docs/html/; 19 | 20 | .PHONY: watchdocs 21 | watchdocs: venv 22 | -mkdir -p build/docs/watch/ 23 | $(VENV)/bin/sphinx-autobuild -b html docs build/docs/watch/; 24 | 25 | .PHONY: version 26 | version: 27 | @echo $(VERSION) 28 | 29 | .PHONY: venv 30 | venv: $(VENV)/.installed 31 | $(VENV)/.installed: Makefile pyproject.toml 32 | test -d $(VENV) || python3 -m venv $(VENV) 33 | $(VENV)/bin/python3 -m ensurepip 34 | $(VENV)/bin/pip install -q -U pip 35 | $(VENV)/bin/pip install -q -e .[dev,docs] 36 | touch $(VENV)/.installed 37 | 38 | .PHONY: venv 39 | clean: 40 | rm -rf $(VENV) build/ dist/ MANIFEST .coverage .pytest_cache bottle.egg-info 2>/dev/null || true 41 | find . -name '__pycache__' -exec rm -rf {} + 42 | find . -name '*.pyc' -exec rm -f {} + 43 | find . -name '*.pyo' -exec rm -f {} + 44 | find . -name '*~' -exec rm -f {} + 45 | find . -name '._*' -exec rm -f {} + 46 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. image:: http://bottlepy.org/docs/dev/_static/logo_nav.png 2 | :target: http://bottlepy.org/ 3 | :alt: Bottle Logo 4 | :align: right 5 | 6 | .. image:: https://github.com/bottlepy/bottle/workflows/Tests/badge.svg 7 | :target: https://github.com/bottlepy/bottle/workflows/Tests 8 | :alt: Tests Status 9 | 10 | .. image:: https://img.shields.io/pypi/v/bottle.svg 11 | :target: https://pypi.python.org/pypi/bottle/ 12 | :alt: Latest Version 13 | 14 | .. image:: https://img.shields.io/pypi/l/bottle.svg 15 | :target: https://pypi.python.org/pypi/bottle/ 16 | :alt: License 17 | 18 | .. _Python: https://python.org/ 19 | .. _mako: https://www.makotemplates.org/ 20 | .. _cheetah: https://www.cheetahtemplate.org/ 21 | .. _jinja2: https://jinja.palletsprojects.com/ 22 | 23 | .. _WSGI: https://peps.python.org/pep-3333/ 24 | .. _gunicorn: https://gunicorn.org/ 25 | .. _paste: https://pythonpaste.readthedocs.io/ 26 | .. _cheroot: https://cheroot.cherrypy.dev/ 27 | 28 | ============================ 29 | Bottle: Python Web Framework 30 | ============================ 31 | 32 | Bottle is a fast, simple and lightweight WSGI_ micro web-framework for Python_. It is distributed as a single file module and has no dependencies other than the `Python Standard Library `_. 33 | 34 | * **Routing:** Requests to function-call mapping with support for clean and dynamic URLs. 35 | * **Templates:** Fast `built-in template engine `_ and support for mako_, jinja2_ and cheetah_ templates. 36 | * **Utilities:** Convenient access to form data, file uploads, cookies, headers and other HTTP features. 37 | * **Server:** Built-in development server and ready-to-use adapters for a wide range of WSGI_ capable HTTP server (e.g. gunicorn_, paste_ or cheroot_). 38 | 39 | 40 | Homepage and documentation: http://bottlepy.org 41 | 42 | 43 | Example: "Hello World" in a bottle 44 | ---------------------------------- 45 | 46 | .. code-block:: python 47 | 48 | from bottle import route, run, template 49 | 50 | @route('/hello/') 51 | def index(name): 52 | return template('Hello {{name}}!', name=name) 53 | 54 | run(host='localhost', port=8080) 55 | 56 | Run this script or paste it into a Python console, then point your browser to ``_. That's it. 57 | 58 | 59 | Download and Install 60 | -------------------- 61 | 62 | .. __: https://github.com/bottlepy/bottle/raw/master/bottle.py 63 | 64 | Install the latest stable release with ``pip install bottle`` or download `bottle.py`__ (unstable) into your project directory. There are no hard dependencies other than the Python standard library. 65 | 66 | License 67 | ------- 68 | 69 | .. __: https://github.com/bottlepy/bottle/raw/master/LICENSE 70 | 71 | Code and documentation are available according to the MIT License (see LICENSE__). 72 | 73 | The Bottle logo however is *NOT* covered by that license. It is allowed to use the logo as a link to the bottle homepage or in direct context with the unmodified library. In all other cases, please ask first. 74 | -------------------------------------------------------------------------------- /docs/_locale/.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | type = PO 4 | 5 | [bottle.development] 6 | file_filter = /LC_MESSAGES/development.po 7 | source_file = _pot/development.pot 8 | source_lang = en 9 | type = PO 10 | 11 | [bottle.index] 12 | file_filter = /LC_MESSAGES/index.po 13 | source_file = _pot/index.pot 14 | source_lang = en 15 | type = PO 16 | 17 | [bottle.configuration] 18 | file_filter = /LC_MESSAGES/configuration.po 19 | source_file = _pot/configuration.pot 20 | source_lang = en 21 | type = PO 22 | 23 | [bottle.changelog] 24 | file_filter = /LC_MESSAGES/changelog.po 25 | source_file = _pot/changelog.pot 26 | source_lang = en 27 | type = PO 28 | 29 | [bottle.stpl] 30 | file_filter = /LC_MESSAGES/stpl.po 31 | source_file = _pot/stpl.pot 32 | source_lang = en 33 | type = PO 34 | 35 | [bottle.async] 36 | file_filter = /LC_MESSAGES/async.po 37 | source_file = _pot/async.pot 38 | source_lang = en 39 | type = PO 40 | 41 | [bottle.recipes] 42 | file_filter = /LC_MESSAGES/recipes.po 43 | source_file = _pot/recipes.pot 44 | source_lang = en 45 | type = PO 46 | 47 | [bottle.tutorial] 48 | file_filter = /LC_MESSAGES/tutorial.po 49 | source_file = _pot/tutorial.pot 50 | source_lang = en 51 | type = PO 52 | 53 | [bottle.deployment] 54 | file_filter = /LC_MESSAGES/deployment.po 55 | source_file = _pot/deployment.pot 56 | source_lang = en 57 | type = PO 58 | 59 | [bottle.routing] 60 | file_filter = /LC_MESSAGES/routing.po 61 | source_file = _pot/routing.pot 62 | source_lang = en 63 | type = PO 64 | 65 | [bottle.api] 66 | file_filter = /LC_MESSAGES/api.po 67 | source_file = _pot/api.pot 68 | source_lang = en 69 | type = PO 70 | 71 | [bottle.tutorial_app] 72 | file_filter = /LC_MESSAGES/tutorial_app.po 73 | source_file = _pot/tutorial_app.pot 74 | source_lang = en 75 | type = PO 76 | 77 | [bottle.plugins] 78 | file_filter = /LC_MESSAGES/plugins.po 79 | source_file = _pot/plugins.pot 80 | source_lang = en 81 | type = PO 82 | 83 | [bottle.contact] 84 | file_filter = /LC_MESSAGES/contact.po 85 | source_file = _pot/contact.pot 86 | source_lang = en 87 | type = PO 88 | 89 | [bottle.faq] 90 | file_filter = /LC_MESSAGES/faq.po 91 | source_file = _pot/faq.pot 92 | source_lang = en 93 | type = PO 94 | 95 | [bottle.plugins--index] 96 | file_filter = /LC_MESSAGES/plugins/index.po 97 | source_file = _pot/plugins/index.pot 98 | source_lang = en 99 | type = PO 100 | 101 | -------------------------------------------------------------------------------- /docs/_locale/README.txt: -------------------------------------------------------------------------------- 1 | Translation Workflow 2 | ==================== 3 | 4 | If documentation changed, run `make push` to push new messages to transiflex (manager account required). 5 | 6 | To update the local translation files, call `make pull` and commit the changes from time to time (manager account required). 7 | 8 | Go to https://www.transifex.com/bottle for actually translating stuff. You can du that with a normal user account at transiflex. 9 | -------------------------------------------------------------------------------- /docs/_locale/_pot/contact.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Bottle 0.13-dev\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../contact.rst:3 20 | msgid "Contact" 21 | msgstr "" 22 | 23 | #: ../../contact.rst:6 24 | msgid "About the Author" 25 | msgstr "" 26 | 27 | #: ../../contact.rst:7 28 | msgid "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy behind this website. I'm 27 years old and studying computer science at the Georg-August-University in Göttingen, Germany. Python is my favorite language, but I also code in ruby and JavaScript a lot. Watch me on `twitter `_ or visit my profile at `GitHub `_ to get in contact. A `mailinglist `_ is open for Bottle related questions, too." 29 | msgstr "" 30 | 31 | #: ../../contact.rst:10 32 | msgid "About Bottle" 33 | msgstr "" 34 | 35 | #: ../../contact.rst:11 36 | msgid "This is my first open source project so far. It started and a small experiment but soon got so much positive feedback I decided to make something real out of it. Here it is." 37 | msgstr "" 38 | 39 | #: ../../contact.rst:14 40 | msgid "Impressum und Kontaktdaten" 41 | msgstr "" 42 | 43 | #: ../../contact.rst:15 44 | msgid "(This is required by `German law `_)" 45 | msgstr "" 46 | 47 | #: ../../contact.rst:17 48 | msgid "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist ausdrücklich untersagt." 49 | msgstr "" 50 | 51 | #: ../../contact.rst:22 52 | msgid "**Betreiber**: Marcel Hellkamp" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:23 56 | msgid "**Ort**: D - 37075 Göttingen" 57 | msgstr "" 58 | 59 | #: ../../contact.rst:24 60 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 61 | msgstr "" 62 | 63 | #: ../../contact.rst:25 64 | msgid "**Telefon**: +49 (0) 551 20005915" 65 | msgstr "" 66 | 67 | #: ../../contact.rst:26 68 | msgid "**E-Mail**: marc at gsites dot de" 69 | msgstr "" 70 | -------------------------------------------------------------------------------- /docs/_locale/_pot/faq.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Bottle 0.13-dev\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../faq.rst:10 20 | msgid "Frequently Asked Questions" 21 | msgstr "" 22 | 23 | #: ../../faq.rst:13 24 | msgid "About Bottle" 25 | msgstr "" 26 | 27 | #: ../../faq.rst:16 28 | msgid "Is bottle suitable for complex applications?" 29 | msgstr "" 30 | 31 | #: ../../faq.rst:18 32 | msgid "Bottle is a *micro* framework designed for prototyping and building small web applications and services. It stays out of your way and allows you to get things done fast, but misses some advanced features and ready-to-use solutions found in other frameworks (MVC, ORM, form validation, scaffolding, XML-RPC). Although it *is* possible to add these features and build complex applications with Bottle, you should consider using a full-stack Web framework like pylons_ or paste_ instead." 33 | msgstr "" 34 | 35 | #: ../../faq.rst:22 36 | msgid "Common Problems and Pitfalls" 37 | msgstr "" 38 | 39 | #: ../../faq.rst:29 40 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 41 | msgstr "" 42 | 43 | #: ../../faq.rst:31 44 | msgid "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ or mod_wsgi_ environment, the working directory (``./``) depends on your Apache settings. You should add an absolute path to the template search path::" 45 | msgstr "" 46 | 47 | #: ../../faq.rst:35 48 | msgid "so bottle searches the right paths." 49 | msgstr "" 50 | 51 | #: ../../faq.rst:38 52 | msgid "Dynamic Routes and Slashes" 53 | msgstr "" 54 | 55 | #: ../../faq.rst:40 56 | msgid "In :ref:`dynamic route syntax `, a placeholder token (````) matches everything up to the next slash. This equals to ``[^/]+`` in regular expression syntax. To accept slashes too, you have to add a custom regular pattern to the placeholder. An example: ``/images/`` would match ``/images/icons/error.png`` but ``/images/`` won't." 57 | msgstr "" 58 | 59 | #: ../../faq.rst:43 60 | msgid "Problems with reverse proxies" 61 | msgstr "" 62 | 63 | #: ../../faq.rst:45 64 | msgid "Redirects and url-building only works if bottle knows the public address and location of your application. If you run bottle locally behind a reverse proxy or load balancer, some information might get lost along the way. For example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect the local request by your proxy, not the real request by the client. Here is a small WSGI middleware snippet that helps to fix these values::" 65 | msgstr "" 66 | -------------------------------------------------------------------------------- /docs/_locale/_pot/index.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Bottle 0.13-dev\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../index.rst:20 20 | msgid "Bottle: Python Web Framework" 21 | msgstr "" 22 | 23 | #: ../../index.rst:22 24 | msgid "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for Python_. It is distributed as a single file module and has no dependencies other than the `Python Standard Library `_." 25 | msgstr "" 26 | 27 | #: ../../index.rst:25 28 | msgid "**Routing:** Requests to function-call mapping with support for clean and dynamic URLs." 29 | msgstr "" 30 | 31 | #: ../../index.rst:26 32 | msgid "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 33 | msgstr "" 34 | 35 | #: ../../index.rst:27 36 | msgid "**Utilities:** Convenient access to form data, file uploads, cookies, headers and other HTTP-related metadata." 37 | msgstr "" 38 | 39 | #: ../../index.rst:28 40 | msgid "**Server:** Built-in HTTP development server and support for paste_, bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 41 | msgstr "" 42 | 43 | #: ../../index.rst:31 44 | msgid "Example: \"Hello World\" in a bottle" 45 | msgstr "" 46 | 47 | #: ../../index.rst:42 48 | msgid "Run this script or paste it into a Python console, then point your browser to ``_. That's it." 49 | msgstr "" 50 | 51 | #: ../../index.rst:45 52 | msgid "Download and Install" 53 | msgstr "" 54 | 55 | #: ../../index.rst:48 56 | msgid "Install the latest stable release with ``pip install bottle`` or download `bottle.py`__ (unstable) into your project directory. There are no hard [1]_ dependencies other than the Python standard library. Bottle supports **Python 2.7 and Python 3**." 57 | msgstr "" 58 | 59 | #: ../../index.rst:50 60 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 61 | msgstr "" 62 | 63 | #: ../../index.rst:55 64 | msgid "User's Guide" 65 | msgstr "" 66 | 67 | #: ../../index.rst:56 68 | msgid "Start here if you want to learn how to use the bottle framework for web development. If you have any questions not answered here, feel free to ask the `mailing list `_." 69 | msgstr "" 70 | 71 | #: ../../index.rst:71 72 | msgid "Knowledge Base" 73 | msgstr "" 74 | 75 | #: ../../index.rst:72 76 | msgid "A collection of articles, guides and HOWTOs." 77 | msgstr "" 78 | 79 | #: ../../index.rst:84 80 | msgid "Development and Contribution" 81 | msgstr "" 82 | 83 | #: ../../index.rst:86 84 | msgid "These chapters are intended for developers interested in the bottle development and release workflow." 85 | msgstr "" 86 | 87 | #: ../../index.rst:103 88 | msgid "License" 89 | msgstr "" 90 | 91 | #: ../../index.rst:105 92 | msgid "Code and documentation are available according to the MIT License:" 93 | msgstr "" 94 | 95 | #: ../../index.rst:110 96 | msgid "The Bottle logo however is *NOT* covered by that license. It is allowed to use the logo as a link to the bottle homepage or in direct context with the unmodified library. In all other cases please ask first." 97 | msgstr "" 98 | 99 | #: ../../index.rst:115 100 | msgid "Footnotes" 101 | msgstr "" 102 | 103 | #: ../../index.rst:116 104 | msgid "Usage of the template or server adapter classes requires the corresponding template or server modules." 105 | msgstr "" 106 | -------------------------------------------------------------------------------- /docs/_locale/_pot/routing.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Bottle 0.13-dev\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../routing.rst:3 20 | msgid "Request Routing" 21 | msgstr "" 22 | 23 | #: ../../routing.rst:5 24 | msgid "Bottle uses a powerful routing engine to find the right callback for each request. The :ref:`tutorial ` shows you the basics. This document covers advanced techniques and rule mechanics in detail." 25 | msgstr "" 26 | 27 | #: ../../routing.rst:8 28 | msgid "Rule Syntax" 29 | msgstr "" 30 | 31 | #: ../../routing.rst:10 32 | msgid "The :class:`Router` distinguishes between two basic types of routes: **static routes** (e.g. ``/contact``) and **dynamic routes** (e.g. ``/hello/``). A route that contains one or more *wildcards* it is considered dynamic. All other routes are static." 33 | msgstr "" 34 | 35 | #: ../../routing.rst:14 36 | msgid "The simplest form of a wildcard consists of a name enclosed in angle brackets (e.g. ````). The name should be unique for a given route and form a valid python identifier (alphanumeric, starting with a letter). This is because wildcards are used as keyword arguments for the request callback later." 37 | msgstr "" 38 | 39 | #: ../../routing.rst:16 40 | msgid "Each wildcard matches one or more characters, but stops at the first slash (``/``). This equals a regular expression of ``[^/]+`` and ensures that only one path segment is matched and routes with more than one wildcard stay unambiguous." 41 | msgstr "" 42 | 43 | #: ../../routing.rst:18 44 | msgid "The rule ``//`` matches as follows:" 45 | msgstr "" 46 | 47 | #: ../../routing.rst:21 48 | msgid "Path" 49 | msgstr "" 50 | 51 | #: ../../routing.rst:21 52 | msgid "Result" 53 | msgstr "" 54 | 55 | #: ../../routing.rst:23 56 | msgid "/save/123" 57 | msgstr "" 58 | 59 | #: ../../routing.rst:23 60 | msgid "``{'action': 'save', 'item': '123'}``" 61 | msgstr "" 62 | 63 | #: ../../routing.rst:24 64 | msgid "/save/123/" 65 | msgstr "" 66 | 67 | #: ../../routing.rst:24 68 | #: ../../routing.rst:25 69 | #: ../../routing.rst:26 70 | msgid "`No Match`" 71 | msgstr "" 72 | 73 | #: ../../routing.rst:25 74 | msgid "/save/" 75 | msgstr "" 76 | 77 | #: ../../routing.rst:26 78 | msgid "//123" 79 | msgstr "" 80 | 81 | #: ../../routing.rst:29 82 | msgid "Is it possible to escape characters like colon ``:`` with a backslash ``\\``. This will prevent to trigger the old syntax in case you need to use ``:``. For example: the rule ``//item:`` triggers the old syntax, (see below) but ``/action/item\\:`` works as intended with the new syntax." 83 | msgstr "" 84 | 85 | #: ../../routing.rst:33 86 | msgid "You can change the exact behaviour in many ways using filters. This is described in the next section." 87 | msgstr "" 88 | 89 | #: ../../routing.rst:36 90 | msgid "Wildcard Filters" 91 | msgstr "" 92 | 93 | #: ../../routing.rst:40 94 | msgid "Filters are used to define more specific wildcards, and/or transform the matched part of the URL before it is passed to the callback. A filtered wildcard is declared as ```` or ````. The syntax for the optional config part depends on the filter used." 95 | msgstr "" 96 | 97 | #: ../../routing.rst:42 98 | msgid "The following standard filters are implemented:" 99 | msgstr "" 100 | 101 | #: ../../routing.rst:44 102 | msgid "**:int** matches (signed) digits and converts the value to integer." 103 | msgstr "" 104 | 105 | #: ../../routing.rst:45 106 | msgid "**:float** similar to :int but for decimal numbers." 107 | msgstr "" 108 | 109 | #: ../../routing.rst:46 110 | msgid "**:path** matches all characters including the slash character in a non-greedy way and may be used to match more than one path segment." 111 | msgstr "" 112 | 113 | #: ../../routing.rst:47 114 | msgid "**:re[:exp]** allows you to specify a custom regular expression in the config field. The matched value is not modified." 115 | msgstr "" 116 | 117 | #: ../../routing.rst:49 118 | msgid "You can add your own filters to the router. All you need is a function that returns three elements: A regular expression string, a callable to convert the URL fragment to a python value, and a callable that does the opposite. The filter function is called with the configuration string as the only parameter and may parse it as needed::" 119 | msgstr "" 120 | 121 | #: ../../routing.rst:75 122 | msgid "Legacy Syntax" 123 | msgstr "" 124 | 125 | #: ../../routing.rst:79 126 | msgid "The new rule syntax was introduce in **Bottle 0.10** to simplify some common use cases, but the old syntax still works and you can find lot code examples still using it. The differences are best described by example:" 127 | msgstr "" 128 | 129 | #: ../../routing.rst:82 130 | msgid "Old Syntax" 131 | msgstr "" 132 | 133 | #: ../../routing.rst:82 134 | msgid "New Syntax" 135 | msgstr "" 136 | 137 | #: ../../routing.rst:84 138 | msgid "``:name``" 139 | msgstr "" 140 | 141 | #: ../../routing.rst:84 142 | msgid "````" 143 | msgstr "" 144 | 145 | #: ../../routing.rst:85 146 | msgid "``:name#regexp#``" 147 | msgstr "" 148 | 149 | #: ../../routing.rst:85 150 | msgid "````" 151 | msgstr "" 152 | 153 | #: ../../routing.rst:86 154 | msgid "``:#regexp#``" 155 | msgstr "" 156 | 157 | #: ../../routing.rst:86 158 | msgid "``<:re:regexp>``" 159 | msgstr "" 160 | 161 | #: ../../routing.rst:87 162 | msgid "``:##``" 163 | msgstr "" 164 | 165 | #: ../../routing.rst:87 166 | msgid "``<:re>``" 167 | msgstr "" 168 | 169 | #: ../../routing.rst:90 170 | msgid "Try to avoid the old syntax in future projects if you can. It is not currently deprecated, but will be eventually." 171 | msgstr "" 172 | 173 | #: ../../routing.rst:95 174 | msgid "Explicit routing configuration" 175 | msgstr "" 176 | 177 | #: ../../routing.rst:97 178 | msgid "Route decorator can also be directly called as method. This way provides flexibility in complex setups, allowing you to directly control, when and how routing configuration done." 179 | msgstr "" 180 | 181 | #: ../../routing.rst:99 182 | msgid "Here is a basic example of explicit routing configuration for default bottle application::" 183 | msgstr "" 184 | 185 | #: ../../routing.rst:105 186 | msgid "In fact, any :class:`Bottle` instance routing can be configured same way::" 187 | msgstr "" 188 | -------------------------------------------------------------------------------- /docs/_locale/de_DE/LC_MESSAGES/contact.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Charles LeMagne, 2017 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: bottle\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 13 | "Last-Translator: defnull \n" 14 | "Language-Team: German (Germany) (http://www.transifex.com/bottle/bottle/language/de_DE/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: de_DE\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: ../../contact.rst:3 22 | msgid "Contact" 23 | msgstr "" 24 | 25 | #: ../../contact.rst:6 26 | msgid "About the Author" 27 | msgstr "" 28 | 29 | #: ../../contact.rst:7 30 | msgid "" 31 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 32 | "behind this website. I'm 27 years old and studying computer science at the " 33 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 34 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 35 | " `_ or visit my profile at `GitHub " 36 | "`_ to get in contact. A `mailinglist " 37 | "`_ is open for Bottle related " 38 | "questions, too." 39 | msgstr "" 40 | 41 | #: ../../contact.rst:10 42 | msgid "About Bottle" 43 | msgstr "Über Bottle" 44 | 45 | #: ../../contact.rst:11 46 | msgid "" 47 | "This is my first open source project so far. It started and a small " 48 | "experiment but soon got so much positive feedback I decided to make " 49 | "something real out of it. Here it is." 50 | msgstr "Dies ist soweit mein erstes Open Source Projekt." 51 | 52 | #: ../../contact.rst:14 53 | msgid "Impressum und Kontaktdaten" 54 | msgstr "" 55 | 56 | #: ../../contact.rst:15 57 | msgid "" 58 | "(This is required by `German law " 59 | "`_)" 60 | msgstr "" 61 | 62 | #: ../../contact.rst:17 63 | msgid "" 64 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 65 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 66 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 67 | "ausdrücklich untersagt." 68 | msgstr "" 69 | 70 | #: ../../contact.rst:22 71 | msgid "**Betreiber**: Marcel Hellkamp" 72 | msgstr "" 73 | 74 | #: ../../contact.rst:23 75 | msgid "**Ort**: D - 37075 Göttingen" 76 | msgstr "" 77 | 78 | #: ../../contact.rst:24 79 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 80 | msgstr "" 81 | 82 | #: ../../contact.rst:25 83 | msgid "**Telefon**: +49 (0) 551 20005915" 84 | msgstr "" 85 | 86 | #: ../../contact.rst:26 87 | msgid "**E-Mail**: marc at gsites dot de" 88 | msgstr "" 89 | -------------------------------------------------------------------------------- /docs/_locale/de_DE/LC_MESSAGES/faq.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Charles LeMagne, 2017 7 | # Charles LeMagne, 2017 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: bottle\n" 11 | "Report-Msgid-Bugs-To: \n" 12 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 13 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 14 | "Last-Translator: defnull \n" 15 | "Language-Team: German (Germany) (http://www.transifex.com/bottle/bottle/language/de_DE/)\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Language: de_DE\n" 20 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 21 | 22 | #: ../../faq.rst:10 23 | msgid "Frequently Asked Questions" 24 | msgstr "Häufig gestellte Fragen" 25 | 26 | #: ../../faq.rst:13 27 | msgid "About Bottle" 28 | msgstr "Über Bottle" 29 | 30 | #: ../../faq.rst:16 31 | msgid "Is bottle suitable for complex applications?" 32 | msgstr "Ist Bottle für komplexe Anwendungen geeignet?" 33 | 34 | #: ../../faq.rst:18 35 | msgid "" 36 | "Bottle is a *micro* framework designed for prototyping and building small " 37 | "web applications and services. It stays out of your way and allows you to " 38 | "get things done fast, but misses some advanced features and ready-to-use " 39 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 40 | " XML-RPC). Although it *is* possible to add these features and build complex" 41 | " applications with Bottle, you should consider using a full-stack Web " 42 | "framework like pylons_ or paste_ instead." 43 | msgstr "Bottle ist ein *micro*-Framework, entworfen für Prototyping und kleine Webanwendungen und -services.\nEs hält sich im Hintergrund und erlaubt es dir die Dinge schnell erledigt zu bekommen, ihm fehlen allerdings einige fortgeschnittenere Eigenschaften und ready-to-use Lösungen wie sie in anderen Frameworks zu finden sind (MVC, ORM, Formularvalidierung, Scaffolding, CML-RPC). Auch *wenn* es möglich ist diese hinzuzufügen und komplexere Anwendungen mit Bottle zu entwickeln, solltest du in Betracht ziehen ein vollwertiges Web-Framework wie pylons oder paste zu benutzen." 44 | 45 | #: ../../faq.rst:22 46 | msgid "Common Problems and Pitfalls" 47 | msgstr "Häufige Probleme und Fallstricke" 48 | 49 | #: ../../faq.rst:29 50 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 51 | msgstr "\"Template nicht gefunden\" in mod_wsgi/mod_python" 52 | 53 | #: ../../faq.rst:31 54 | msgid "" 55 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 56 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 57 | "Apache settings. You should add an absolute path to the template search " 58 | "path::" 59 | msgstr "Bottle sucht in ``./`` und ``./views/`` nach Templates. In einer mod_python_ oder mod_wsgi_ Umgebung hängt das Arbeitsverzeichnis (``./``) von deinen Apache Einstellungen ab. Du solltest dem Templatepfad einen absoluten Pfad hinzufügen" 60 | 61 | #: ../../faq.rst:35 62 | msgid "so bottle searches the right paths." 63 | msgstr "damit Bottle den richtigen Pfad nutzt." 64 | 65 | #: ../../faq.rst:38 66 | msgid "Dynamic Routes and Slashes" 67 | msgstr "Dynamische Routen und Schrägstriche" 68 | 69 | #: ../../faq.rst:40 70 | msgid "" 71 | "In :ref:`dynamic route syntax `, a placeholder " 72 | "token (````) matches everything up to the next slash. This equals to " 73 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 74 | "add a custom regular pattern to the placeholder. An example: " 75 | "``/images/`` would match ``/images/icons/error.png`` but " 76 | "``/images/`` won't." 77 | msgstr "" 78 | 79 | #: ../../faq.rst:43 80 | msgid "Problems with reverse proxies" 81 | msgstr "Probleme mit Reverse-Proxies" 82 | 83 | #: ../../faq.rst:45 84 | msgid "" 85 | "Redirects and url-building only works if bottle knows the public address and" 86 | " location of your application. If you run bottle locally behind a reverse " 87 | "proxy or load balancer, some information might get lost along the way. For " 88 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 89 | "the local request by your proxy, not the real request by the client. Here is" 90 | " a small WSGI middleware snippet that helps to fix these values::" 91 | msgstr "Umleitungen und URL-building funktioniert nur wenn Bottle die öffentliche Adresse und den Ort deiner Anwendung kennt. Nutzt du Bottle lokal hinter einem Reverse-Proxie oder einem Load-Balancer können auf dem Weg Informationen verloren gehen.\nZum Beispiel könnte der ``wsgi.url_scheme``-Wert oder der ``Host``-Header die lokale Anfrage deines Proxys widerspiegeln und nicht die echte Anfrage des Clients.\nHier ist eine kleines WSGI-Middleware Snipptes welches dir hilft diese Werte zu korrigieren:" 92 | -------------------------------------------------------------------------------- /docs/_locale/de_DE/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: German (Germany) (http://www.transifex.com/bottle/bottle/language/de_DE/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: de_DE\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: ../../index.rst:20 21 | msgid "Bottle: Python Web Framework" 22 | msgstr "" 23 | 24 | #: ../../index.rst:22 25 | msgid "" 26 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 27 | "Python_. It is distributed as a single file module and has no dependencies " 28 | "other than the `Python Standard Library `_." 29 | msgstr "" 30 | 31 | #: ../../index.rst:25 32 | msgid "" 33 | "**Routing:** Requests to function-call mapping with support for clean and " 34 | "dynamic URLs." 35 | msgstr "" 36 | 37 | #: ../../index.rst:26 38 | msgid "" 39 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 41 | msgstr "" 42 | 43 | #: ../../index.rst:27 44 | msgid "" 45 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 46 | "headers and other HTTP-related metadata." 47 | msgstr "" 48 | 49 | #: ../../index.rst:28 50 | msgid "" 51 | "**Server:** Built-in HTTP development server and support for paste_, " 52 | "bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 53 | msgstr "" 54 | 55 | #: ../../index.rst:31 56 | msgid "Example: \"Hello World\" in a bottle" 57 | msgstr "" 58 | 59 | #: ../../index.rst:42 60 | msgid "" 61 | "Run this script or paste it into a Python console, then point your browser " 62 | "to ``_. That's it." 63 | msgstr "" 64 | 65 | #: ../../index.rst:45 66 | msgid "Download and Install" 67 | msgstr "" 68 | 69 | #: ../../index.rst:48 70 | msgid "" 71 | "Install the latest stable release with ``pip install bottle`` or download " 72 | "`bottle.py`__ (unstable) into your project directory. There are no hard [1]_" 73 | " dependencies other than the Python standard library. Bottle supports " 74 | "**Python 2.7 and Python 3**." 75 | msgstr "" 76 | 77 | #: ../../index.rst:50 78 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 79 | msgstr "" 80 | 81 | #: ../../index.rst:55 82 | msgid "User's Guide" 83 | msgstr "" 84 | 85 | #: ../../index.rst:56 86 | msgid "" 87 | "Start here if you want to learn how to use the bottle framework for web " 88 | "development. If you have any questions not answered here, feel free to ask " 89 | "the `mailing list `_." 90 | msgstr "" 91 | 92 | #: ../../index.rst:71 93 | msgid "Knowledge Base" 94 | msgstr "" 95 | 96 | #: ../../index.rst:72 97 | msgid "A collection of articles, guides and HOWTOs." 98 | msgstr "" 99 | 100 | #: ../../index.rst:84 101 | msgid "Development and Contribution" 102 | msgstr "" 103 | 104 | #: ../../index.rst:86 105 | msgid "" 106 | "These chapters are intended for developers interested in the bottle " 107 | "development and release workflow." 108 | msgstr "" 109 | 110 | #: ../../index.rst:103 111 | msgid "License" 112 | msgstr "" 113 | 114 | #: ../../index.rst:105 115 | msgid "Code and documentation are available according to the MIT License:" 116 | msgstr "" 117 | 118 | #: ../../index.rst:110 119 | msgid "" 120 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 121 | "use the logo as a link to the bottle homepage or in direct context with the " 122 | "unmodified library. In all other cases please ask first." 123 | msgstr "" 124 | 125 | #: ../../index.rst:115 126 | msgid "Footnotes" 127 | msgstr "" 128 | 129 | #: ../../index.rst:116 130 | msgid "" 131 | "Usage of the template or server adapter classes requires the corresponding " 132 | "template or server modules." 133 | msgstr "" 134 | -------------------------------------------------------------------------------- /docs/_locale/fr/LC_MESSAGES/contact.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Ibrahim DERRAZ , 2017 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: bottle\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 13 | "Last-Translator: defnull \n" 14 | "Language-Team: French (http://www.transifex.com/bottle/bottle/language/fr/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: fr\n" 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 20 | 21 | #: ../../contact.rst:3 22 | msgid "Contact" 23 | msgstr "Contact" 24 | 25 | #: ../../contact.rst:6 26 | msgid "About the Author" 27 | msgstr "" 28 | 29 | #: ../../contact.rst:7 30 | msgid "" 31 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 32 | "behind this website. I'm 27 years old and studying computer science at the " 33 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 34 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 35 | " `_ or visit my profile at `GitHub " 36 | "`_ to get in contact. A `mailinglist " 37 | "`_ is open for Bottle related " 38 | "questions, too." 39 | msgstr "Bonjour, je suis *Marcel Hellkamp* (alias *defnull*), développeur de Bottle, et la personne derrière ce site. J'ans 27 ans et j’étudie l’informatique à l’université Georg-August-University à Göttingen en Allemagne. Python est mon langage préféré, mais je code aussi en Ruby et JavaScript. Suivez moi sur `twitter `_ ou visitez mon profil sur `GitHub `_ . Une `mailinglist `_ est disponible pour toutes les questions liés à Bottle" 40 | 41 | #: ../../contact.rst:10 42 | msgid "About Bottle" 43 | msgstr "À propos de Bottle" 44 | 45 | #: ../../contact.rst:11 46 | msgid "" 47 | "This is my first open source project so far. It started and a small " 48 | "experiment but soon got so much positive feedback I decided to make " 49 | "something real out of it. Here it is." 50 | msgstr "Il s'agit de mon premier projet open-source. Il s’agissait d'un projet d'expérimentation, mais grâce à tout vos retours positifs, j'ai décidé d'en faire un projet sérieux. Et le voilà." 51 | 52 | #: ../../contact.rst:14 53 | msgid "Impressum und Kontaktdaten" 54 | msgstr "Impressum und Kontaktdaten" 55 | 56 | #: ../../contact.rst:15 57 | msgid "" 58 | "(This is required by `German law " 59 | "`_)" 60 | msgstr "(Requis par la `loi Allemande `_)" 61 | 62 | #: ../../contact.rst:17 63 | msgid "" 64 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 65 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 66 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 67 | "ausdrücklich untersagt." 68 | msgstr "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist ausdrücklich untersagt." 69 | 70 | #: ../../contact.rst:22 71 | msgid "**Betreiber**: Marcel Hellkamp" 72 | msgstr "**Betreiber**: Marcel Hellkamp" 73 | 74 | #: ../../contact.rst:23 75 | msgid "**Ort**: D - 37075 Göttingen" 76 | msgstr "**Ort**: D - 37075 Göttingen" 77 | 78 | #: ../../contact.rst:24 79 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 80 | msgstr "**Strasse**: Theodor-Heuss Strasse 13" 81 | 82 | #: ../../contact.rst:25 83 | msgid "**Telefon**: +49 (0) 551 20005915" 84 | msgstr "**Telefon**: +49 (0) 551 20005915" 85 | 86 | #: ../../contact.rst:26 87 | msgid "**E-Mail**: marc at gsites dot de" 88 | msgstr "**E-Mail**: marc at gsites dot de" 89 | -------------------------------------------------------------------------------- /docs/_locale/fr/LC_MESSAGES/faq.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: French (http://www.transifex.com/bottle/bottle/language/fr/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: fr\n" 18 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 | 20 | #: ../../faq.rst:10 21 | msgid "Frequently Asked Questions" 22 | msgstr "" 23 | 24 | #: ../../faq.rst:13 25 | msgid "About Bottle" 26 | msgstr "À propos de Bottle" 27 | 28 | #: ../../faq.rst:16 29 | msgid "Is bottle suitable for complex applications?" 30 | msgstr "" 31 | 32 | #: ../../faq.rst:18 33 | msgid "" 34 | "Bottle is a *micro* framework designed for prototyping and building small " 35 | "web applications and services. It stays out of your way and allows you to " 36 | "get things done fast, but misses some advanced features and ready-to-use " 37 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 38 | " XML-RPC). Although it *is* possible to add these features and build complex" 39 | " applications with Bottle, you should consider using a full-stack Web " 40 | "framework like pylons_ or paste_ instead." 41 | msgstr "" 42 | 43 | #: ../../faq.rst:22 44 | msgid "Common Problems and Pitfalls" 45 | msgstr "" 46 | 47 | #: ../../faq.rst:29 48 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 49 | msgstr "" 50 | 51 | #: ../../faq.rst:31 52 | msgid "" 53 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 54 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 55 | "Apache settings. You should add an absolute path to the template search " 56 | "path::" 57 | msgstr "" 58 | 59 | #: ../../faq.rst:35 60 | msgid "so bottle searches the right paths." 61 | msgstr "" 62 | 63 | #: ../../faq.rst:38 64 | msgid "Dynamic Routes and Slashes" 65 | msgstr "" 66 | 67 | #: ../../faq.rst:40 68 | msgid "" 69 | "In :ref:`dynamic route syntax `, a placeholder " 70 | "token (````) matches everything up to the next slash. This equals to " 71 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 72 | "add a custom regular pattern to the placeholder. An example: " 73 | "``/images/`` would match ``/images/icons/error.png`` but " 74 | "``/images/`` won't." 75 | msgstr "" 76 | 77 | #: ../../faq.rst:43 78 | msgid "Problems with reverse proxies" 79 | msgstr "" 80 | 81 | #: ../../faq.rst:45 82 | msgid "" 83 | "Redirects and url-building only works if bottle knows the public address and" 84 | " location of your application. If you run bottle locally behind a reverse " 85 | "proxy or load balancer, some information might get lost along the way. For " 86 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 87 | "the local request by your proxy, not the real request by the client. Here is" 88 | " a small WSGI middleware snippet that helps to fix these values::" 89 | msgstr "" 90 | -------------------------------------------------------------------------------- /docs/_locale/fr/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Ibrahim DERRAZ , 2017 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: bottle\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 13 | "Last-Translator: defnull \n" 14 | "Language-Team: French (http://www.transifex.com/bottle/bottle/language/fr/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: fr\n" 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 20 | 21 | #: ../../index.rst:20 22 | msgid "Bottle: Python Web Framework" 23 | msgstr "" 24 | 25 | #: ../../index.rst:22 26 | msgid "" 27 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 28 | "Python_. It is distributed as a single file module and has no dependencies " 29 | "other than the `Python Standard Library `_." 30 | msgstr "" 31 | 32 | #: ../../index.rst:25 33 | msgid "" 34 | "**Routing:** Requests to function-call mapping with support for clean and " 35 | "dynamic URLs." 36 | msgstr "" 37 | 38 | #: ../../index.rst:26 39 | msgid "" 40 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 42 | msgstr "" 43 | 44 | #: ../../index.rst:27 45 | msgid "" 46 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 47 | "headers and other HTTP-related metadata." 48 | msgstr "" 49 | 50 | #: ../../index.rst:28 51 | msgid "" 52 | "**Server:** Built-in HTTP development server and support for paste_, " 53 | "bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 54 | msgstr "" 55 | 56 | #: ../../index.rst:31 57 | msgid "Example: \"Hello World\" in a bottle" 58 | msgstr "Exemple: \"Hello World\" dans une bottle" 59 | 60 | #: ../../index.rst:42 61 | msgid "" 62 | "Run this script or paste it into a Python console, then point your browser " 63 | "to ``_. That's it." 64 | msgstr "Executez ce script ou coller le dans une console Python, puis rendez vous sur ``_ dans votre navigateur. Et voilà." 65 | 66 | #: ../../index.rst:45 67 | msgid "Download and Install" 68 | msgstr "Téléchargement et installation" 69 | 70 | #: ../../index.rst:48 71 | msgid "" 72 | "Install the latest stable release with ``pip install bottle`` or download " 73 | "`bottle.py`__ (unstable) into your project directory. There are no hard [1]_" 74 | " dependencies other than the Python standard library. Bottle supports " 75 | "**Python 2.7 and Python 3**." 76 | msgstr "" 77 | 78 | #: ../../index.rst:50 79 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 80 | msgstr "" 81 | 82 | #: ../../index.rst:55 83 | msgid "User's Guide" 84 | msgstr "Guide de l'utilisateur" 85 | 86 | #: ../../index.rst:56 87 | msgid "" 88 | "Start here if you want to learn how to use the bottle framework for web " 89 | "development. If you have any questions not answered here, feel free to ask " 90 | "the `mailing list `_." 91 | msgstr "" 92 | 93 | #: ../../index.rst:71 94 | msgid "Knowledge Base" 95 | msgstr "" 96 | 97 | #: ../../index.rst:72 98 | msgid "A collection of articles, guides and HOWTOs." 99 | msgstr "" 100 | 101 | #: ../../index.rst:84 102 | msgid "Development and Contribution" 103 | msgstr "" 104 | 105 | #: ../../index.rst:86 106 | msgid "" 107 | "These chapters are intended for developers interested in the bottle " 108 | "development and release workflow." 109 | msgstr "" 110 | 111 | #: ../../index.rst:103 112 | msgid "License" 113 | msgstr "Licence" 114 | 115 | #: ../../index.rst:105 116 | msgid "Code and documentation are available according to the MIT License:" 117 | msgstr "Le code et la documentation sont disponibles conformément à la licence MIT:" 118 | 119 | #: ../../index.rst:110 120 | msgid "" 121 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 122 | "use the logo as a link to the bottle homepage or in direct context with the " 123 | "unmodified library. In all other cases please ask first." 124 | msgstr "" 125 | 126 | #: ../../index.rst:115 127 | msgid "Footnotes" 128 | msgstr "" 129 | 130 | #: ../../index.rst:116 131 | msgid "" 132 | "Usage of the template or server adapter classes requires the corresponding " 133 | "template or server modules." 134 | msgstr "" 135 | -------------------------------------------------------------------------------- /docs/_locale/ja_JP/LC_MESSAGES/contact.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Japanese (Japan) (http://www.transifex.com/bottle/bottle/language/ja_JP/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ja_JP\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: ../../contact.rst:3 21 | msgid "Contact" 22 | msgstr "" 23 | 24 | #: ../../contact.rst:6 25 | msgid "About the Author" 26 | msgstr "" 27 | 28 | #: ../../contact.rst:7 29 | msgid "" 30 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 31 | "behind this website. I'm 27 years old and studying computer science at the " 32 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 33 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 34 | " `_ or visit my profile at `GitHub " 35 | "`_ to get in contact. A `mailinglist " 36 | "`_ is open for Bottle related " 37 | "questions, too." 38 | msgstr "" 39 | 40 | #: ../../contact.rst:10 41 | msgid "About Bottle" 42 | msgstr "" 43 | 44 | #: ../../contact.rst:11 45 | msgid "" 46 | "This is my first open source project so far. It started and a small " 47 | "experiment but soon got so much positive feedback I decided to make " 48 | "something real out of it. Here it is." 49 | msgstr "" 50 | 51 | #: ../../contact.rst:14 52 | msgid "Impressum und Kontaktdaten" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:15 56 | msgid "" 57 | "(This is required by `German law " 58 | "`_)" 59 | msgstr "" 60 | 61 | #: ../../contact.rst:17 62 | msgid "" 63 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 64 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 65 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 66 | "ausdrücklich untersagt." 67 | msgstr "" 68 | 69 | #: ../../contact.rst:22 70 | msgid "**Betreiber**: Marcel Hellkamp" 71 | msgstr "" 72 | 73 | #: ../../contact.rst:23 74 | msgid "**Ort**: D - 37075 Göttingen" 75 | msgstr "" 76 | 77 | #: ../../contact.rst:24 78 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 79 | msgstr "" 80 | 81 | #: ../../contact.rst:25 82 | msgid "**Telefon**: +49 (0) 551 20005915" 83 | msgstr "" 84 | 85 | #: ../../contact.rst:26 86 | msgid "**E-Mail**: marc at gsites dot de" 87 | msgstr "" 88 | -------------------------------------------------------------------------------- /docs/_locale/ja_JP/LC_MESSAGES/faq.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Japanese (Japan) (http://www.transifex.com/bottle/bottle/language/ja_JP/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ja_JP\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: ../../faq.rst:10 21 | msgid "Frequently Asked Questions" 22 | msgstr "" 23 | 24 | #: ../../faq.rst:13 25 | msgid "About Bottle" 26 | msgstr "" 27 | 28 | #: ../../faq.rst:16 29 | msgid "Is bottle suitable for complex applications?" 30 | msgstr "" 31 | 32 | #: ../../faq.rst:18 33 | msgid "" 34 | "Bottle is a *micro* framework designed for prototyping and building small " 35 | "web applications and services. It stays out of your way and allows you to " 36 | "get things done fast, but misses some advanced features and ready-to-use " 37 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 38 | " XML-RPC). Although it *is* possible to add these features and build complex" 39 | " applications with Bottle, you should consider using a full-stack Web " 40 | "framework like pylons_ or paste_ instead." 41 | msgstr "" 42 | 43 | #: ../../faq.rst:22 44 | msgid "Common Problems and Pitfalls" 45 | msgstr "" 46 | 47 | #: ../../faq.rst:29 48 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 49 | msgstr "" 50 | 51 | #: ../../faq.rst:31 52 | msgid "" 53 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 54 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 55 | "Apache settings. You should add an absolute path to the template search " 56 | "path::" 57 | msgstr "" 58 | 59 | #: ../../faq.rst:35 60 | msgid "so bottle searches the right paths." 61 | msgstr "" 62 | 63 | #: ../../faq.rst:38 64 | msgid "Dynamic Routes and Slashes" 65 | msgstr "" 66 | 67 | #: ../../faq.rst:40 68 | msgid "" 69 | "In :ref:`dynamic route syntax `, a placeholder " 70 | "token (````) matches everything up to the next slash. This equals to " 71 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 72 | "add a custom regular pattern to the placeholder. An example: " 73 | "``/images/`` would match ``/images/icons/error.png`` but " 74 | "``/images/`` won't." 75 | msgstr "" 76 | 77 | #: ../../faq.rst:43 78 | msgid "Problems with reverse proxies" 79 | msgstr "" 80 | 81 | #: ../../faq.rst:45 82 | msgid "" 83 | "Redirects and url-building only works if bottle knows the public address and" 84 | " location of your application. If you run bottle locally behind a reverse " 85 | "proxy or load balancer, some information might get lost along the way. For " 86 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 87 | "the local request by your proxy, not the real request by the client. Here is" 88 | " a small WSGI middleware snippet that helps to fix these values::" 89 | msgstr "" 90 | -------------------------------------------------------------------------------- /docs/_locale/ja_JP/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Manabu Shimohira , 2017 7 | # taisa007 , 2016 8 | # taisa007 , 2016 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: bottle\n" 12 | "Report-Msgid-Bugs-To: \n" 13 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 14 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 15 | "Last-Translator: defnull \n" 16 | "Language-Team: Japanese (Japan) (http://www.transifex.com/bottle/bottle/language/ja_JP/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: ja_JP\n" 21 | "Plural-Forms: nplurals=1; plural=0;\n" 22 | 23 | #: ../../index.rst:20 24 | msgid "Bottle: Python Web Framework" 25 | msgstr "Bottle: Python Webフレームワーク" 26 | 27 | #: ../../index.rst:22 28 | msgid "" 29 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 30 | "Python_. It is distributed as a single file module and has no dependencies " 31 | "other than the `Python Standard Library `_." 32 | msgstr "BottleはPython製の早くてシンプルでライトウェイトなWSGIマイクロWebフレームワークです。Bottleは1つのファイルで構成されていて、Pythonの標準ライブラリには依存していません。" 33 | 34 | #: ../../index.rst:25 35 | msgid "" 36 | "**Routing:** Requests to function-call mapping with support for clean and " 37 | "dynamic URLs." 38 | msgstr "**ルーティング:** リクエストをファンクションとマッピングします。また、ダイナミックURLもサポートしています。" 39 | 40 | #: ../../index.rst:26 41 | msgid "" 42 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 44 | msgstr "**テンプレート:** Pythonのビルドインテンプレートやmako、jinja2、cheetahテンプレートをサポートしています。" 45 | 46 | #: ../../index.rst:27 47 | msgid "" 48 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 49 | "headers and other HTTP-related metadata." 50 | msgstr "ファイルアップロートやクッキー、ヘッダー、その他HTTPに関連するデータに簡単にアクセスすることが可能です。" 51 | 52 | #: ../../index.rst:28 53 | msgid "" 54 | "**Server:** Built-in HTTP development server and support for paste_, " 55 | "bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 56 | msgstr "" 57 | 58 | #: ../../index.rst:31 59 | msgid "Example: \"Hello World\" in a bottle" 60 | msgstr "例: Bottleによる \"Hello World\"" 61 | 62 | #: ../../index.rst:42 63 | msgid "" 64 | "Run this script or paste it into a Python console, then point your browser " 65 | "to ``_. That's it." 66 | msgstr "このスクリプトを実行するかPythonコンソールに貼り付けて実行し、ブラウザに次のURLを入力してください。``" 67 | 68 | #: ../../index.rst:45 69 | msgid "Download and Install" 70 | msgstr "ダウンロードとインストール" 71 | 72 | #: ../../index.rst:48 73 | msgid "" 74 | "Install the latest stable release with ``pip install bottle`` or download " 75 | "`bottle.py`__ (unstable) into your project directory. There are no hard [1]_" 76 | " dependencies other than the Python standard library. Bottle supports " 77 | "**Python 2.7 and Python 3**." 78 | msgstr "" 79 | 80 | #: ../../index.rst:50 81 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 82 | msgstr "" 83 | 84 | #: ../../index.rst:55 85 | msgid "User's Guide" 86 | msgstr "ユーザーズガイド" 87 | 88 | #: ../../index.rst:56 89 | msgid "" 90 | "Start here if you want to learn how to use the bottle framework for web " 91 | "development. If you have any questions not answered here, feel free to ask " 92 | "the `mailing list `_." 93 | msgstr "Bottleの使い方はここから調べることができます。ここで分からないことについてはメーリングリスト``_で質問してください。" 94 | 95 | #: ../../index.rst:71 96 | msgid "Knowledge Base" 97 | msgstr "ナレッジベース" 98 | 99 | #: ../../index.rst:72 100 | msgid "A collection of articles, guides and HOWTOs." 101 | msgstr "Bottleに関する記事や使い方のノウハウ集です。" 102 | 103 | #: ../../index.rst:84 104 | msgid "Development and Contribution" 105 | msgstr "コントリビューション" 106 | 107 | #: ../../index.rst:86 108 | msgid "" 109 | "These chapters are intended for developers interested in the bottle " 110 | "development and release workflow." 111 | msgstr "このチャプターはBottleの開発やリリースワークフローに興味のある人向けのコンテンツです。" 112 | 113 | #: ../../index.rst:103 114 | msgid "License" 115 | msgstr "ライセンス" 116 | 117 | #: ../../index.rst:105 118 | msgid "Code and documentation are available according to the MIT License:" 119 | msgstr "コードとドキュメントはMITライセンスに応じてご利用いただけます" 120 | 121 | #: ../../index.rst:110 122 | msgid "" 123 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 124 | "use the logo as a link to the bottle homepage or in direct context with the " 125 | "unmodified library. In all other cases please ask first." 126 | msgstr "Bottleロゴの利用はライセンスによって制限されていない為、Bottleのホームページへのリンクなどにご利用いただけます。" 127 | 128 | #: ../../index.rst:115 129 | msgid "Footnotes" 130 | msgstr "脚注" 131 | 132 | #: ../../index.rst:116 133 | msgid "" 134 | "Usage of the template or server adapter classes requires the corresponding " 135 | "template or server modules." 136 | msgstr "テンプレートやサーバーアダプタークラスの使用方法は、対応するテンプレートやサーバーモジュールが必要です。" 137 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/_pot/contact.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../contact.rst:3 15 | msgid "Contact" 16 | msgstr "" 17 | 18 | #: ../../contact.rst:6 19 | msgid "About the Autor" 20 | msgstr "" 21 | 22 | #: ../../contact.rst:7 23 | msgid "" 24 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 25 | "behind this website. I'm 27 years old and studying computer science at the " 26 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 27 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 28 | " `_ or visit my profile at `GitHub " 29 | "`_ to get in contact. A `mailinglist " 30 | "`_ is open for Bottle related " 31 | "questions, too." 32 | msgstr "" 33 | 34 | #: ../../contact.rst:10 35 | msgid "About Bottle" 36 | msgstr "" 37 | 38 | #: ../../contact.rst:11 39 | msgid "" 40 | "This is my first open source project so far. It started and a small " 41 | "experiment but soon got so much positive feedback I decided to make " 42 | "something real out of it. Here it is." 43 | msgstr "" 44 | 45 | #: ../../contact.rst:14 46 | msgid "Impressum und Kontaktdaten" 47 | msgstr "" 48 | 49 | #: ../../contact.rst:15 50 | msgid "" 51 | "(This is required by `German law " 52 | "`_)" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:17 56 | msgid "" 57 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 58 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 59 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 60 | "ausdrücklich untersagt." 61 | msgstr "" 62 | 63 | #: ../../contact.rst:22 64 | msgid "**Betreiber**: Marcel Hellkamp" 65 | msgstr "" 66 | 67 | #: ../../contact.rst:23 68 | msgid "**Ort**: D - 37075 Göttingen" 69 | msgstr "" 70 | 71 | #: ../../contact.rst:24 72 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 73 | msgstr "" 74 | 75 | #: ../../contact.rst:25 76 | msgid "**Telefon**: +49 (0) 551 20005915" 77 | msgstr "" 78 | 79 | #: ../../contact.rst:26 80 | msgid "**E-Mail**: marc at gsites dot de" 81 | msgstr "" 82 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/_pot/faq.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../faq.rst:10 15 | msgid "Frequently Asked Questions" 16 | msgstr "" 17 | 18 | #: ../../faq.rst:13 19 | msgid "About Bottle" 20 | msgstr "" 21 | 22 | #: ../../faq.rst:16 23 | msgid "Is bottle suitable for complex applications?" 24 | msgstr "" 25 | 26 | #: ../../faq.rst:18 27 | msgid "" 28 | "Bottle is a *micro* framework designed for prototyping and building small " 29 | "web applications and services. It stays out of your way and allows you to " 30 | "get things done fast, but misses some advanced features and ready-to-use " 31 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 32 | " XML-RPC). Although it *is* possible to add these features and build complex" 33 | " applications with Bottle, you should consider using a full-stack Web " 34 | "framework like pylons_ or paste_ instead." 35 | msgstr "" 36 | 37 | #: ../../faq.rst:22 38 | msgid "Common Problems and Pitfalls" 39 | msgstr "" 40 | 41 | #: ../../faq.rst:29 42 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 43 | msgstr "" 44 | 45 | #: ../../faq.rst:31 46 | msgid "" 47 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 48 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 49 | "Apache settings. You should add an absolute path to the template search " 50 | "path::" 51 | msgstr "" 52 | 53 | #: ../../faq.rst:35 54 | msgid "so bottle searches the right paths." 55 | msgstr "" 56 | 57 | #: ../../faq.rst:38 58 | msgid "Dynamic Routes and Slashes" 59 | msgstr "" 60 | 61 | #: ../../faq.rst:40 62 | msgid "" 63 | "In :ref:`dynamic route syntax `, a placeholder " 64 | "token (``:name``) matches everything up to the next slash. This equals to " 65 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 66 | "add a custom regular pattern to the placeholder. An example: " 67 | "``/images/:filepath#.*#`` would match ``/images/icons/error.png`` but " 68 | "``/images/:filename`` won't." 69 | msgstr "" 70 | 71 | #: ../../faq.rst:43 72 | msgid "Problems with reverse proxies" 73 | msgstr "" 74 | 75 | #: ../../faq.rst:45 76 | msgid "" 77 | "Redirects and url-building only works if bottle knows the public address and" 78 | " location of your application. If you run bottle locally behind a reverse " 79 | "proxy or load balancer, some information might get lost along the way. For " 80 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 81 | "the local request by your proxy, not the real request by the client. Here is" 82 | " a small WSGI middleware snippet that helps to fix these values::" 83 | msgstr "" 84 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/_pot/index.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../index.rst:21 15 | msgid "Bottle: Python Web Framework" 16 | msgstr "" 17 | 18 | #: ../../index.rst:23 19 | msgid "" 20 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 21 | "Python_. It is distributed as a single file module and has no dependencies " 22 | "other than the `Python Standard Library `_." 23 | msgstr "" 24 | 25 | #: ../../index.rst:26 26 | msgid "" 27 | "**Routing:** Requests to function-call mapping with support for clean and " 28 | "dynamic URLs." 29 | msgstr "" 30 | 31 | #: ../../index.rst:27 32 | msgid "" 33 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 35 | msgstr "" 36 | 37 | #: ../../index.rst:28 38 | msgid "" 39 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 40 | "headers and other HTTP-related metadata." 41 | msgstr "" 42 | 43 | #: ../../index.rst:29 44 | msgid "" 45 | "**Server:** Built-in HTTP development server and support for paste_, " 46 | "fapws3_, bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 47 | msgstr "" 48 | 49 | #: ../../index.rst:32 50 | msgid "Example: \"Hello World\" in a bottle" 51 | msgstr "" 52 | 53 | #: ../../index.rst:43 54 | msgid "" 55 | "Run this script or paste it into a Python console, then point your browser " 56 | "to ``_. That's it." 57 | msgstr "" 58 | 59 | #: ../../index.rst:46 60 | msgid "Download and Install" 61 | msgstr "" 62 | 63 | #: ../../index.rst:49 64 | msgid "" 65 | "Install the latest stable release with ``pip install bottle``, " 66 | "``easy_install -U bottle`` or download `bottle.py`__ (unstable) into your " 67 | "project directory. There are no hard [1]_ dependencies other than the Python" 68 | " standard library. Bottle runs with **Python 2.5+ and 3.x**." 69 | msgstr "" 70 | 71 | #: ../../index.rst:52 72 | msgid "User's Guide" 73 | msgstr "" 74 | 75 | #: ../../index.rst:53 76 | msgid "" 77 | "Start here if you want to learn how to use the bottle framework for web " 78 | "development. If you have any questions not answered here, feel free to ask " 79 | "the `mailing list `_." 80 | msgstr "" 81 | 82 | #: ../../index.rst:68 83 | msgid "Knowledge Base" 84 | msgstr "" 85 | 86 | #: ../../index.rst:69 87 | msgid "A collection of articles, guides and HOWTOs." 88 | msgstr "" 89 | 90 | #: ../../index.rst:81 91 | msgid "Development and Contribution" 92 | msgstr "" 93 | 94 | #: ../../index.rst:83 95 | msgid "" 96 | "These chapters are intended for developers interested in the bottle " 97 | "development and release workflow." 98 | msgstr "" 99 | 100 | #: ../../index.rst:100 101 | msgid "License" 102 | msgstr "" 103 | 104 | #: ../../index.rst:102 105 | msgid "Code and documentation are available according to the MIT License:" 106 | msgstr "" 107 | 108 | #: ../../index.rst:107 109 | msgid "" 110 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 111 | "use the logo as a link to the bottle homepage or in direct context with the " 112 | "unmodified library. In all other cases please ask first." 113 | msgstr "" 114 | 115 | #: ../../index.rst:112 116 | msgid "Footnotes" 117 | msgstr "" 118 | 119 | #: ../../index.rst:113 120 | msgid "" 121 | "Usage of the template or server adapter classes of course requires the " 122 | "corresponding template or server modules." 123 | msgstr "" 124 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/_pot/plugins/index.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../plugins/index.rst:5 15 | msgid "List of available Plugins" 16 | msgstr "" 17 | 18 | #: ../../plugins/index.rst:7 19 | msgid "" 20 | "This is a list of third-party plugins that add extend Bottles core " 21 | "functionality or integrate other libraries with the Bottle framework." 22 | msgstr "" 23 | 24 | #: ../../plugins/index.rst:9 25 | msgid "" 26 | "Have a look at :ref:`plugins` for general questions about plugins " 27 | "(installation, usage). If you plan to develop a new plugin, the " 28 | ":doc:`/plugindev` may help you." 29 | msgstr "" 30 | 31 | #: ../../plugins/index.rst:12 32 | msgid "`Bottle-Beaker `_" 33 | msgstr "" 34 | 35 | #: ../../plugins/index.rst:12 36 | msgid "Beaker to session and caching library with WSGI Middleware" 37 | msgstr "" 38 | 39 | #: ../../plugins/index.rst:15 40 | msgid "`Bottle-Cork `_" 41 | msgstr "" 42 | 43 | #: ../../plugins/index.rst:15 44 | msgid "" 45 | "Cork provides a simple set of methods to implement Authentication and " 46 | "Authorization in web applications based on Bottle." 47 | msgstr "" 48 | 49 | #: ../../plugins/index.rst:18 50 | msgid "`Bottle-Extras `_" 51 | msgstr "" 52 | 53 | #: ../../plugins/index.rst:18 54 | msgid "Meta package to install the bottle plugin collection." 55 | msgstr "" 56 | 57 | #: ../../plugins/index.rst:21 58 | msgid "`Bottle-Flash `_" 59 | msgstr "" 60 | 61 | #: ../../plugins/index.rst:21 62 | msgid "flash plugin for bottle" 63 | msgstr "" 64 | 65 | #: ../../plugins/index.rst:24 66 | msgid "`Bottle-Hotqueue `_" 67 | msgstr "" 68 | 69 | #: ../../plugins/index.rst:24 70 | msgid "FIFO Queue for Bottle built upon redis" 71 | msgstr "" 72 | 73 | #: ../../plugins/index.rst:27 74 | msgid "`Macaron `_" 75 | msgstr "" 76 | 77 | #: ../../plugins/index.rst:27 78 | msgid "Macaron is an object-relational mapper (ORM) for SQLite." 79 | msgstr "" 80 | 81 | #: ../../plugins/index.rst:30 82 | msgid "`Bottle-Memcache `_" 83 | msgstr "" 84 | 85 | #: ../../plugins/index.rst:30 86 | msgid "Memcache integration for Bottle." 87 | msgstr "" 88 | 89 | #: ../../plugins/index.rst:33 90 | msgid "`Bottle-Mongo `_" 91 | msgstr "" 92 | 93 | #: ../../plugins/index.rst:33 94 | msgid "MongoDB integration for Bottle" 95 | msgstr "" 96 | 97 | #: ../../plugins/index.rst:36 98 | msgid "`Bottle-Redis `_" 99 | msgstr "" 100 | 101 | #: ../../plugins/index.rst:36 102 | msgid "Redis integration for Bottle." 103 | msgstr "" 104 | 105 | #: ../../plugins/index.rst:39 106 | msgid "`Bottle-Renderer `_" 107 | msgstr "" 108 | 109 | #: ../../plugins/index.rst:39 110 | msgid "Renderer plugin for bottle" 111 | msgstr "" 112 | 113 | #: ../../plugins/index.rst:42 114 | msgid "`Bottle-Servefiles `_" 115 | msgstr "" 116 | 117 | #: ../../plugins/index.rst:42 118 | msgid "A reusable app that serves static files for bottle apps" 119 | msgstr "" 120 | 121 | #: ../../plugins/index.rst:45 122 | msgid "`Bottle-Sqlalchemy `_" 123 | msgstr "" 124 | 125 | #: ../../plugins/index.rst:45 126 | msgid "SQLAlchemy integration for Bottle." 127 | msgstr "" 128 | 129 | #: ../../plugins/index.rst:48 130 | msgid "`Bottle-Sqlite `_" 131 | msgstr "" 132 | 133 | #: ../../plugins/index.rst:48 134 | msgid "SQLite3 database integration for Bottle." 135 | msgstr "" 136 | 137 | #: ../../plugins/index.rst:51 138 | msgid "`Bottle-Web2pydal `_" 139 | msgstr "" 140 | 141 | #: ../../plugins/index.rst:51 142 | msgid "Web2py Dal integration for Bottle." 143 | msgstr "" 144 | 145 | #: ../../plugins/index.rst:54 146 | msgid "`Bottle-Werkzeug `_" 147 | msgstr "" 148 | 149 | #: ../../plugins/index.rst:54 150 | msgid "" 151 | "Integrates the `werkzeug` library (alternative request and response objects," 152 | " advanced debugging middleware and more)." 153 | msgstr "" 154 | 155 | #: ../../plugins/index.rst:56 156 | msgid "" 157 | "Plugins listed here are not part of Bottle or the Bottle project, but " 158 | "developed and maintained by third parties." 159 | msgstr "" 160 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/_pot/routing.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../routing.rst:3 15 | msgid "Request Routing" 16 | msgstr "" 17 | 18 | #: ../../routing.rst:5 19 | msgid "" 20 | "Bottle uses a powerful routing engine to find the right callback for each " 21 | "request. The :ref:`tutorial ` shows you the basics. This " 22 | "document covers advanced techniques and rule mechanics in detail." 23 | msgstr "" 24 | 25 | #: ../../routing.rst:8 26 | msgid "Rule Syntax" 27 | msgstr "" 28 | 29 | #: ../../routing.rst:10 30 | msgid "" 31 | "The :class:`Router` distinguishes between two basic types of routes: " 32 | "**static routes** (e.g. ``/contact``) and **dynamic routes** (e.g. " 33 | "``/hello/``). A route that contains one or more *wildcards* it is " 34 | "considered dynamic. All other routes are static." 35 | msgstr "" 36 | 37 | #: ../../routing.rst:14 38 | msgid "" 39 | "The simplest form of a wildcard consists of a name enclosed in angle " 40 | "brackets (e.g. ````). The name should be unique for a given route and " 41 | "form a valid python identifier (alphanumeric, starting with a letter). This " 42 | "is because wildcards are used as keyword arguments for the request callback " 43 | "later." 44 | msgstr "" 45 | 46 | #: ../../routing.rst:16 47 | msgid "" 48 | "Each wildcard matches one or more characters, but stops at the first slash " 49 | "(``/``). This equals a regular expression of ``[^/]+`` and ensures that only" 50 | " one path segment is matched and routes with more than one wildcard stay " 51 | "unambiguous." 52 | msgstr "" 53 | 54 | #: ../../routing.rst:18 55 | msgid "The rule ``//`` matches as follows:" 56 | msgstr "" 57 | 58 | #: ../../routing.rst:21 59 | msgid "Path" 60 | msgstr "" 61 | 62 | #: ../../routing.rst:21 63 | msgid "Result" 64 | msgstr "" 65 | 66 | #: ../../routing.rst:23 67 | msgid "/save/123" 68 | msgstr "" 69 | 70 | #: ../../routing.rst:23 71 | msgid "``{'action': 'save', 'item': '123'}``" 72 | msgstr "" 73 | 74 | #: ../../routing.rst:24 75 | msgid "/save/123/" 76 | msgstr "" 77 | 78 | #: ../../routing.rst:24 ../../routing.rst:25 ../../routing.rst:26 79 | msgid "`No Match`" 80 | msgstr "" 81 | 82 | #: ../../routing.rst:25 83 | msgid "/save/" 84 | msgstr "" 85 | 86 | #: ../../routing.rst:26 87 | msgid "//123" 88 | msgstr "" 89 | 90 | #: ../../routing.rst:29 91 | msgid "" 92 | "You can change the exact behaviour in many ways using filters. This is " 93 | "described in the next section." 94 | msgstr "" 95 | 96 | #: ../../routing.rst:32 97 | msgid "Wildcard Filters" 98 | msgstr "" 99 | 100 | #: ../../routing.rst:36 101 | msgid "" 102 | "Filters are used to define more specific wildcards, and/or transform the " 103 | "matched part of the URL before it is passed to the callback. A filtered " 104 | "wildcard is declared as ```` or ````. The " 105 | "syntax for the optional config part depends on the filter used." 106 | msgstr "" 107 | 108 | #: ../../routing.rst:38 109 | msgid "The following standard filters are implemented:" 110 | msgstr "" 111 | 112 | #: ../../routing.rst:40 113 | msgid "**:int** matches (signed) digits and converts the value to integer." 114 | msgstr "" 115 | 116 | #: ../../routing.rst:41 117 | msgid "**:float** similar to :int but for decimal numbers." 118 | msgstr "" 119 | 120 | #: ../../routing.rst:42 121 | msgid "" 122 | "**:path** matches all characters including the slash character in a non-" 123 | "greedy way and may be used to match more than one path segment." 124 | msgstr "" 125 | 126 | #: ../../routing.rst:43 127 | msgid "" 128 | "**:re[:exp]** allows you to specify a custom regular expression in the " 129 | "config field. The matched value is not modified." 130 | msgstr "" 131 | 132 | #: ../../routing.rst:45 133 | msgid "" 134 | "You can add your own filters to the router. All you need is a function that " 135 | "returns three elements: A regular expression string, a callable to convert " 136 | "the URL fragment to a python value, and a callable that does the opposite. " 137 | "The filter function is called with the configuration string as the only " 138 | "parameter and may parse it as needed::" 139 | msgstr "" 140 | 141 | #: ../../routing.rst:71 142 | msgid "Legacy Syntax" 143 | msgstr "" 144 | 145 | #: ../../routing.rst:75 146 | msgid "" 147 | "The new rule syntax was introduce in **Bottle 0.10** to simplify some common" 148 | " use cases, but the old syntax still works and you can find lot code " 149 | "examples still using it. The differences are best described by example:" 150 | msgstr "" 151 | 152 | #: ../../routing.rst:78 153 | msgid "Old Syntax" 154 | msgstr "" 155 | 156 | #: ../../routing.rst:78 157 | msgid "New Syntax" 158 | msgstr "" 159 | 160 | #: ../../routing.rst:80 161 | msgid "``:name``" 162 | msgstr "" 163 | 164 | #: ../../routing.rst:80 165 | msgid "````" 166 | msgstr "" 167 | 168 | #: ../../routing.rst:81 169 | msgid "``:name#regexp#``" 170 | msgstr "" 171 | 172 | #: ../../routing.rst:81 173 | msgid "````" 174 | msgstr "" 175 | 176 | #: ../../routing.rst:82 177 | msgid "``:#regexp#``" 178 | msgstr "" 179 | 180 | #: ../../routing.rst:82 181 | msgid "``<:re:regexp>``" 182 | msgstr "" 183 | 184 | #: ../../routing.rst:83 185 | msgid "``:##``" 186 | msgstr "" 187 | 188 | #: ../../routing.rst:83 189 | msgid "``<:re>``" 190 | msgstr "" 191 | 192 | #: ../../routing.rst:86 193 | msgid "" 194 | "Try to avoid the old syntax in future projects if you can. It is not " 195 | "currently deprecated, but will be eventually." 196 | msgstr "" 197 | 198 | #: ../../routing.rst:91 199 | msgid "Explicit routing configuration" 200 | msgstr "" 201 | 202 | #: ../../routing.rst:93 203 | msgid "" 204 | "Route decorator can also be directly called as method. This way provides " 205 | "flexibility in complex setups, allowing you to directly control, when and " 206 | "how routing configuration done." 207 | msgstr "" 208 | 209 | #: ../../routing.rst:95 210 | msgid "" 211 | "Here is a basic example of explicit routing configuration for default bottle" 212 | " application::" 213 | msgstr "" 214 | 215 | #: ../../routing.rst:101 216 | msgid "" 217 | "In fact, any :class:`Bottle` instance routing can be configured same way::" 218 | msgstr "" 219 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/contact.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/bottle/bottle/language/pt_BR/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: pt_BR\n" 18 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 | 20 | #: ../../contact.rst:3 21 | msgid "Contact" 22 | msgstr "" 23 | 24 | #: ../../contact.rst:6 25 | msgid "About the Author" 26 | msgstr "" 27 | 28 | #: ../../contact.rst:7 29 | msgid "" 30 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 31 | "behind this website. I'm 27 years old and studying computer science at the " 32 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 33 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 34 | " `_ or visit my profile at `GitHub " 35 | "`_ to get in contact. A `mailinglist " 36 | "`_ is open for Bottle related " 37 | "questions, too." 38 | msgstr "" 39 | 40 | #: ../../contact.rst:10 41 | msgid "About Bottle" 42 | msgstr "Sobre o Bottle" 43 | 44 | #: ../../contact.rst:11 45 | msgid "" 46 | "This is my first open source project so far. It started and a small " 47 | "experiment but soon got so much positive feedback I decided to make " 48 | "something real out of it. Here it is." 49 | msgstr "" 50 | 51 | #: ../../contact.rst:14 52 | msgid "Impressum und Kontaktdaten" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:15 56 | msgid "" 57 | "(This is required by `German law " 58 | "`_)" 59 | msgstr "" 60 | 61 | #: ../../contact.rst:17 62 | msgid "" 63 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 64 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 65 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 66 | "ausdrücklich untersagt." 67 | msgstr "" 68 | 69 | #: ../../contact.rst:22 70 | msgid "**Betreiber**: Marcel Hellkamp" 71 | msgstr "" 72 | 73 | #: ../../contact.rst:23 74 | msgid "**Ort**: D - 37075 Göttingen" 75 | msgstr "" 76 | 77 | #: ../../contact.rst:24 78 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 79 | msgstr "" 80 | 81 | #: ../../contact.rst:25 82 | msgid "**Telefon**: +49 (0) 551 20005915" 83 | msgstr "" 84 | 85 | #: ../../contact.rst:26 86 | msgid "**E-Mail**: marc at gsites dot de" 87 | msgstr "" 88 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/faq.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Claudio Rogerio Carvalho Filho , 2017 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: bottle\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 13 | "Last-Translator: defnull \n" 14 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/bottle/bottle/language/pt_BR/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: pt_BR\n" 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 20 | 21 | #: ../../faq.rst:10 22 | msgid "Frequently Asked Questions" 23 | msgstr "Perguntas Frequentes" 24 | 25 | #: ../../faq.rst:13 26 | msgid "About Bottle" 27 | msgstr "Sobre o Bottle" 28 | 29 | #: ../../faq.rst:16 30 | msgid "Is bottle suitable for complex applications?" 31 | msgstr "" 32 | 33 | #: ../../faq.rst:18 34 | msgid "" 35 | "Bottle is a *micro* framework designed for prototyping and building small " 36 | "web applications and services. It stays out of your way and allows you to " 37 | "get things done fast, but misses some advanced features and ready-to-use " 38 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 39 | " XML-RPC). Although it *is* possible to add these features and build complex" 40 | " applications with Bottle, you should consider using a full-stack Web " 41 | "framework like pylons_ or paste_ instead." 42 | msgstr "" 43 | 44 | #: ../../faq.rst:22 45 | msgid "Common Problems and Pitfalls" 46 | msgstr "" 47 | 48 | #: ../../faq.rst:29 49 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 50 | msgstr "" 51 | 52 | #: ../../faq.rst:31 53 | msgid "" 54 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 55 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 56 | "Apache settings. You should add an absolute path to the template search " 57 | "path::" 58 | msgstr "" 59 | 60 | #: ../../faq.rst:35 61 | msgid "so bottle searches the right paths." 62 | msgstr "" 63 | 64 | #: ../../faq.rst:38 65 | msgid "Dynamic Routes and Slashes" 66 | msgstr "" 67 | 68 | #: ../../faq.rst:40 69 | msgid "" 70 | "In :ref:`dynamic route syntax `, a placeholder " 71 | "token (````) matches everything up to the next slash. This equals to " 72 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 73 | "add a custom regular pattern to the placeholder. An example: " 74 | "``/images/`` would match ``/images/icons/error.png`` but " 75 | "``/images/`` won't." 76 | msgstr "" 77 | 78 | #: ../../faq.rst:43 79 | msgid "Problems with reverse proxies" 80 | msgstr "" 81 | 82 | #: ../../faq.rst:45 83 | msgid "" 84 | "Redirects and url-building only works if bottle knows the public address and" 85 | " location of your application. If you run bottle locally behind a reverse " 86 | "proxy or load balancer, some information might get lost along the way. For " 87 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 88 | "the local request by your proxy, not the real request by the client. Here is" 89 | " a small WSGI middleware snippet that helps to fix these values::" 90 | msgstr "" 91 | -------------------------------------------------------------------------------- /docs/_locale/pt_BR/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # alephmelo , 2015 7 | # Igor P. Leroy , 2015 8 | # Igor P. Leroy , 2015 9 | # Thiago Avelino , 2015 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: bottle\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 15 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 16 | "Last-Translator: defnull \n" 17 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/bottle/bottle/language/pt_BR/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: pt_BR\n" 22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 23 | 24 | #: ../../index.rst:20 25 | msgid "Bottle: Python Web Framework" 26 | msgstr "Bottle: Python Web Framework" 27 | 28 | #: ../../index.rst:22 29 | msgid "" 30 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 31 | "Python_. It is distributed as a single file module and has no dependencies " 32 | "other than the `Python Standard Library `_." 33 | msgstr "Bottle é um simples, rápido, e leve WSGI_ micro web-framework para Python_. Ele é distribuído como um único arquivo (módulo) e não tem dependências que além `Biblioteca padrão do Python `_." 34 | 35 | #: ../../index.rst:25 36 | msgid "" 37 | "**Routing:** Requests to function-call mapping with support for clean and " 38 | "dynamic URLs." 39 | msgstr "**Rotas:** Solicitações de chamada de função de mapeamento com suporte para URLs limpas e dinâmicos." 40 | 41 | #: ../../index.rst:26 42 | msgid "" 43 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 45 | msgstr "**Templates:**Rápido e pythonico :ref:`mecanismo de templates interno ` e suporte para mako_, jinja2_ and cheetah_ templates." 46 | 47 | #: ../../index.rst:27 48 | msgid "" 49 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 50 | "headers and other HTTP-related metadata." 51 | msgstr "**Utilitários:** Conveniente acesso a dados de formulários, upload de arquivos, cookies, cabeçalhos e outros metadados relacionados ao HTTP." 52 | 53 | #: ../../index.rst:28 54 | msgid "" 55 | "**Server:** Built-in HTTP development server and support for paste_, " 56 | "bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 57 | msgstr "" 58 | 59 | #: ../../index.rst:31 60 | msgid "Example: \"Hello World\" in a bottle" 61 | msgstr "Exemplo: \"Olá Mundo\" em bottle" 62 | 63 | #: ../../index.rst:42 64 | msgid "" 65 | "Run this script or paste it into a Python console, then point your browser " 66 | "to ``_. That's it." 67 | msgstr "Execute este script ou cole em um console de Python, em seguida, acesse em seu navegador o ``_. Feito!" 68 | 69 | #: ../../index.rst:45 70 | msgid "Download and Install" 71 | msgstr "Download e Instalar" 72 | 73 | #: ../../index.rst:48 74 | msgid "" 75 | "Install the latest stable release with ``pip install bottle`` or download " 76 | "`bottle.py`__ (unstable) into your project directory. There are no hard [1]_" 77 | " dependencies other than the Python standard library. Bottle supports " 78 | "**Python 2.7 and Python 3**." 79 | msgstr "" 80 | 81 | #: ../../index.rst:50 82 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 83 | msgstr "" 84 | 85 | #: ../../index.rst:55 86 | msgid "User's Guide" 87 | msgstr "Guia do usuário" 88 | 89 | #: ../../index.rst:56 90 | msgid "" 91 | "Start here if you want to learn how to use the bottle framework for web " 92 | "development. If you have any questions not answered here, feel free to ask " 93 | "the `mailing list `_." 94 | msgstr "Comece por aqui se você quer aprender como usar o bottle framework para desenvolvimento web. Se você tiver quaisquer perguntas não respondidas aqui, sinta-se livre para pedir ajuda a `lista de discussão `_." 95 | 96 | #: ../../index.rst:71 97 | msgid "Knowledge Base" 98 | msgstr "Base de conhecimento" 99 | 100 | #: ../../index.rst:72 101 | msgid "A collection of articles, guides and HOWTOs." 102 | msgstr "Uma coleção de artigos, guias e COMO FAZER." 103 | 104 | #: ../../index.rst:84 105 | msgid "Development and Contribution" 106 | msgstr "Desenvolvimento e contribuição" 107 | 108 | #: ../../index.rst:86 109 | msgid "" 110 | "These chapters are intended for developers interested in the bottle " 111 | "development and release workflow." 112 | msgstr "Esses capítulos são destinados a desenvolvedores interessados no desenvolvimento do bottle e entender o fluxo de contribuição." 113 | 114 | #: ../../index.rst:103 115 | msgid "License" 116 | msgstr "Licença" 117 | 118 | #: ../../index.rst:105 119 | msgid "Code and documentation are available according to the MIT License:" 120 | msgstr "Código e documentação estão disponíveis sobre a licença MIT:" 121 | 122 | #: ../../index.rst:110 123 | msgid "" 124 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 125 | "use the logo as a link to the bottle homepage or in direct context with the " 126 | "unmodified library. In all other cases please ask first." 127 | msgstr "O logotipo do bottle no entanto *NÃO é* abrangido pela licença (MIT). É permitido usar o logotipo como um link para a home page do bottle ou em contexto direto com a biblioteca não modificado. Nos outros casos, por favor, pergunte primeiro." 128 | 129 | #: ../../index.rst:115 130 | msgid "Footnotes" 131 | msgstr "Notas de rodapé" 132 | 133 | #: ../../index.rst:116 134 | msgid "" 135 | "Usage of the template or server adapter classes requires the corresponding " 136 | "template or server modules." 137 | msgstr "Uso das classes adaptadoras de templates ou de servidores requerem os módulos do template ou servidor correspondentes." 138 | -------------------------------------------------------------------------------- /docs/_locale/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx 2 | sphinx-intl 3 | transifex-client 4 | -------------------------------------------------------------------------------- /docs/_locale/ru_RU/LC_MESSAGES/contact.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Russian (Russia) (http://www.transifex.com/bottle/bottle/language/ru_RU/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ru_RU\n" 18 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" 19 | 20 | #: ../../contact.rst:3 21 | msgid "Contact" 22 | msgstr "" 23 | 24 | #: ../../contact.rst:6 25 | msgid "About the Author" 26 | msgstr "" 27 | 28 | #: ../../contact.rst:7 29 | msgid "" 30 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 31 | "behind this website. I'm 27 years old and studying computer science at the " 32 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 33 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 34 | " `_ or visit my profile at `GitHub " 35 | "`_ to get in contact. A `mailinglist " 36 | "`_ is open for Bottle related " 37 | "questions, too." 38 | msgstr "" 39 | 40 | #: ../../contact.rst:10 41 | msgid "About Bottle" 42 | msgstr "" 43 | 44 | #: ../../contact.rst:11 45 | msgid "" 46 | "This is my first open source project so far. It started and a small " 47 | "experiment but soon got so much positive feedback I decided to make " 48 | "something real out of it. Here it is." 49 | msgstr "" 50 | 51 | #: ../../contact.rst:14 52 | msgid "Impressum und Kontaktdaten" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:15 56 | msgid "" 57 | "(This is required by `German law " 58 | "`_)" 59 | msgstr "" 60 | 61 | #: ../../contact.rst:17 62 | msgid "" 63 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 64 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 65 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 66 | "ausdrücklich untersagt." 67 | msgstr "" 68 | 69 | #: ../../contact.rst:22 70 | msgid "**Betreiber**: Marcel Hellkamp" 71 | msgstr "" 72 | 73 | #: ../../contact.rst:23 74 | msgid "**Ort**: D - 37075 Göttingen" 75 | msgstr "" 76 | 77 | #: ../../contact.rst:24 78 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 79 | msgstr "" 80 | 81 | #: ../../contact.rst:25 82 | msgid "**Telefon**: +49 (0) 551 20005915" 83 | msgstr "" 84 | 85 | #: ../../contact.rst:26 86 | msgid "**E-Mail**: marc at gsites dot de" 87 | msgstr "" 88 | -------------------------------------------------------------------------------- /docs/_locale/ru_RU/LC_MESSAGES/faq.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Russian (Russia) (http://www.transifex.com/bottle/bottle/language/ru_RU/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ru_RU\n" 18 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" 19 | 20 | #: ../../faq.rst:10 21 | msgid "Frequently Asked Questions" 22 | msgstr "" 23 | 24 | #: ../../faq.rst:13 25 | msgid "About Bottle" 26 | msgstr "" 27 | 28 | #: ../../faq.rst:16 29 | msgid "Is bottle suitable for complex applications?" 30 | msgstr "" 31 | 32 | #: ../../faq.rst:18 33 | msgid "" 34 | "Bottle is a *micro* framework designed for prototyping and building small " 35 | "web applications and services. It stays out of your way and allows you to " 36 | "get things done fast, but misses some advanced features and ready-to-use " 37 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 38 | " XML-RPC). Although it *is* possible to add these features and build complex" 39 | " applications with Bottle, you should consider using a full-stack Web " 40 | "framework like pylons_ or paste_ instead." 41 | msgstr "" 42 | 43 | #: ../../faq.rst:22 44 | msgid "Common Problems and Pitfalls" 45 | msgstr "" 46 | 47 | #: ../../faq.rst:29 48 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 49 | msgstr "" 50 | 51 | #: ../../faq.rst:31 52 | msgid "" 53 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 54 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 55 | "Apache settings. You should add an absolute path to the template search " 56 | "path::" 57 | msgstr "" 58 | 59 | #: ../../faq.rst:35 60 | msgid "so bottle searches the right paths." 61 | msgstr "" 62 | 63 | #: ../../faq.rst:38 64 | msgid "Dynamic Routes and Slashes" 65 | msgstr "" 66 | 67 | #: ../../faq.rst:40 68 | msgid "" 69 | "In :ref:`dynamic route syntax `, a placeholder " 70 | "token (````) matches everything up to the next slash. This equals to " 71 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 72 | "add a custom regular pattern to the placeholder. An example: " 73 | "``/images/`` would match ``/images/icons/error.png`` but " 74 | "``/images/`` won't." 75 | msgstr "" 76 | 77 | #: ../../faq.rst:43 78 | msgid "Problems with reverse proxies" 79 | msgstr "" 80 | 81 | #: ../../faq.rst:45 82 | msgid "" 83 | "Redirects and url-building only works if bottle knows the public address and" 84 | " location of your application. If you run bottle locally behind a reverse " 85 | "proxy or load balancer, some information might get lost along the way. For " 86 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 87 | "the local request by your proxy, not the real request by the client. Here is" 88 | " a small WSGI middleware snippet that helps to fix these values::" 89 | msgstr "" 90 | -------------------------------------------------------------------------------- /docs/_locale/ru_RU/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Russian (Russia) (http://www.transifex.com/bottle/bottle/language/ru_RU/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ru_RU\n" 18 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" 19 | 20 | #: ../../index.rst:20 21 | msgid "Bottle: Python Web Framework" 22 | msgstr "" 23 | 24 | #: ../../index.rst:22 25 | msgid "" 26 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 27 | "Python_. It is distributed as a single file module and has no dependencies " 28 | "other than the `Python Standard Library `_." 29 | msgstr "" 30 | 31 | #: ../../index.rst:25 32 | msgid "" 33 | "**Routing:** Requests to function-call mapping with support for clean and " 34 | "dynamic URLs." 35 | msgstr "" 36 | 37 | #: ../../index.rst:26 38 | msgid "" 39 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 41 | msgstr "" 42 | 43 | #: ../../index.rst:27 44 | msgid "" 45 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 46 | "headers and other HTTP-related metadata." 47 | msgstr "" 48 | 49 | #: ../../index.rst:28 50 | msgid "" 51 | "**Server:** Built-in HTTP development server and support for paste_, " 52 | "bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 53 | msgstr "" 54 | 55 | #: ../../index.rst:31 56 | msgid "Example: \"Hello World\" in a bottle" 57 | msgstr "" 58 | 59 | #: ../../index.rst:42 60 | msgid "" 61 | "Run this script or paste it into a Python console, then point your browser " 62 | "to ``_. That's it." 63 | msgstr "" 64 | 65 | #: ../../index.rst:45 66 | msgid "Download and Install" 67 | msgstr "" 68 | 69 | #: ../../index.rst:48 70 | msgid "" 71 | "Install the latest stable release with ``pip install bottle`` or download " 72 | "`bottle.py`__ (unstable) into your project directory. There are no hard [1]_" 73 | " dependencies other than the Python standard library. Bottle supports " 74 | "**Python 2.7 and Python 3**." 75 | msgstr "" 76 | 77 | #: ../../index.rst:50 78 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 79 | msgstr "" 80 | 81 | #: ../../index.rst:55 82 | msgid "User's Guide" 83 | msgstr "" 84 | 85 | #: ../../index.rst:56 86 | msgid "" 87 | "Start here if you want to learn how to use the bottle framework for web " 88 | "development. If you have any questions not answered here, feel free to ask " 89 | "the `mailing list `_." 90 | msgstr "" 91 | 92 | #: ../../index.rst:71 93 | msgid "Knowledge Base" 94 | msgstr "" 95 | 96 | #: ../../index.rst:72 97 | msgid "A collection of articles, guides and HOWTOs." 98 | msgstr "" 99 | 100 | #: ../../index.rst:84 101 | msgid "Development and Contribution" 102 | msgstr "" 103 | 104 | #: ../../index.rst:86 105 | msgid "" 106 | "These chapters are intended for developers interested in the bottle " 107 | "development and release workflow." 108 | msgstr "" 109 | 110 | #: ../../index.rst:103 111 | msgid "License" 112 | msgstr "" 113 | 114 | #: ../../index.rst:105 115 | msgid "Code and documentation are available according to the MIT License:" 116 | msgstr "" 117 | 118 | #: ../../index.rst:110 119 | msgid "" 120 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 121 | "use the logo as a link to the bottle homepage or in direct context with the " 122 | "unmodified library. In all other cases please ask first." 123 | msgstr "" 124 | 125 | #: ../../index.rst:115 126 | msgid "Footnotes" 127 | msgstr "" 128 | 129 | #: ../../index.rst:116 130 | msgid "" 131 | "Usage of the template or server adapter classes requires the corresponding " 132 | "template or server modules." 133 | msgstr "" 134 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/_pot/contact.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../contact.rst:3 15 | msgid "Contact" 16 | msgstr "" 17 | 18 | #: ../../contact.rst:6 19 | msgid "About the Autor" 20 | msgstr "" 21 | 22 | #: ../../contact.rst:7 23 | msgid "" 24 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 25 | "behind this website. I'm 27 years old and studying computer science at the " 26 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 27 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 28 | " `_ or visit my profile at `GitHub " 29 | "`_ to get in contact. A `mailinglist " 30 | "`_ is open for Bottle related " 31 | "questions, too." 32 | msgstr "" 33 | 34 | #: ../../contact.rst:10 35 | msgid "About Bottle" 36 | msgstr "" 37 | 38 | #: ../../contact.rst:11 39 | msgid "" 40 | "This is my first open source project so far. It started and a small " 41 | "experiment but soon got so much positive feedback I decided to make " 42 | "something real out of it. Here it is." 43 | msgstr "" 44 | 45 | #: ../../contact.rst:14 46 | msgid "Impressum und Kontaktdaten" 47 | msgstr "" 48 | 49 | #: ../../contact.rst:15 50 | msgid "" 51 | "(This is required by `German law " 52 | "`_)" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:17 56 | msgid "" 57 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 58 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 59 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 60 | "ausdrücklich untersagt." 61 | msgstr "" 62 | 63 | #: ../../contact.rst:22 64 | msgid "**Betreiber**: Marcel Hellkamp" 65 | msgstr "" 66 | 67 | #: ../../contact.rst:23 68 | msgid "**Ort**: D - 37075 Göttingen" 69 | msgstr "" 70 | 71 | #: ../../contact.rst:24 72 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 73 | msgstr "" 74 | 75 | #: ../../contact.rst:25 76 | msgid "**Telefon**: +49 (0) 551 20005915" 77 | msgstr "" 78 | 79 | #: ../../contact.rst:26 80 | msgid "**E-Mail**: marc at gsites dot de" 81 | msgstr "" 82 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/_pot/faq.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../faq.rst:10 15 | msgid "Frequently Asked Questions" 16 | msgstr "" 17 | 18 | #: ../../faq.rst:13 19 | msgid "About Bottle" 20 | msgstr "" 21 | 22 | #: ../../faq.rst:16 23 | msgid "Is bottle suitable for complex applications?" 24 | msgstr "" 25 | 26 | #: ../../faq.rst:18 27 | msgid "" 28 | "Bottle is a *micro* framework designed for prototyping and building small " 29 | "web applications and services. It stays out of your way and allows you to " 30 | "get things done fast, but misses some advanced features and ready-to-use " 31 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 32 | " XML-RPC). Although it *is* possible to add these features and build complex" 33 | " applications with Bottle, you should consider using a full-stack Web " 34 | "framework like pylons_ or paste_ instead." 35 | msgstr "" 36 | 37 | #: ../../faq.rst:22 38 | msgid "Common Problems and Pitfalls" 39 | msgstr "" 40 | 41 | #: ../../faq.rst:29 42 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 43 | msgstr "" 44 | 45 | #: ../../faq.rst:31 46 | msgid "" 47 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 48 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 49 | "Apache settings. You should add an absolute path to the template search " 50 | "path::" 51 | msgstr "" 52 | 53 | #: ../../faq.rst:35 54 | msgid "so bottle searches the right paths." 55 | msgstr "" 56 | 57 | #: ../../faq.rst:38 58 | msgid "Dynamic Routes and Slashes" 59 | msgstr "" 60 | 61 | #: ../../faq.rst:40 62 | msgid "" 63 | "In :ref:`dynamic route syntax `, a placeholder " 64 | "token (``:name``) matches everything up to the next slash. This equals to " 65 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 66 | "add a custom regular pattern to the placeholder. An example: " 67 | "``/images/:filepath#.*#`` would match ``/images/icons/error.png`` but " 68 | "``/images/:filename`` won't." 69 | msgstr "" 70 | 71 | #: ../../faq.rst:43 72 | msgid "Problems with reverse proxies" 73 | msgstr "" 74 | 75 | #: ../../faq.rst:45 76 | msgid "" 77 | "Redirects and url-building only works if bottle knows the public address and" 78 | " location of your application. If you run bottle locally behind a reverse " 79 | "proxy or load balancer, some information might get lost along the way. For " 80 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 81 | "the local request by your proxy, not the real request by the client. Here is" 82 | " a small WSGI middleware snippet that helps to fix these values::" 83 | msgstr "" 84 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/_pot/index.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../index.rst:21 15 | msgid "Bottle: Python Web Framework" 16 | msgstr "" 17 | 18 | #: ../../index.rst:23 19 | msgid "" 20 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 21 | "Python_. It is distributed as a single file module and has no dependencies " 22 | "other than the `Python Standard Library `_." 23 | msgstr "" 24 | 25 | #: ../../index.rst:26 26 | msgid "" 27 | "**Routing:** Requests to function-call mapping with support for clean and " 28 | "dynamic URLs." 29 | msgstr "" 30 | 31 | #: ../../index.rst:27 32 | msgid "" 33 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 35 | msgstr "" 36 | 37 | #: ../../index.rst:28 38 | msgid "" 39 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 40 | "headers and other HTTP-related metadata." 41 | msgstr "" 42 | 43 | #: ../../index.rst:29 44 | msgid "" 45 | "**Server:** Built-in HTTP development server and support for paste_, " 46 | "fapws3_, bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 47 | msgstr "" 48 | 49 | #: ../../index.rst:32 50 | msgid "Example: \"Hello World\" in a bottle" 51 | msgstr "" 52 | 53 | #: ../../index.rst:43 54 | msgid "" 55 | "Run this script or paste it into a Python console, then point your browser " 56 | "to ``_. That's it." 57 | msgstr "" 58 | 59 | #: ../../index.rst:46 60 | msgid "Download and Install" 61 | msgstr "" 62 | 63 | #: ../../index.rst:49 64 | msgid "" 65 | "Install the latest stable release with ``pip install bottle``, " 66 | "``easy_install -U bottle`` or download `bottle.py`__ (unstable) into your " 67 | "project directory. There are no hard [1]_ dependencies other than the Python" 68 | " standard library. Bottle runs with **Python 2.5+ and 3.x**." 69 | msgstr "" 70 | 71 | #: ../../index.rst:52 72 | msgid "User's Guide" 73 | msgstr "" 74 | 75 | #: ../../index.rst:53 76 | msgid "" 77 | "Start here if you want to learn how to use the bottle framework for web " 78 | "development. If you have any questions not answered here, feel free to ask " 79 | "the `mailing list `_." 80 | msgstr "" 81 | 82 | #: ../../index.rst:68 83 | msgid "Knowledge Base" 84 | msgstr "" 85 | 86 | #: ../../index.rst:69 87 | msgid "A collection of articles, guides and HOWTOs." 88 | msgstr "" 89 | 90 | #: ../../index.rst:81 91 | msgid "Development and Contribution" 92 | msgstr "" 93 | 94 | #: ../../index.rst:83 95 | msgid "" 96 | "These chapters are intended for developers interested in the bottle " 97 | "development and release workflow." 98 | msgstr "" 99 | 100 | #: ../../index.rst:100 101 | msgid "License" 102 | msgstr "" 103 | 104 | #: ../../index.rst:102 105 | msgid "Code and documentation are available according to the MIT License:" 106 | msgstr "" 107 | 108 | #: ../../index.rst:107 109 | msgid "" 110 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 111 | "use the logo as a link to the bottle homepage or in direct context with the " 112 | "unmodified library. In all other cases please ask first." 113 | msgstr "" 114 | 115 | #: ../../index.rst:112 116 | msgid "Footnotes" 117 | msgstr "" 118 | 119 | #: ../../index.rst:113 120 | msgid "" 121 | "Usage of the template or server adapter classes of course requires the " 122 | "corresponding template or server modules." 123 | msgstr "" 124 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/_pot/plugins/index.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../plugins/index.rst:5 15 | msgid "List of available Plugins" 16 | msgstr "" 17 | 18 | #: ../../plugins/index.rst:7 19 | msgid "" 20 | "This is a list of third-party plugins that add extend Bottles core " 21 | "functionality or integrate other libraries with the Bottle framework." 22 | msgstr "" 23 | 24 | #: ../../plugins/index.rst:9 25 | msgid "" 26 | "Have a look at :ref:`plugins` for general questions about plugins " 27 | "(installation, usage). If you plan to develop a new plugin, the " 28 | ":doc:`/plugindev` may help you." 29 | msgstr "" 30 | 31 | #: ../../plugins/index.rst:12 32 | msgid "`Bottle-Beaker `_" 33 | msgstr "" 34 | 35 | #: ../../plugins/index.rst:12 36 | msgid "Beaker to session and caching library with WSGI Middleware" 37 | msgstr "" 38 | 39 | #: ../../plugins/index.rst:15 40 | msgid "`Bottle-Cork `_" 41 | msgstr "" 42 | 43 | #: ../../plugins/index.rst:15 44 | msgid "" 45 | "Cork provides a simple set of methods to implement Authentication and " 46 | "Authorization in web applications based on Bottle." 47 | msgstr "" 48 | 49 | #: ../../plugins/index.rst:18 50 | msgid "`Bottle-Extras `_" 51 | msgstr "" 52 | 53 | #: ../../plugins/index.rst:18 54 | msgid "Meta package to install the bottle plugin collection." 55 | msgstr "" 56 | 57 | #: ../../plugins/index.rst:21 58 | msgid "`Bottle-Flash `_" 59 | msgstr "" 60 | 61 | #: ../../plugins/index.rst:21 62 | msgid "flash plugin for bottle" 63 | msgstr "" 64 | 65 | #: ../../plugins/index.rst:24 66 | msgid "`Bottle-Hotqueue `_" 67 | msgstr "" 68 | 69 | #: ../../plugins/index.rst:24 70 | msgid "FIFO Queue for Bottle built upon redis" 71 | msgstr "" 72 | 73 | #: ../../plugins/index.rst:27 74 | msgid "`Macaron `_" 75 | msgstr "" 76 | 77 | #: ../../plugins/index.rst:27 78 | msgid "Macaron is an object-relational mapper (ORM) for SQLite." 79 | msgstr "" 80 | 81 | #: ../../plugins/index.rst:30 82 | msgid "`Bottle-Memcache `_" 83 | msgstr "" 84 | 85 | #: ../../plugins/index.rst:30 86 | msgid "Memcache integration for Bottle." 87 | msgstr "" 88 | 89 | #: ../../plugins/index.rst:33 90 | msgid "`Bottle-Mongo `_" 91 | msgstr "" 92 | 93 | #: ../../plugins/index.rst:33 94 | msgid "MongoDB integration for Bottle" 95 | msgstr "" 96 | 97 | #: ../../plugins/index.rst:36 98 | msgid "`Bottle-Redis `_" 99 | msgstr "" 100 | 101 | #: ../../plugins/index.rst:36 102 | msgid "Redis integration for Bottle." 103 | msgstr "" 104 | 105 | #: ../../plugins/index.rst:39 106 | msgid "`Bottle-Renderer `_" 107 | msgstr "" 108 | 109 | #: ../../plugins/index.rst:39 110 | msgid "Renderer plugin for bottle" 111 | msgstr "" 112 | 113 | #: ../../plugins/index.rst:42 114 | msgid "`Bottle-Servefiles `_" 115 | msgstr "" 116 | 117 | #: ../../plugins/index.rst:42 118 | msgid "A reusable app that serves static files for bottle apps" 119 | msgstr "" 120 | 121 | #: ../../plugins/index.rst:45 122 | msgid "`Bottle-Sqlalchemy `_" 123 | msgstr "" 124 | 125 | #: ../../plugins/index.rst:45 126 | msgid "SQLAlchemy integration for Bottle." 127 | msgstr "" 128 | 129 | #: ../../plugins/index.rst:48 130 | msgid "`Bottle-Sqlite `_" 131 | msgstr "" 132 | 133 | #: ../../plugins/index.rst:48 134 | msgid "SQLite3 database integration for Bottle." 135 | msgstr "" 136 | 137 | #: ../../plugins/index.rst:51 138 | msgid "`Bottle-Web2pydal `_" 139 | msgstr "" 140 | 141 | #: ../../plugins/index.rst:51 142 | msgid "Web2py Dal integration for Bottle." 143 | msgstr "" 144 | 145 | #: ../../plugins/index.rst:54 146 | msgid "`Bottle-Werkzeug `_" 147 | msgstr "" 148 | 149 | #: ../../plugins/index.rst:54 150 | msgid "" 151 | "Integrates the `werkzeug` library (alternative request and response objects," 152 | " advanced debugging middleware and more)." 153 | msgstr "" 154 | 155 | #: ../../plugins/index.rst:56 156 | msgid "" 157 | "Plugins listed here are not part of Bottle or the Bottle project, but " 158 | "developed and maintained by third parties." 159 | msgstr "" 160 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/_pot/routing.po: -------------------------------------------------------------------------------- 1 | # 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bottle 0.13-dev\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2015-01-22 16:45-0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | 14 | #: ../../routing.rst:3 15 | msgid "Request Routing" 16 | msgstr "" 17 | 18 | #: ../../routing.rst:5 19 | msgid "" 20 | "Bottle uses a powerful routing engine to find the right callback for each " 21 | "request. The :ref:`tutorial ` shows you the basics. This " 22 | "document covers advanced techniques and rule mechanics in detail." 23 | msgstr "" 24 | 25 | #: ../../routing.rst:8 26 | msgid "Rule Syntax" 27 | msgstr "" 28 | 29 | #: ../../routing.rst:10 30 | msgid "" 31 | "The :class:`Router` distinguishes between two basic types of routes: " 32 | "**static routes** (e.g. ``/contact``) and **dynamic routes** (e.g. " 33 | "``/hello/``). A route that contains one or more *wildcards* it is " 34 | "considered dynamic. All other routes are static." 35 | msgstr "" 36 | 37 | #: ../../routing.rst:14 38 | msgid "" 39 | "The simplest form of a wildcard consists of a name enclosed in angle " 40 | "brackets (e.g. ````). The name should be unique for a given route and " 41 | "form a valid python identifier (alphanumeric, starting with a letter). This " 42 | "is because wildcards are used as keyword arguments for the request callback " 43 | "later." 44 | msgstr "" 45 | 46 | #: ../../routing.rst:16 47 | msgid "" 48 | "Each wildcard matches one or more characters, but stops at the first slash " 49 | "(``/``). This equals a regular expression of ``[^/]+`` and ensures that only" 50 | " one path segment is matched and routes with more than one wildcard stay " 51 | "unambiguous." 52 | msgstr "" 53 | 54 | #: ../../routing.rst:18 55 | msgid "The rule ``//`` matches as follows:" 56 | msgstr "" 57 | 58 | #: ../../routing.rst:21 59 | msgid "Path" 60 | msgstr "" 61 | 62 | #: ../../routing.rst:21 63 | msgid "Result" 64 | msgstr "" 65 | 66 | #: ../../routing.rst:23 67 | msgid "/save/123" 68 | msgstr "" 69 | 70 | #: ../../routing.rst:23 71 | msgid "``{'action': 'save', 'item': '123'}``" 72 | msgstr "" 73 | 74 | #: ../../routing.rst:24 75 | msgid "/save/123/" 76 | msgstr "" 77 | 78 | #: ../../routing.rst:24 ../../routing.rst:25 ../../routing.rst:26 79 | msgid "`No Match`" 80 | msgstr "" 81 | 82 | #: ../../routing.rst:25 83 | msgid "/save/" 84 | msgstr "" 85 | 86 | #: ../../routing.rst:26 87 | msgid "//123" 88 | msgstr "" 89 | 90 | #: ../../routing.rst:29 91 | msgid "" 92 | "You can change the exact behaviour in many ways using filters. This is " 93 | "described in the next section." 94 | msgstr "" 95 | 96 | #: ../../routing.rst:32 97 | msgid "Wildcard Filters" 98 | msgstr "" 99 | 100 | #: ../../routing.rst:36 101 | msgid "" 102 | "Filters are used to define more specific wildcards, and/or transform the " 103 | "matched part of the URL before it is passed to the callback. A filtered " 104 | "wildcard is declared as ```` or ````. The " 105 | "syntax for the optional config part depends on the filter used." 106 | msgstr "" 107 | 108 | #: ../../routing.rst:38 109 | msgid "The following standard filters are implemented:" 110 | msgstr "" 111 | 112 | #: ../../routing.rst:40 113 | msgid "**:int** matches (signed) digits and converts the value to integer." 114 | msgstr "" 115 | 116 | #: ../../routing.rst:41 117 | msgid "**:float** similar to :int but for decimal numbers." 118 | msgstr "" 119 | 120 | #: ../../routing.rst:42 121 | msgid "" 122 | "**:path** matches all characters including the slash character in a non-" 123 | "greedy way and may be used to match more than one path segment." 124 | msgstr "" 125 | 126 | #: ../../routing.rst:43 127 | msgid "" 128 | "**:re[:exp]** allows you to specify a custom regular expression in the " 129 | "config field. The matched value is not modified." 130 | msgstr "" 131 | 132 | #: ../../routing.rst:45 133 | msgid "" 134 | "You can add your own filters to the router. All you need is a function that " 135 | "returns three elements: A regular expression string, a callable to convert " 136 | "the URL fragment to a python value, and a callable that does the opposite. " 137 | "The filter function is called with the configuration string as the only " 138 | "parameter and may parse it as needed::" 139 | msgstr "" 140 | 141 | #: ../../routing.rst:71 142 | msgid "Legacy Syntax" 143 | msgstr "" 144 | 145 | #: ../../routing.rst:75 146 | msgid "" 147 | "The new rule syntax was introduce in **Bottle 0.10** to simplify some common" 148 | " use cases, but the old syntax still works and you can find lot code " 149 | "examples still using it. The differences are best described by example:" 150 | msgstr "" 151 | 152 | #: ../../routing.rst:78 153 | msgid "Old Syntax" 154 | msgstr "" 155 | 156 | #: ../../routing.rst:78 157 | msgid "New Syntax" 158 | msgstr "" 159 | 160 | #: ../../routing.rst:80 161 | msgid "``:name``" 162 | msgstr "" 163 | 164 | #: ../../routing.rst:80 165 | msgid "````" 166 | msgstr "" 167 | 168 | #: ../../routing.rst:81 169 | msgid "``:name#regexp#``" 170 | msgstr "" 171 | 172 | #: ../../routing.rst:81 173 | msgid "````" 174 | msgstr "" 175 | 176 | #: ../../routing.rst:82 177 | msgid "``:#regexp#``" 178 | msgstr "" 179 | 180 | #: ../../routing.rst:82 181 | msgid "``<:re:regexp>``" 182 | msgstr "" 183 | 184 | #: ../../routing.rst:83 185 | msgid "``:##``" 186 | msgstr "" 187 | 188 | #: ../../routing.rst:83 189 | msgid "``<:re>``" 190 | msgstr "" 191 | 192 | #: ../../routing.rst:86 193 | msgid "" 194 | "Try to avoid the old syntax in future projects if you can. It is not " 195 | "currently deprecated, but will be eventually." 196 | msgstr "" 197 | 198 | #: ../../routing.rst:91 199 | msgid "Explicit routing configuration" 200 | msgstr "" 201 | 202 | #: ../../routing.rst:93 203 | msgid "" 204 | "Route decorator can also be directly called as method. This way provides " 205 | "flexibility in complex setups, allowing you to directly control, when and " 206 | "how routing configuration done." 207 | msgstr "" 208 | 209 | #: ../../routing.rst:95 210 | msgid "" 211 | "Here is a basic example of explicit routing configuration for default bottle" 212 | " application::" 213 | msgstr "" 214 | 215 | #: ../../routing.rst:101 216 | msgid "" 217 | "In fact, any :class:`Bottle` instance routing can be configured same way::" 218 | msgstr "" 219 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/contact.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Chinese (China) (http://www.transifex.com/bottle/bottle/language/zh_CN/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: zh_CN\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: ../../contact.rst:3 21 | msgid "Contact" 22 | msgstr "" 23 | 24 | #: ../../contact.rst:6 25 | msgid "About the Author" 26 | msgstr "" 27 | 28 | #: ../../contact.rst:7 29 | msgid "" 30 | "Hi, I'm *Marcel Hellkamp* (aka *defnull*), author of Bottle and the guy " 31 | "behind this website. I'm 27 years old and studying computer science at the " 32 | "Georg-August-University in Göttingen, Germany. Python is my favorite " 33 | "language, but I also code in ruby and JavaScript a lot. Watch me on `twitter" 34 | " `_ or visit my profile at `GitHub " 35 | "`_ to get in contact. A `mailinglist " 36 | "`_ is open for Bottle related " 37 | "questions, too." 38 | msgstr "" 39 | 40 | #: ../../contact.rst:10 41 | msgid "About Bottle" 42 | msgstr "关于Bottle" 43 | 44 | #: ../../contact.rst:11 45 | msgid "" 46 | "This is my first open source project so far. It started and a small " 47 | "experiment but soon got so much positive feedback I decided to make " 48 | "something real out of it. Here it is." 49 | msgstr "" 50 | 51 | #: ../../contact.rst:14 52 | msgid "Impressum und Kontaktdaten" 53 | msgstr "" 54 | 55 | #: ../../contact.rst:15 56 | msgid "" 57 | "(This is required by `German law " 58 | "`_)" 59 | msgstr "" 60 | 61 | #: ../../contact.rst:17 62 | msgid "" 63 | "Die Nutzung der folgenden Kontaktdaten ist ausschließlich für die " 64 | "Kontaktaufnahme mit dem Betreiber dieser Webseite bei rechtlichen Problemen " 65 | "vorgesehen. Insbesondere die Nutzung zu Werbe- oder ähnlichen Zwecken ist " 66 | "ausdrücklich untersagt." 67 | msgstr "" 68 | 69 | #: ../../contact.rst:22 70 | msgid "**Betreiber**: Marcel Hellkamp" 71 | msgstr "" 72 | 73 | #: ../../contact.rst:23 74 | msgid "**Ort**: D - 37075 Göttingen" 75 | msgstr "" 76 | 77 | #: ../../contact.rst:24 78 | msgid "**Strasse**: Theodor-Heuss Strasse 13" 79 | msgstr "" 80 | 81 | #: ../../contact.rst:25 82 | msgid "**Telefon**: +49 (0) 551 20005915" 83 | msgstr "" 84 | 85 | #: ../../contact.rst:26 86 | msgid "**E-Mail**: marc at gsites dot de" 87 | msgstr "" 88 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/faq.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: bottle\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 11 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 12 | "Last-Translator: defnull \n" 13 | "Language-Team: Chinese (China) (http://www.transifex.com/bottle/bottle/language/zh_CN/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: zh_CN\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: ../../faq.rst:10 21 | msgid "Frequently Asked Questions" 22 | msgstr "常见问题" 23 | 24 | #: ../../faq.rst:13 25 | msgid "About Bottle" 26 | msgstr "关于Bottle" 27 | 28 | #: ../../faq.rst:16 29 | msgid "Is bottle suitable for complex applications?" 30 | msgstr "Bottle适合用于复杂的应用吗?" 31 | 32 | #: ../../faq.rst:18 33 | msgid "" 34 | "Bottle is a *micro* framework designed for prototyping and building small " 35 | "web applications and services. It stays out of your way and allows you to " 36 | "get things done fast, but misses some advanced features and ready-to-use " 37 | "solutions found in other frameworks (MVC, ORM, form validation, scaffolding," 38 | " XML-RPC). Although it *is* possible to add these features and build complex" 39 | " applications with Bottle, you should consider using a full-stack Web " 40 | "framework like pylons_ or paste_ instead." 41 | msgstr "Bottle是一个 *迷你* 框架,被设计来提供原型开发和创建小的Web应用和服务。它能快速上手,并帮助你快速完成任务,但缺少一些高级功能和一些其他框架已提供的已知问题解决方法(例如:MVC, ORM,表单验证,手脚架,XML-RPC)。尽管 *可以* 添加这些功能,然后通过Bottle来开发复杂的应用,但我们还是建议你使用一些功能完备的Web框架,例如 pylons_ 或 paste_ 。" 42 | 43 | #: ../../faq.rst:22 44 | msgid "Common Problems and Pitfalls" 45 | msgstr "常见的,意料之外的问题" 46 | 47 | #: ../../faq.rst:29 48 | msgid "\"Template Not Found\" in mod_wsgi/mod_python" 49 | msgstr "在mod_wsgi/mod_python中的 \"Template Not Found\" 错误" 50 | 51 | #: ../../faq.rst:31 52 | msgid "" 53 | "Bottle searches in ``./`` and ``./views/`` for templates. In a mod_python_ " 54 | "or mod_wsgi_ environment, the working directory (``./``) depends on your " 55 | "Apache settings. You should add an absolute path to the template search " 56 | "path::" 57 | msgstr "Bottle会在 ``./`` 和 ``./views/`` 目录中搜索模板。在一个 mod_python_ 或 mod_wsgi_ 环境,当前工作目录( ``./`` )是由Apache的设置决定的。你应该在模板的搜索路径中添加一个绝对路径。" 58 | 59 | #: ../../faq.rst:35 60 | msgid "so bottle searches the right paths." 61 | msgstr "这样,Bottle就能在正确的目录下搜索模板了" 62 | 63 | #: ../../faq.rst:38 64 | msgid "Dynamic Routes and Slashes" 65 | msgstr "动态route和反斜杠" 66 | 67 | #: ../../faq.rst:40 68 | msgid "" 69 | "In :ref:`dynamic route syntax `, a placeholder " 70 | "token (````) matches everything up to the next slash. This equals to " 71 | "``[^/]+`` in regular expression syntax. To accept slashes too, you have to " 72 | "add a custom regular pattern to the placeholder. An example: " 73 | "``/images/`` would match ``/images/icons/error.png`` but " 74 | "``/images/`` won't." 75 | msgstr "" 76 | 77 | #: ../../faq.rst:43 78 | msgid "Problems with reverse proxies" 79 | msgstr "反向代理的问题" 80 | 81 | #: ../../faq.rst:45 82 | msgid "" 83 | "Redirects and url-building only works if bottle knows the public address and" 84 | " location of your application. If you run bottle locally behind a reverse " 85 | "proxy or load balancer, some information might get lost along the way. For " 86 | "example, the ``wsgi.url_scheme`` value or the ``Host`` header might reflect " 87 | "the local request by your proxy, not the real request by the client. Here is" 88 | " a small WSGI middleware snippet that helps to fix these values::" 89 | msgstr "只用Bottle知道公共地址和应用位置的情况下,重定向和url-building才会起作用。(译者注:保留原文)Redirects and url-building only works if bottle knows the public address and location of your application.如果Bottle应用运行在反向代理或负载均衡后面,一些信息也许会丢失。例如, ``wsgi.url_scheme`` 的值或 ``Host`` 头或许只能获取到代理的请求信息,而不是真实的用户请求。下面是一个简单的中间件代码片段,处理上面的问题,获取正确的值。" 90 | -------------------------------------------------------------------------------- /docs/_locale/zh_CN/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2009-2020, Marcel Hellkamp 3 | # This file is distributed under the same license as the Bottle package. 4 | # 5 | # Translators: 6 | # Dormouse Young , 2016 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: bottle\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-12-31 18:35+0100\n" 12 | "PO-Revision-Date: 2020-12-31 17:35+0000\n" 13 | "Last-Translator: defnull \n" 14 | "Language-Team: Chinese (China) (http://www.transifex.com/bottle/bottle/language/zh_CN/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: zh_CN\n" 19 | "Plural-Forms: nplurals=1; plural=0;\n" 20 | 21 | #: ../../index.rst:20 22 | msgid "Bottle: Python Web Framework" 23 | msgstr "Bottle : Python Web 框架" 24 | 25 | #: ../../index.rst:22 26 | msgid "" 27 | "Bottle is a fast, simple and lightweight WSGI_ micro web-framework for " 28 | "Python_. It is distributed as a single file module and has no dependencies " 29 | "other than the `Python Standard Library `_." 30 | msgstr "Bottle 是一个快速、简单、轻量级的 Python_ WSGI_ 微型 Web 框架。它只有一个文件,只依赖 `Python 标准库 `_ 。" 31 | 32 | #: ../../index.rst:25 33 | msgid "" 34 | "**Routing:** Requests to function-call mapping with support for clean and " 35 | "dynamic URLs." 36 | msgstr "**URL映射(Routing):** 将URL请求映射到Python函数,支持动态URL,且URL更简洁。" 37 | 38 | #: ../../index.rst:26 39 | msgid "" 40 | "**Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates." 42 | msgstr "**模板(Templates):** 快速且pythonic的 :ref:`内置模板引擎 ` ,同时支持 mako_ , jinja2_ 和 cheetah_ 等模板。" 43 | 44 | #: ../../index.rst:27 45 | msgid "" 46 | "**Utilities:** Convenient access to form data, file uploads, cookies, " 47 | "headers and other HTTP-related metadata." 48 | msgstr "**基础功能(Utilities):** 方便地访问表单数据,上传文件,使用cookie,查看HTTP元数据。" 49 | 50 | #: ../../index.rst:28 51 | msgid "" 52 | "**Server:** Built-in HTTP development server and support for paste_, " 53 | "bjoern_, gae_, cherrypy_ or any other WSGI_ capable HTTP server." 54 | msgstr "" 55 | 56 | #: ../../index.rst:31 57 | msgid "Example: \"Hello World\" in a bottle" 58 | msgstr "示例: \"Hello World\"" 59 | 60 | #: ../../index.rst:42 61 | msgid "" 62 | "Run this script or paste it into a Python console, then point your browser " 63 | "to ``_. That's it." 64 | msgstr "将其保存为py文件并执行,用浏览器访问 ``_ 即可看到效果。就这么简单!" 65 | 66 | #: ../../index.rst:45 67 | msgid "Download and Install" 68 | msgstr "下载和安装" 69 | 70 | #: ../../index.rst:48 71 | msgid "" 72 | "Install the latest stable release with ``pip install bottle`` or download " 73 | "`bottle.py`__ (unstable) into your project directory. There are no hard [1]_" 74 | " dependencies other than the Python standard library. Bottle supports " 75 | "**Python 2.7 and Python 3**." 76 | msgstr "" 77 | 78 | #: ../../index.rst:50 79 | msgid "Support for Python 2.5 and 2.6 was dropped with this release." 80 | msgstr "" 81 | 82 | #: ../../index.rst:55 83 | msgid "User's Guide" 84 | msgstr "用户指南" 85 | 86 | #: ../../index.rst:56 87 | msgid "" 88 | "Start here if you want to learn how to use the bottle framework for web " 89 | "development. If you have any questions not answered here, feel free to ask " 90 | "the `mailing list `_." 91 | msgstr "如果你有将Bottle用于Web开发的打算,请继续看下去。如果这份文档没有解决你遇到的问题,尽管在 `邮件列表 `_ 中吼出来吧(译者注:用英文哦)。" 92 | 93 | #: ../../index.rst:71 94 | msgid "Knowledge Base" 95 | msgstr "知识库" 96 | 97 | #: ../../index.rst:72 98 | msgid "A collection of articles, guides and HOWTOs." 99 | msgstr "收集文章,使用指南和HOWTO" 100 | 101 | #: ../../index.rst:84 102 | msgid "Development and Contribution" 103 | msgstr "开发和贡献" 104 | 105 | #: ../../index.rst:86 106 | msgid "" 107 | "These chapters are intended for developers interested in the bottle " 108 | "development and release workflow." 109 | msgstr "这些章节是为那些对Bottle的开发和发布流程感兴趣的开发者准备的。" 110 | 111 | #: ../../index.rst:103 112 | msgid "License" 113 | msgstr "许可证" 114 | 115 | #: ../../index.rst:105 116 | msgid "Code and documentation are available according to the MIT License:" 117 | msgstr "代码和文件皆使用MIT许可证:" 118 | 119 | #: ../../index.rst:110 120 | msgid "" 121 | "The Bottle logo however is *NOT* covered by that license. It is allowed to " 122 | "use the logo as a link to the bottle homepage or in direct context with the " 123 | "unmodified library. In all other cases please ask first." 124 | msgstr "然而,许可证 *不包含* Bottle的logo。logo用作指向Bottle主页的连接,或未修改过的类库。如要用于其它用途,请先请求许可。" 125 | 126 | #: ../../index.rst:115 127 | msgid "Footnotes" 128 | msgstr "脚注" 129 | 130 | #: ../../index.rst:116 131 | msgid "" 132 | "Usage of the template or server adapter classes requires the corresponding " 133 | "template or server modules." 134 | msgstr "" 135 | -------------------------------------------------------------------------------- /docs/api.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | API Reference 3 | ============================== 4 | 5 | .. module:: bottle 6 | :platform: Unix, Windows 7 | :synopsis: WSGI micro framework 8 | .. moduleauthor:: Marcel Hellkamp 9 | 10 | Bottle prides itself on having source code that is easy to read and follow, so most questions about APIs or inner workings can be answered quickly by inspecting sources. Your IDE should give you the same information you'll find on this page, as most of it is auto-generates from docstrings and method signatures anyway. If you are new to bottle, you may find the :doc:`tutorial` more helpful as a starting point. 11 | 12 | 13 | 14 | Global functions 15 | ================ 16 | 17 | The module defines several functions, constants, and an exception. 18 | 19 | .. function:: app() 20 | default_app() 21 | 22 | Return the current :ref:`default-app`. This is actually a callable instances of :class:`AppStack`. 23 | 24 | .. autofunction:: debug 25 | 26 | .. autofunction:: install 27 | 28 | .. autofunction:: uninstall 29 | 30 | .. autofunction:: run 31 | 32 | 33 | Global decorators 34 | ================= 35 | 36 | Bottle maintains a stack of :class:`Bottle` instances (see :func:`app` and :class:`AppStack`) 37 | and uses the top of the stack as a :ref:`default-app` for some of the module-level functions 38 | and decorators. All of those have a corresponding method on the :class:`Bottle` class. 39 | 40 | .. function:: route(path, method='GET', callback=None, **options) 41 | get(...) 42 | post(...) 43 | put(...) 44 | delete(...) 45 | patch(...) 46 | 47 | Decorator to install a route to the current default application. See :meth:`Bottle.route` for details. 48 | 49 | .. function:: error(...) 50 | 51 | Decorator to install an error handler to the current default application. See :meth:`Bottle.error` for details. 52 | 53 | .. autofunction:: hook 54 | 55 | 56 | 57 | Request Context 58 | =============== 59 | 60 | The global :data:`request` and :data:`response` instances are only valid from within an request handler function and represent the *current* HTTP request or response. 61 | 62 | .. autodata:: request 63 | 64 | .. autodata:: response 65 | 66 | 67 | Helper Functions 68 | ================ 69 | 70 | .. autofunction:: abort 71 | 72 | .. autofunction:: redirect 73 | 74 | .. autofunction:: static_file 75 | 76 | 77 | Exceptions 78 | ========== 79 | 80 | .. autoexception:: BottleException 81 | :members: 82 | 83 | .. autoexception:: HTTPResponse 84 | :members: 85 | 86 | .. autoexception:: HTTPError 87 | :members: 88 | 89 | 90 | The :class:`Bottle` Class 91 | ========================= 92 | 93 | .. autoclass:: Bottle 94 | :members: 95 | 96 | 97 | The :class:`Request` Object 98 | =================================================== 99 | 100 | The :class:`Request` class wraps a WSGI environment and provides helpful methods to parse and access form data, cookies, file uploads and other metadata. Most of the attributes are read-only. 101 | 102 | .. autoclass:: Request 103 | :members: 104 | 105 | .. autoclass:: BaseRequest 106 | :members: 107 | :special-members: __setattr__ 108 | 109 | .. autoclass:: LocalRequest 110 | :members: 111 | 112 | 113 | The :class:`Response` Object 114 | ============================ 115 | 116 | The :class:`Response` class stores the HTTP status code as well as headers and cookies that are to be sent to the client. Similar to :data:`bottle.request` there is a thread-local :data:`bottle.response` instance that can be used to adjust the `current` response. Moreover, you can instantiate :class:`Response` and return it from your request handler. In this case, the custom instance overrules the headers and cookies defined in the global one. 117 | 118 | .. autoclass:: Response 119 | :members: 120 | 121 | .. autoclass:: BaseResponse 122 | :members: 123 | 124 | .. autoclass:: LocalResponse 125 | :members: 126 | 127 | 128 | Data Structures 129 | =============== 130 | 131 | .. autoclass:: AppStack 132 | :members: 133 | 134 | .. method:: pop() 135 | 136 | Return the current default application and remove it from the stack. 137 | 138 | .. autoclass:: ConfigDict 139 | :members: 140 | 141 | .. autoclass:: MultiDict 142 | :members: 143 | 144 | .. autoclass:: WSGIHeaderDict 145 | :members: 146 | 147 | .. autoclass:: HeaderDict 148 | :members: 149 | 150 | .. autoclass:: FormsDict 151 | :members: 152 | 153 | .. autoclass:: FileUpload 154 | :members: 155 | 156 | 157 | Request routing 158 | =============== 159 | 160 | .. autoclass:: Router 161 | :members: 162 | 163 | .. autoclass:: Route 164 | :members: 165 | 166 | 167 | Templating 168 | ========== 169 | 170 | All template engines supported by :mod:`bottle` implement the :class:`BaseTemplate` API. This way it is possible to switch and mix template engines without changing the application code at all. 171 | 172 | .. autoclass:: BaseTemplate 173 | :members: 174 | 175 | .. autofunction:: view 176 | 177 | .. autofunction:: template 178 | 179 | .. autodata:: TEMPLATE_PATH 180 | 181 | Global search path for templates. 182 | 183 | 184 | You can write your own adapter for your favourite template engine or use one of the predefined adapters. Currently there are four fully supported template engines: 185 | 186 | ======================== ================================== ==================== ======================== 187 | Class URL Decorator Render function 188 | ======================== ================================== ==================== ======================== 189 | :class:`SimpleTemplate` :doc:`stpl` :func:`view` :func:`template` 190 | :class:`MakoTemplate` http://www.makotemplates.org :func:`mako_view` :func:`mako_template` 191 | :class:`CheetahTemplate` http://www.cheetahtemplate.org/ :func:`cheetah_view` :func:`cheetah_template` 192 | :class:`Jinja2Template` https://jinja.palletsprojects.com/ :func:`jinja2_view` :func:`jinja2_template` 193 | ======================== ================================== ==================== ======================== 194 | 195 | To use :class:`MakoTemplate` as your default template engine, just import its specialised decorator and render function:: 196 | 197 | from bottle import mako_view as view, mako_template as template 198 | 199 | HTTP utilities 200 | ============== 201 | 202 | .. autofunction:: parse_date 203 | 204 | .. autofunction:: parse_auth 205 | 206 | .. autofunction:: cookie_encode 207 | 208 | .. autofunction:: cookie_decode 209 | 210 | .. autofunction:: cookie_is_encoded 211 | 212 | .. autofunction:: path_shift 213 | 214 | .. autodata:: HTTP_CODES 215 | :no-value: 216 | 217 | Misc utilities 218 | ============== 219 | 220 | .. autoclass:: DictProperty 221 | 222 | .. autoclass:: cached_property 223 | 224 | .. autoclass:: lazy_attribute 225 | 226 | .. autofunction:: yieldroutes 227 | 228 | .. autofunction:: load 229 | 230 | .. autofunction:: load_app 231 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import sys 3 | import os 4 | import time 5 | 6 | # Use the matching bottle version, not a globally installed one. 7 | bottle_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../')) 8 | sys.path.insert(0, bottle_dir) 9 | import bottle 10 | 11 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 12 | 'sphinx.ext.viewcode'] 13 | master_doc = 'index' 14 | project = u'Bottle' 15 | copyright = u'2009-%s, %s' % (time.strftime('%Y'), bottle.__author__) 16 | version = ".".join(bottle.__version__.split(".")[:2]) 17 | release = bottle.__version__ 18 | add_function_parentheses = True 19 | add_module_names = False 20 | autodoc_member_order = 'bysource' 21 | autodoc_class_signature = 'separated' 22 | pygments_style = 'sphinx' 23 | intersphinx_mapping = {'python': ('https://docs.python.org/3', None), 24 | 'werkzeug': ('https://werkzeug.palletsprojects.com/en/3.0.x', None)} 25 | 26 | locale_dirs = ['_locale/'] 27 | gettext_compact = False 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/contributors.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Contributors 3 | ============ 4 | 5 | .. include:: ../AUTHORS -------------------------------------------------------------------------------- /docs/deployment.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: python 2 | .. currentmodule:: bottle 3 | 4 | .. _flup: https://pypi.org/project/flup/ 5 | .. _gae: http://code.google.com/appengine/docs/python/overview.html 6 | .. _wsgiref: http://docs.python.org/library/wsgiref.html 7 | .. _cherrypy: https://cherrypy.dev/ 8 | .. _paste: https://pythonpaste.readthedocs.io/ 9 | .. _gunicorn: http://pypi.python.org/pypi/gunicorn 10 | .. _tornado: http://www.tornadoweb.org/ 11 | .. _twisted: http://twistedmatrix.com/ 12 | .. _diesel: http://dieselweb.org/ 13 | .. _meinheld: http://pypi.python.org/pypi/meinheld 14 | .. _bjoern: http://pypi.python.org/pypi/bjoern 15 | .. _gevent: http://www.gevent.org/ 16 | .. _eventlet: http://eventlet.net/ 17 | .. _waitress: http://readthedocs.org/docs/waitress/en/latest/ 18 | .. _apache: http://httpd.apache.org/ 19 | .. _mod_wsgi: http://code.google.com/p/modwsgi/ 20 | .. _pound: http://www.apsis.ch/pound 21 | .. _nginx: http://nginx.org/ 22 | .. _lighttpd: http://www.lighttpd.net/ 23 | .. _cherokee: http://cherokee-project.com/ 24 | .. _uWSGI: https://uwsgi-docs.readthedocs.io/en/latest/ 25 | .. _cheroot: https://cheroot.cherrypy.dev/ 26 | 27 | .. _tutorial-deployment: 28 | 29 | ================================================================================ 30 | Deployment 31 | ================================================================================ 32 | 33 | The bottle :func:`run` function, when called without any parameters, starts a local development server on port 8080. You can access and test your application via http://localhost:8080/ if you are on the same host. 34 | 35 | To get your application available to the outside world, specify the IP the server should listen to (e.g. ``run(host='192.168.0.1')``) or let the server listen to all interfaces at once (e.g. ``run(host='0.0.0.0')``). The listening port can be changed in a similar way, but you need root or admin rights to choose a port below 1024. Port 80 is the standard for HTTP servers:: 36 | 37 | # Listen to HTTP on all interfaces 38 | if __name__ == '__main__': 39 | run(host='0.0.0.0', port=80) 40 | 41 | Scaling for Production 42 | ================================================================================ 43 | 44 | The built-in development server is base on `wsgiref WSGIServer `_, which is a very simple non-threading HTTP server implementation. This is perfectly fine for development, but may become a performance bottleneck when server load increases. 45 | 46 | The easiest way to increase performance is to install a multi-threaded server library like cheroot_ or gunicorn_ and tell Bottle to use that instead of the single-threaded wsgiref server:: 47 | 48 | run(server='cheroot', ...) # Pure Python, runs everywhere 49 | run(server='gunicorn', ...) # High performance 50 | 51 | Or using the ``bottle`` command line interface: 52 | 53 | .. code-block:: sh 54 | 55 | python3 -m bottle --server gunicorn [...] mymodule:app 56 | 57 | For production deployments gunicorn_ is a really good choice. It comes with its own command line utility that supports a lot more options than bottle. Since :class:`Bottle` instances are WSGI applications, you can tell gunicorn_ (or any other WSGI server) to load your app instead of calling :func:`run` yourself: 58 | 59 | .. code-block:: sh 60 | 61 | gunicorn -w 4 mymodule:app 62 | 63 | This will start your application with 4 gunicorn workers and sane default settings. For more details and more complete examples, check out `Gunicorn Documentation `_. 64 | 65 | Server adapters 66 | ------------------------------------------------------------------------------ 67 | 68 | Bottle ships with a bunch of ready-to-use adapters for the most common WSGI servers so you can try out different server backends easily. You can select a server backend via `run(server='NAME')` or `python3 -m bottle --server NAME`. Here is an incomplete list: 69 | 70 | ======== ============ ====================================================== 71 | Name Homepage Description 72 | ======== ============ ====================================================== 73 | cgi Run as CGI script 74 | flup flup_ Run as FastCGI process 75 | gae gae_ Helper for Google App Engine deployments 76 | wsgiref wsgiref_ Single-threaded default server 77 | cherrypy cherrypy_ Multi-threaded (deprectated)) 78 | cheroot cheroot_ Successor of cheerypy 79 | paste paste_ Multi-threaded, stable, tried and tested 80 | waitress waitress_ Multi-threaded, poweres Pyramid 81 | gunicorn gunicorn_ Pre-forked, partly written in C 82 | eventlet eventlet_ Asynchronous framework with WSGI support. 83 | gevent gevent_ Asynchronous (greenlets) 84 | diesel diesel_ Asynchronous (greenlets) 85 | tornado tornado_ Asynchronous, powers some parts of Facebook 86 | twisted twisted_ Asynchronous, well tested but... twisted 87 | meinheld meinheld_ Asynchronous, partly written in C 88 | bjoern bjoern_ Asynchronous, very fast and written in C 89 | auto Automatically selects the first available server adapter 90 | ======== ============ ====================================================== 91 | 92 | Those adapters are very basic and just for convenience, though. If you need more control over your deployment, refer to the server backend documentation and mount your Bottle application just like any other WSGI application. 93 | 94 | 95 | WSGI Deployment 96 | ------------------------------------------------------------------------------ 97 | 98 | If there is no adapter for your favorite server or if you need more control over the server setup, you may want to start the server manually. Refer to the server documentation on how to run WSGI applications. Here is an example for cheroot_:: 99 | 100 | import cheroot.wsgi 101 | import mymodule.app 102 | 103 | wsgi_server = cheroot.wsgi.Server( 104 | bind_addr=('0.0.0.0', 80), 105 | wsgi_app=mymodule.app 106 | ) 107 | 108 | try: 109 | wsgi_server.start() 110 | finally: 111 | wsgi_server.stop() 112 | 113 | -------------------------------------------------------------------------------- /docs/development.rst: -------------------------------------------------------------------------------- 1 | Developer Notes 2 | ================= 3 | 4 | This document is intended for developers and package maintainers interested in the bottle development and release workflow. If you want to contribute, you are just right! 5 | 6 | 7 | Get involved 8 | ------------ 9 | 10 | There are several ways to join the community and stay up to date. Here are some of them: 11 | 12 | * **Mailing list**: Join our mailing list by sending an email to `bottlepy+subscribe@googlegroups.com `_ (no google account required). 13 | * **IRC**: Join `#bottlepy on irc.libera.chat `_ or use the `web chat interface `_. 14 | 15 | 16 | Get the Sources 17 | --------------- 18 | 19 | The bottle `development repository `_ and the `issue tracker `_ are both hosted at `github `_. If you plan to contribute, it is a good idea to create an account there and fork the main repository. This way your changes and ideas are visible to other developers and can be discussed openly. Even without an account, you can clone the repository or just download the latest development version as a source archive. 20 | 21 | * **git:** ``git clone git://github.com/bottlepy/bottle.git`` 22 | * **git/https:** ``git clone https://github.com/bottlepy/bottle.git`` 23 | * **Download:** Development branch as `tar archive `_ or `zip file `_. 24 | 25 | 26 | Releases and Updates 27 | -------------------- 28 | 29 | Bottle is released at irregular intervals and distributed through `PyPI `_. Release candidates are only available from the git repository mentioned above. Debian and many other Linux distributions offer packages. 30 | 31 | The Bottle version number splits into three parts (**major.minor.patch**) but does not follow the rules of `SemVer `_. Instead, you can usually rely on the following rules: 32 | 33 | Major Release (x.0) 34 | The major release number is increased on important milestones that change the design of core parts of the framework and break backward compatibility in some fundamental way. You probably have to change parts of your application to use a new major release. These releases are very rare, through. 35 | 36 | Minor Release (x.y) 37 | The minor release number is increased whenever APIs or behavior changes in some backwards incompatible way or major features or new APIs are added. You might get some depreciation warnings any may have to tweak some configuration settings to restore the old behavior, but in most cases these changes are designed to be backward compatible for at least one minor release. You should update to stay up do date, but don't have to. 38 | 39 | Patches (x.y.z) 40 | The patch number is increased on bug-fixes and other patches that do not change APIs or behaviour. You can safely update without editing your application code. In fact, you really should as soon as possible, because important security fixes are released this way. 41 | 42 | Pre-Release Versions 43 | Release candidates are marked by an ``rc`` in their revision number. These are API stable most of the time and open for testing, but not officially released yet. You should not use these for production. 44 | 45 | 46 | Repository Structure 47 | -------------------- 48 | 49 | The source repository is structured as follows: 50 | 51 | ``master`` branch 52 | This is the integration, testing and development branch. All changes that are planned to be part of the next release are merged and tested here. 53 | 54 | ``release-x.y`` branches 55 | As soon as the master branch is (almost) ready for a new release, it is branched into a new release branch. This "release candidate" is feature-frozen but may receive bug-fixes and last-minute changes until it is considered production ready and officially released. From that point on it is called a "maintenance branch" and still receives bug-fixes, but only important ones. The patch number is increased on each push to these branches, so you can keep up with important changes. 56 | 57 | Feature branches 58 | All other branches are feature branches. These are based on the master branch and only live as long as they are still active and not merged back into ``master``. 59 | 60 | 61 | .. rubric:: What does this mean for a developer? 62 | 63 | If you want to add a feature, create a new feature branch from ``master``. If you want to fix a bug, branch off of ``release-x.y`` for each affected release. Please use a separate branch for each feature or bug to make integration as easy as possible. 64 | 65 | .. rubric:: What does this mean for a maintainer ? 66 | 67 | Watch the tags (and the mailing list) for bug-fixes and new releases. If you want to fetch a specific release from the git repository, trust the tags, not the branches. A branch may contain changes that are not released yet, but a tag marks the exact commit which changed the version number. 68 | 69 | 70 | Submitting Patches 71 | ------------------ 72 | 73 | The best way to get your changes integrated into the main development branch is to fork the main repository at github, create a new feature-branch, apply your changes and send a pull-request. Further down this page is a small collection of git workflow examples that may guide you. Submitting git-compatible patches to the mailing list is fine too. In any case, please follow some basic rules: 74 | 75 | * **Documentation:** Tell us what your patch does. Comment your code. If you introduced a new feature, add to the documentation so others can learn about it. 76 | * **Test:** Write tests to prove that your code works as expected and does not break anything. If you fixed a bug, write at least one test-case that triggers the bug. Make sure that all tests pass before you submit a patch. 77 | * **One patch at a time:** Only fix one bug or add one feature at a time. Design your patches so that they can be applied as a whole. Keep your patches clean, small and focused. 78 | * **Sync with upstream:** If the ``upstream/master`` branch changed while you were working on your patch, rebase or pull to make sure that your patch still applies without conflicts. 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: python 2 | .. currentmodule:: bottle 3 | 4 | .. _mako: http://www.makotemplates.org/ 5 | .. _cheetah: http://www.cheetahtemplate.org/ 6 | .. _jinja2: https://jinja.palletsprojects.com/ 7 | .. _paste: https://pythonpaste.readthedocs.io/ 8 | .. _bjoern: https://github.com/jonashaag/bjoern 9 | .. _flup: http://trac.saddi.com/flup 10 | .. _gunicorn: https://gunicorn.org/ 11 | .. _cheroot: https://cheroot.cherrypy.dev/ 12 | .. _WSGI: https://peps.python.org/pep-3333/ 13 | .. _Python: http://python.org/ 14 | .. _testing: https://github.com/bottlepy/bottle/raw/master/bottle.py 15 | .. _issue_tracker: https://github.com/bottlepy/bottle/issues 16 | .. _PyPI: http://pypi.python.org/pypi/bottle 17 | .. _gae: https://developers.google.com/appengine/ 18 | 19 | ============================ 20 | Bottle: Python Web Framework 21 | ============================ 22 | 23 | Bottle is a fast, simple and lightweight WSGI_ micro web-framework for Python_. It is distributed as a single file module and has no dependencies other than the `Python Standard Library `_. 24 | 25 | 26 | * **Routing:** Requests to function-call mapping with support for clean and dynamic URLs. 27 | * **Templates:** Fast and pythonic :ref:`built-in template engine ` and support for mako_, jinja2_ and cheetah_ templates. 28 | * **Utilities:** Convenient access to form data, file uploads, cookies, headers and other HTTP features. 29 | * **Server:** Built-in HTTP development server and support for a wide range of WSGI_ capable HTTP server (e.g. gunicorn_, paste_ or cheroot_). 30 | 31 | .. rubric:: Example: "Hello World" in a bottle 32 | 33 | :: 34 | 35 | from bottle import route, run, template 36 | 37 | @route('/hello/') 38 | def index(name): 39 | return template('Hello {{name}}!', name=name) 40 | 41 | run(host='localhost', port=8080) 42 | 43 | Run this script or paste it into a Python console, then point your browser to ``_. That's it. 44 | 45 | Download and Install 46 | ==================== 47 | 48 | .. __: https://github.com/bottlepy/bottle/raw/master/bottle.py 49 | 50 | Install the latest stable release with ``pip install bottle`` or download `bottle.py`__ (unstable) into your project directory. There are no hard [1]_ dependencies other than the Python standard library. 51 | 52 | Dead Snakes 53 | =========== 54 | 55 | Bottle up to version 0.12 supported an absurd range of Python versions, some of which reached their end-of-life well over a decade ago. Starting with Bottle 0.13 we ensure backwards compatibility with `maintained versions of Python `_ only. Outdated Python versions may still work, but are no longer tested for compatibility. 56 | 57 | If you are in the unfortunate position to have to rely on "dead snakes" for production, just stick with Bottle 0.12 (LTS) or whichever release of Bottle still supports it. Everyone else should upgrade regularly to benefit from new features and improvements. 58 | 59 | .. list-table:: Python Support Matrix 60 | :widths: 50 25 25 61 | :header-rows: 1 62 | 63 | * - Bottle Release 64 | - Python 2 65 | - Python 3 66 | * - 0.12 67 | - 2.5 - 2.7 68 | - 3.2 - 3.12 69 | * - 0.13 70 | - 2.7 71 | - >=3.8 [2]_ 72 | * - 0.14 (planned) 73 | - *dropped* 74 | - >=3.9 [2]_ 75 | 76 | 77 | 78 | Documentation 79 | ============= 80 | 81 | .. toctree:: 82 | :maxdepth: 2 83 | :caption: Getting Started 84 | 85 | tutorial 86 | api 87 | changelog 88 | faq 89 | 90 | .. toctree:: 91 | :maxdepth: 2 92 | :caption: Advanced Topics 93 | 94 | routing 95 | configuration 96 | stpl 97 | deployment 98 | async 99 | 100 | .. toctree:: 101 | :maxdepth: 2 102 | :caption: Plugins 103 | 104 | plugins/index 105 | plugins/dev 106 | plugins/list 107 | 108 | .. toctree:: 109 | :maxdepth: 2 110 | :caption: Additional Notes 111 | 112 | tutorial_app 113 | 114 | .. toctree:: 115 | :maxdepth: 2 116 | :caption: Development 117 | 118 | development 119 | contributors 120 | 121 | 122 | License 123 | ================== 124 | 125 | Code and documentation are available according to the MIT License: 126 | 127 | .. include:: ../LICENSE 128 | :literal: 129 | 130 | The Bottle logo however is *NOT* covered by that license. It is allowed to 131 | use the logo as a link to the bottle homepage or in direct context with 132 | the unmodified library. In all other cases please ask first. 133 | 134 | .. rubric:: Footnotes 135 | 136 | .. [1] Usage of the template or server adapter classes requires the corresponding template or server modules. 137 | .. [2] Bottle often still works with recently discontinued Python 3.x versions. We will not intentionally break compatibility, but also no longer test against those versions. Use at your own risk. 138 | -------------------------------------------------------------------------------- /docs/plugins/list.rst: -------------------------------------------------------------------------------- 1 | .. currentmodule:: bottle 2 | 3 | ========================= 4 | 3rd Party Plugins 5 | ========================= 6 | 7 | This is a list of third-party plugins that add extend Bottles core functionality or integrate other libraries with the Bottle framework. 8 | 9 | Have a look at :ref:`plugins` for general questions about plugins (installation, usage). If you plan to develop a new plugin, the :ref:`plugindev` may help you. 10 | 11 | `Bottle-Beaker `_ 12 | Beaker to session and caching library with WSGI Middleware 13 | 14 | `Bottle-Cork `_ 15 | Cork provides a simple set of methods to implement Authentication and Authorization in web applications based on Bottle. 16 | 17 | `Bottle-Cors-plugin `_ 18 | Cors-plugin is the easiest way to implement cors on your bottle web application 19 | 20 | `Bottle-Extras `_ 21 | Meta package to install the bottle plugin collection. 22 | 23 | `Bottle-Flash `_ 24 | flash plugin for bottle 25 | 26 | `Bottle-Hotqueue `_ 27 | FIFO Queue for Bottle built upon redis 28 | 29 | `Macaron `_ 30 | Macaron is an object-relational mapper (ORM) for SQLite. 31 | 32 | `Bottle-Memcache `_ 33 | Memcache integration for Bottle. 34 | 35 | `Bottle-Mongo `_ 36 | MongoDB integration for Bottle 37 | 38 | `Bottle-OAuthlib `_ 39 | Adapter for oauthlib - create your own OAuth2.0 implementation 40 | 41 | `Bottle-Redis `_ 42 | Redis integration for Bottle. 43 | 44 | `Bottle-Renderer `_ 45 | Renderer plugin for bottle 46 | 47 | `Bottle-Servefiles `_ 48 | A reusable app that serves static files for bottle apps 49 | 50 | `Bottle-Sqlalchemy `_ 51 | SQLAlchemy integration for Bottle. 52 | 53 | `Bottle-Sqlite `_ 54 | SQLite3 database integration for Bottle. 55 | 56 | `Bottle-Web2pydal `_ 57 | Web2py Dal integration for Bottle. 58 | 59 | `Bottle-Werkzeug `_ 60 | Integrates the `werkzeug` library (alternative request and response objects, advanced debugging middleware and more). 61 | 62 | `bottle-smart-filters `_ 63 | Bottle Querystring smart guessing. 64 | 65 | `bottle-jwt `_ 66 | JSON Web Token authentication plugin for bottle.py 67 | 68 | `bottlejwt `_ 69 | JWT integration for bottle 70 | 71 | `canister `_ 72 | a bottle wrapper to provide logging, sessions and authentication 73 | 74 | `bottle-cerberus `_ 75 | Cerberus integration for bottle 76 | 77 | `Bottle-errorsrest `_ 78 | All errors generated from bottle are returned in json 79 | 80 | `Bottle-tools `_ 81 | Decorators that auto-supply function arguments using POST/query string data. 82 | 83 | 84 | Plugins listed here are not part of Bottle or the Bottle project, but developed and maintained by third parties. 85 | -------------------------------------------------------------------------------- /docs/routing.rst: -------------------------------------------------------------------------------- 1 | .. currentmodule:: bottle 2 | 3 | ================================================================================ 4 | Request Routing 5 | ================================================================================ 6 | 7 | Bottle uses a powerful routing engine to find the right callback for each request. The :ref:`tutorial ` shows you the basics. This document covers advanced techniques and rule mechanics in detail. 8 | 9 | Rule Syntax 10 | -------------------------------------------------------------------------------- 11 | 12 | The :class:`Router` distinguishes between two basic types of routes: **static routes** (e.g. ``/contact``) and **dynamic routes** (e.g. ``/hello/``). A route that contains one or more *wildcards* it is considered dynamic. All other routes are static. 13 | 14 | .. versionchanged:: 0.10 15 | 16 | The simplest form of a wildcard consists of a name enclosed in angle brackets (e.g. ````). The name should be unique for a given route and form a valid python identifier (alphanumeric, starting with a letter). This is because wildcards are used as keyword arguments for the request callback later. 17 | 18 | Each wildcard matches one or more characters, but stops at the first slash (``/``). This equals a regular expression of ``[^/]+`` and ensures that only one path segment is matched and routes with more than one wildcard stay unambiguous. 19 | 20 | The rule ``//`` matches as follows: 21 | 22 | ============ ========================================= 23 | Path Result 24 | ============ ========================================= 25 | /save/123 ``{'action': 'save', 'item': '123'}`` 26 | /save/123/ `No Match` 27 | /save/ `No Match` 28 | //123 `No Match` 29 | ============ ========================================= 30 | 31 | It is possible to escape characters like colon ``:`` with a backslash ``\``. This will prevent to trigger the old syntax in case you need to use ``:``. 32 | For example: the rule ``//item:`` triggers the old syntax, (see below) but ``/action/item\:`` works as intended with the new syntax. 33 | 34 | 35 | You can change the exact behaviour in many ways using filters. This is described in the next section. 36 | 37 | Wildcard Filters 38 | -------------------------------------------------------------------------------- 39 | 40 | .. versionadded:: 0.10 41 | 42 | Filters are used to define more specific wildcards, and/or transform the matched part of the URL before it is passed to the callback. A filtered wildcard is declared as ```` or ````. The syntax for the optional config part depends on the filter used. 43 | 44 | The following standard filters are implemented: 45 | 46 | * **:int** matches (signed) digits and converts the value to integer. 47 | * **:float** similar to :int but for decimal numbers. 48 | * **:path** matches all characters including the slash character in a non-greedy way and may be used to match more than one path segment. 49 | * **:re[:exp]** allows you to specify a custom regular expression in the config field. The matched value is not modified. 50 | 51 | You can add your own filters to the router. All you need is a function that returns three elements: A regular expression string, a callable to convert the URL fragment to a python value, and a callable that does the opposite. The filter function is called with the configuration string as the only parameter and may parse it as needed:: 52 | 53 | app = Bottle() 54 | 55 | def list_filter(config): 56 | ''' Matches a comma separated list of numbers. ''' 57 | delimiter = config or ',' 58 | regexp = r'\d+(%s\d)*' % re.escape(delimiter) 59 | 60 | def to_python(match): 61 | return map(int, match.split(delimiter)) 62 | 63 | def to_url(numbers): 64 | return delimiter.join(map(str, numbers)) 65 | 66 | return regexp, to_python, to_url 67 | 68 | app.router.add_filter('list', list_filter) 69 | 70 | @app.route('/follow/') 71 | def follow_users(ids): 72 | for id in ids: 73 | ... 74 | 75 | 76 | Legacy Syntax 77 | -------------------------------------------------------------------------------- 78 | 79 | .. versionchanged:: 0.10 80 | 81 | The new rule syntax was introduced in **Bottle 0.10** to simplify some common use cases, but the old syntax still works and you can find lot of code examples still using it. The differences are best described by example: 82 | 83 | =================== ==================== 84 | Old Syntax New Syntax 85 | =================== ==================== 86 | ``:name`` ```` 87 | ``:name#regexp#`` ```` 88 | ``:#regexp#`` ``<:re:regexp>`` 89 | ``:##`` ``<:re>`` 90 | =================== ==================== 91 | 92 | Try to avoid the old syntax in future projects if you can. It is not currently deprecated, but will be eventually. 93 | 94 | 95 | 96 | Explicit routing configuration 97 | -------------------------------------------------------------------------------- 98 | 99 | Route decorator can also be directly called as method. This way provides flexibility in complex setups, allowing you to directly control, when and how routing configuration done. 100 | 101 | Here is a basic example of explicit routing configuration for default bottle application:: 102 | 103 | def setup_routing(): 104 | bottle.route('/', 'GET', index) 105 | bottle.route('/edit', ['GET', 'POST'], edit) 106 | 107 | In fact, any :class:`Bottle` instance routing can be configured same way:: 108 | 109 | def setup_routing(app): 110 | app.route('/new', ['GET', 'POST'], form_new) 111 | app.route('/edit', ['GET', 'POST'], form_edit) 112 | 113 | app = Bottle() 114 | setup_routing(app) 115 | 116 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["flit_core >=3.9,<4"] 3 | build-backend = "flit_core.buildapi" 4 | 5 | [project] 6 | name = "bottle" 7 | dynamic = ["version"] 8 | requires-python = ">=3.9" 9 | license = {file = "LICENSE"} 10 | description = "Fast and simple WSGI-framework for small web-applications." 11 | readme = "README.rst" 12 | keywords = ["bottle", "wsgi", "microframework"] 13 | authors = [ 14 | {name = "Marcel Hellkamp", email = "marc@gsites.de"}, 15 | ] 16 | classifiers = [ 17 | "Development Status :: 6 - Mature", 18 | "Intended Audience :: Developers", 19 | "License :: OSI Approved :: MIT License", 20 | "Operating System :: OS Independent", 21 | "Framework :: Bottle", 22 | "Topic :: Internet :: WWW/HTTP", 23 | "Topic :: Internet :: WWW/HTTP :: Dynamic Content", 24 | "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", 25 | "Topic :: Internet :: WWW/HTTP :: WSGI", 26 | "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", 27 | "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware", 28 | "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", 29 | "Topic :: Software Development :: Libraries :: Application Frameworks", 30 | "Programming Language :: Python :: 3", 31 | ] 32 | 33 | [project.optional-dependencies] 34 | dev = [ 35 | "pytest", 36 | "pytest-cov", 37 | "build", 38 | "twine", 39 | ] 40 | docs = [ 41 | "sphinx", 42 | "sphinx-autobuild", 43 | "sphinx-intl", 44 | ] 45 | 46 | [project.urls] 47 | Homepage = "https://bottlepy.org" 48 | Documentation = "https://bottlepy.org" 49 | Repository = "http://github.com/bottlepy/bottle.git" 50 | Issues = "https://github.com/bottlepy/bottle/issues" 51 | Changelog = "https://bottlepy.org/docs/dev/changelog.html" 52 | 53 | [project.scripts] 54 | "bottle" = "bottle:main" 55 | 56 | [tool.flit.sdist] 57 | include = [ 58 | "test/*.py", 59 | "test/views/*.tpl", 60 | "AUTHORS" 61 | ] 62 | 63 | [tool.pytest.ini_options] 64 | addopts = "-ra" 65 | testpaths = [ "test" ] -------------------------------------------------------------------------------- /test/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | parallel = True 4 | data_file = ../build/.coverage 5 | 6 | [html] 7 | directory = build/coverage 8 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import with_statement 2 | from .tools import chdir 3 | import unittest 4 | import sys, os 5 | 6 | try: 7 | import coverage 8 | coverage.process_startup() 9 | except ImportError: 10 | pass 11 | 12 | import bottle 13 | bottle.debug(True) 14 | 15 | -------------------------------------------------------------------------------- /test/build_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # This script builds a specific python release to a prefix directory 3 | 4 | # Stop on any errors 5 | trap exit ERR 6 | 7 | VERSION=$1 8 | PREFIX=$2 9 | 10 | test -d $PREFIX || mkdir -p $PREFIX || die "ERROR: Could not find/create $PREFIX" 11 | PREFIX=`cd $PREFIX; pwd` 12 | 13 | PATH="$PREFIX/bin:$PATH" 14 | 15 | # Add ubuntus special lib and include dirs so python can find them. 16 | export arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH) 17 | export LDFLAGS="-L/usr/lib/$arch -L/lib/$arch" 18 | export CFLAGS="-I/usr/include/$arch" 19 | export CPPFLAGS="-I/usr/include/$arch" 20 | 21 | if [ -x $PREFIX/bin/python$VERSION ]; then 22 | echo "Found Python executable. Skipping build" 23 | exit 0 24 | fi 25 | 26 | pushd $PREFIX || exit 1 27 | echo "Downloading source ..." 28 | wget -N https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz || exit 1 29 | 30 | echo "Extracting source ..." 31 | tar -xzf Python-$VERSION.tgz || exit 1 32 | 33 | pushd Python-$VERSION || exit 1 34 | echo "Running ./configure --prefix=$PREFIX ..." 35 | ./configure --prefix=$PREFIX || exit 1 36 | 37 | echo "Running make && make install ..." 38 | (make -j8 && make install) || exit 1 39 | 40 | echo "Installing distribute and pip..." 41 | hash -r 42 | 43 | popd 44 | 45 | echo "Cleaning up..." 46 | rm -rf $VERSION.tar.gz distribute_setup.py cpython-$VERSION 47 | popd 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /test/example_settings.py: -------------------------------------------------------------------------------- 1 | A = { 2 | "B": { 3 | "C": 3 4 | } 5 | } -------------------------------------------------------------------------------- /test/test_app.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Tests for the functionality of the application object. 3 | 4 | TODO: Move other tests here. 5 | """ 6 | 7 | import unittest 8 | from bottle import Bottle 9 | 10 | class TestApplicationObject(unittest.TestCase): 11 | 12 | def test_setattr(self): 13 | """ Attributed can be assigned, but only once. """ 14 | app = Bottle() 15 | app.test = 5 16 | self.assertEqual(5, app.test) 17 | self.assertRaises(AttributeError, setattr, app, 'test', 6) 18 | del app.test 19 | app.test = 6 20 | self.assertEqual(6, app.test) 21 | -------------------------------------------------------------------------------- /test/test_auth.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import bottle 3 | from .tools import ServerTestBase 4 | 5 | class TestBasicAuth(ServerTestBase): 6 | 7 | def test__header(self): 8 | @bottle.route('/') 9 | @bottle.auth_basic(lambda x, y: False) 10 | def test(): return {} 11 | self.assertStatus(401) 12 | self.assertHeader('Www-Authenticate', 'Basic realm="private"') 13 | -------------------------------------------------------------------------------- /test/test_contextlocals.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Some objects are context-local, meaning that they have different values depending on the context they are accessed from. A context is currently defined as a thread. 4 | ''' 5 | 6 | import unittest 7 | import bottle 8 | import threading 9 | 10 | 11 | def run_thread(func): 12 | t = threading.Thread(target=func) 13 | t.start() 14 | t.join() 15 | 16 | class TestThreadLocals(unittest.TestCase): 17 | def test_request(self): 18 | e1 = {'PATH_INFO': '/t1'} 19 | e2 = {'PATH_INFO': '/t2'} 20 | 21 | def run(): 22 | bottle.request.bind(e2) 23 | self.assertEqual(bottle.request.path, '/t2') 24 | 25 | bottle.request.bind(e1) 26 | self.assertEqual(bottle.request.path, '/t1') 27 | run_thread(run) 28 | self.assertEqual(bottle.request.path, '/t1') 29 | 30 | def test_response(self): 31 | 32 | def run(): 33 | bottle.response.bind() 34 | bottle.response.content_type='test/thread' 35 | self.assertEqual(bottle.response.headers['Content-Type'], 'test/thread') 36 | 37 | bottle.response.bind() 38 | bottle.response.content_type='test/main' 39 | self.assertEqual(bottle.response.headers['Content-Type'], 'test/main') 40 | run_thread(run) 41 | self.assertEqual(bottle.response.headers['Content-Type'], 'test/main') 42 | -------------------------------------------------------------------------------- /test/test_exc.py: -------------------------------------------------------------------------------- 1 | import bottle 2 | from .tools import ServerTestBase 3 | 4 | class SomeError(Exception): 5 | pass 6 | 7 | class TestAppException(ServerTestBase): 8 | 9 | def test_no_exc(self): 10 | @bottle.route('/') 11 | def test(): return 'test' 12 | self.assertBody('test', '/') 13 | 14 | def test_memory_error(self): 15 | @bottle.route('/') 16 | def test(): raise MemoryError 17 | with self.assertRaises(MemoryError): 18 | self.urlopen("/") 19 | 20 | def test_system_Exit(self): 21 | @bottle.route('/') 22 | def test(): raise SystemExit 23 | with self.assertRaises(SystemExit): 24 | self.urlopen("/") 25 | 26 | def test_other_error(self): 27 | @bottle.route('/') 28 | def test(): raise SomeError 29 | self.assertStatus(500, '/') 30 | self.assertInBody('SomeError') 31 | 32 | def test_noncatched_error(self): 33 | @bottle.route('/') 34 | def test(): raise SomeError 35 | bottle.request.environ['exc_info'] = None 36 | self.app.catchall = False 37 | with self.assertRaises(SomeError): 38 | self.urlopen("/") 39 | self.app.catchall = True 40 | self.assertStatus(500, '/') 41 | self.assertInBody('SomeError') 42 | -------------------------------------------------------------------------------- /test/test_fileupload.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' Tests for the FileUpload wrapper. ''' 3 | 4 | import unittest 5 | import sys, os.path 6 | import bottle 7 | from bottle import FileUpload, BytesIO, tob 8 | import tempfile 9 | 10 | class TestFileUpload(unittest.TestCase): 11 | def test_name(self): 12 | self.assertEqual(FileUpload(None, 'abc', None).name, 'abc') 13 | 14 | def test_raw_filename(self): 15 | self.assertEqual(FileUpload(None, None, 'x/x').raw_filename, 'x/x') 16 | 17 | def test_content_type(self): 18 | fu = FileUpload(None, None, None, {"Content-type": "text/plain"}) 19 | self.assertEqual(fu.content_type, 'text/plain') 20 | 21 | def assertFilename(self, bad, good): 22 | fu = FileUpload(None, None, bad) 23 | self.assertEqual(fu.filename, good) 24 | 25 | def test_filename(self): 26 | self.assertFilename('with space', 'with-space') 27 | self.assertFilename('with more \t\n\r space', 'with-more-space') 28 | self.assertFilename('with/path', 'path') 29 | self.assertFilename('../path', 'path') 30 | self.assertFilename('..\\path', 'path') 31 | self.assertFilename('..', 'empty') 32 | self.assertFilename('.name.', 'name') 33 | self.assertFilename('.name.cfg', 'name.cfg') 34 | self.assertFilename(' . na me . ', 'na-me') 35 | self.assertFilename('path/', 'empty') 36 | self.assertFilename('ümläüts$', 'umlauts') 37 | self.assertFilename('', 'empty') 38 | self.assertFilename('a'+'b'*1337+'c', 'a'+'b'*254) 39 | 40 | def test_preserve_case_issue_582(self): 41 | self.assertFilename('UpperCase', 'UpperCase') 42 | 43 | def test_save_buffer(self): 44 | fu = FileUpload(open(__file__, 'rb'), 'testfile', __file__) 45 | buff = BytesIO() 46 | fu.save(buff) 47 | buff.seek(0) 48 | self.assertEqual(fu.file.read(), buff.read()) 49 | 50 | def test_save_file(self): 51 | fu = FileUpload(open(__file__, 'rb'), 'testfile', __file__) 52 | buff = tempfile.TemporaryFile() 53 | fu.save(buff) 54 | buff.seek(0) 55 | self.assertEqual(fu.file.read(), buff.read()) 56 | 57 | def test_save_overwrite_lock(self): 58 | fu = FileUpload(open(__file__, 'rb'), 'testfile', __file__) 59 | self.assertRaises(IOError, fu.save, __file__) 60 | 61 | def test_save_dir(self): 62 | fu = FileUpload(open(__file__, 'rb'), 'testfile', __file__) 63 | dirpath = tempfile.mkdtemp() 64 | filepath = os.path.join(dirpath, fu.filename) 65 | fu.save(dirpath) 66 | self.assertEqual(fu.file.read(), open(filepath, 'rb').read()) 67 | os.unlink(filepath) 68 | os.rmdir(dirpath) 69 | -------------------------------------------------------------------------------- /test/test_formsdict.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # '瓶' means "Bottle" 3 | 4 | import unittest 5 | from bottle import FormsDict, touni, tob 6 | 7 | class TestFormsDict(unittest.TestCase): 8 | def test_attr_access(self): 9 | """ FomsDict.attribute returs string values as unicode. """ 10 | d = FormsDict(py3='瓶') 11 | self.assertEqual('瓶', d.py3) 12 | self.assertEqual('瓶', d["py3"]) 13 | 14 | def test_attr_missing(self): 15 | """ FomsDict.attribute returs u'' on missing keys. """ 16 | d = FormsDict() 17 | self.assertEqual('', d.missing) 18 | -------------------------------------------------------------------------------- /test/test_html_helper.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from bottle import _parse_http_header 4 | 5 | 6 | class TestHttpUtils(unittest.TestCase): 7 | 8 | # TODO: Move more of the low level http stuff here. 9 | 10 | def test_accept_header(self): 11 | self.assertEqual(_parse_http_header( 12 | 'text/xml, text/whitespace ,' 13 | 'application/params;param=value; ws = lots ;"quote"="mid\\"quote",' 14 | '"more\\"quotes\\"",' 15 | 'I\'m in space!!!'), 16 | 17 | [('text/xml', {}), 18 | ('text/whitespace', {}), 19 | ('application/params', {'param': 'value', 'ws': 'lots', 'quote': 'mid"quote'}), 20 | ('more"quotes"', {}), 21 | ('I\'m in space!!!', {})] 22 | ) 23 | 24 | -------------------------------------------------------------------------------- /test/test_importhook.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import unittest 3 | import sys, os 4 | import bottle 5 | 6 | class TestImportHooks(unittest.TestCase): 7 | 8 | def make_module(self, name, **args): 9 | mod = sys.modules.setdefault(name, bottle.new_module(name)) 10 | mod.__file__ = '' % name 11 | mod.__dict__.update(**args) 12 | return mod 13 | 14 | def test_direkt_import(self): 15 | mod = self.make_module('bottle_test') 16 | import bottle.ext.test 17 | self.assertEqual(bottle.ext.test, mod) 18 | 19 | def test_from_import(self): 20 | mod = self.make_module('bottle_test') 21 | from bottle.ext import test 22 | self.assertEqual(test, mod) 23 | 24 | def test_data_import(self): 25 | mod = self.make_module('bottle_test', item='value') 26 | from bottle.ext.test import item 27 | self.assertEqual(item, 'value') 28 | 29 | def test_import_fail(self): 30 | ''' Test a simple static page with this server adapter. ''' 31 | def test(): 32 | import bottle.ext.doesnotexist 33 | self.assertRaises(ImportError, test) 34 | 35 | def test_ext_isfile(self): 36 | ''' The virtual module needs a valid __file__ attribute. 37 | If not, the Google app engine development server crashes on windows. 38 | ''' 39 | from bottle import ext 40 | self.assertTrue(os.path.isfile(ext.__file__)) 41 | -------------------------------------------------------------------------------- /test/test_jinja2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import unittest 3 | from bottle import Jinja2Template, jinja2_template, jinja2_view, touni 4 | from .tools import warn, chdir 5 | 6 | 7 | 8 | class TestJinja2Template(unittest.TestCase): 9 | 10 | def test_string(self): 11 | """ Templates: Jinja2 string""" 12 | t = Jinja2Template('start {{var}} end').render(var='var') 13 | self.assertEqual('start var end', ''.join(t)) 14 | 15 | def test_file(self): 16 | """ Templates: Jinja2 file""" 17 | with chdir(__file__): 18 | t = Jinja2Template(name='./views/jinja2_simple.tpl', lookup=['.']).render(var='var') 19 | self.assertEqual('start var end', ''.join(t)) 20 | 21 | def test_name(self): 22 | """ Templates: Jinja2 lookup by name """ 23 | with chdir(__file__): 24 | t = Jinja2Template(name='jinja2_simple', lookup=['./views/']).render(var='var') 25 | self.assertEqual('start var end', ''.join(t)) 26 | 27 | def test_notfound(self): 28 | """ Templates: Unavailable templates""" 29 | self.assertRaises(Exception, Jinja2Template, name="abcdef", lookup=['./views/']) 30 | 31 | def test_error(self): 32 | """ Templates: Exceptions""" 33 | self.assertRaises(Exception, Jinja2Template, '{% for badsyntax') 34 | 35 | def test_inherit(self): 36 | """ Templates: Jinja2 lookup and inherience """ 37 | with chdir(__file__): 38 | t = Jinja2Template(name='jinja2_inherit', lookup=['./views/']).render() 39 | self.assertEqual('begin abc end', ''.join(t)) 40 | 41 | def test_custom_filters(self): 42 | """Templates: jinja2 custom filters """ 43 | from bottle import jinja2_template as template 44 | settings = dict(filters = {"star": lambda var: touni("").join((touni('*'), var, touni('*')))}) 45 | t = Jinja2Template("start {{var|star}} end", **settings) 46 | self.assertEqual("start *var* end", t.render(var="var")) 47 | 48 | def test_custom_tests(self): 49 | """Templates: jinja2 custom tests """ 50 | from bottle import jinja2_template as template 51 | TEMPL = touni("{% if var is even %}gerade{% else %}ungerade{% endif %}") 52 | settings = dict(tests={"even": lambda x: False if x % 2 else True}) 53 | t = Jinja2Template(TEMPL, **settings) 54 | self.assertEqual("gerade", t.render(var=2)) 55 | self.assertEqual("ungerade", t.render(var=1)) 56 | 57 | def test_template_shortcut(self): 58 | result = jinja2_template('start {{var}} end', var='middle') 59 | self.assertEqual(touni('start middle end'), result) 60 | 61 | def test_view_decorator(self): 62 | @jinja2_view('start {{var}} end') 63 | def test(): 64 | return dict(var='middle') 65 | self.assertEqual(touni('start middle end'), test()) 66 | 67 | 68 | try: 69 | import jinja2 70 | except ImportError: 71 | warn("No Jinja2 template support. Skipping tests.") 72 | del TestJinja2Template 73 | 74 | -------------------------------------------------------------------------------- /test/test_mako.py: -------------------------------------------------------------------------------- 1 | from __future__ import with_statement 2 | import unittest 3 | from .tools import warn, chdir 4 | from bottle import MakoTemplate, mako_template, mako_view, touni 5 | 6 | class TestMakoTemplate(unittest.TestCase): 7 | def test_string(self): 8 | """ Templates: Mako string""" 9 | t = MakoTemplate('start ${var} end').render(var='var') 10 | self.assertEqual('start var end', t) 11 | 12 | def test_file(self): 13 | """ Templates: Mako file""" 14 | with chdir(__file__): 15 | t = MakoTemplate(name='./views/mako_simple.tpl', lookup=['.']).render(var='var') 16 | self.assertEqual('start var end\n', t) 17 | 18 | def test_name(self): 19 | """ Templates: Mako lookup by name """ 20 | with chdir(__file__): 21 | t = MakoTemplate(name='mako_simple', lookup=['./views/']).render(var='var') 22 | self.assertEqual('start var end\n', t) 23 | 24 | def test_notfound(self): 25 | """ Templates: Unavailable templates""" 26 | self.assertRaises(Exception, MakoTemplate, lookup=['./views/'], name="abcdef") 27 | 28 | def test_error(self): 29 | """ Templates: Exceptions""" 30 | self.assertRaises(Exception, MakoTemplate, '%for badsyntax') 31 | 32 | def test_inherit(self): 33 | """ Templates: Mako lookup and inherience """ 34 | with chdir(__file__): 35 | t = MakoTemplate(name='mako_inherit', lookup=['./views/']).render(var='v') 36 | self.assertEqual('o\ncvc\no\n', t) 37 | t = MakoTemplate('<%inherit file="mako_base.tpl"/>\nc${var}c\n', lookup=['./views/']).render(var='v') 38 | self.assertEqual('o\ncvc\no\n', t) 39 | t = MakoTemplate('<%inherit file="views/mako_base.tpl"/>\nc${var}c\n', lookup=['./']).render(var='v') 40 | self.assertEqual('o\ncvc\no\n', t) 41 | 42 | def test_template_shortcut(self): 43 | result = mako_template('start ${var} end', var='middle') 44 | self.assertEqual(touni('start middle end'), result) 45 | 46 | def test_view_decorator(self): 47 | @mako_view('start ${var} end') 48 | def test(): 49 | return dict(var='middle') 50 | self.assertEqual(touni('start middle end'), test()) 51 | 52 | 53 | try: 54 | import mako 55 | except ImportError: 56 | warn("No Mako template support. Skipping tests.") 57 | del TestMakoTemplate 58 | -------------------------------------------------------------------------------- /test/test_mdict.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from bottle import MultiDict, HeaderDict 3 | 4 | class TestMultiDict(unittest.TestCase): 5 | def test_isadict(self): 6 | """ MultiDict should behaves like a normal dict """ 7 | d, m = dict(a=5), MultiDict(a=5) 8 | d['key'], m['key'] = 'value', 'value' 9 | d['k2'], m['k2'] = 'v1', 'v1' 10 | d['k2'], m['k2'] = 'v2', 'v2' 11 | self.assertEqual(list(d.keys()), list(m.keys())) 12 | self.assertEqual(list(d.values()), list(m.values())) 13 | self.assertEqual(list(d.keys()), list(m.iterkeys())) 14 | self.assertEqual(list(d.values()), list(m.itervalues())) 15 | self.assertEqual(d.get('key'), m.get('key')) 16 | self.assertEqual(d.get('cay'), m.get('cay')) 17 | self.assertEqual(list(iter(d)), list(iter(m))) 18 | self.assertEqual([k for k in d], [k for k in m]) 19 | self.assertEqual(len(d), len(m)) 20 | self.assertEqual('key' in d, 'key' in m) 21 | self.assertEqual('cay' in d, 'cay' in m) 22 | self.assertRaises(KeyError, lambda: m['cay']) 23 | 24 | def test_ismulti(self): 25 | """ MultiDict has some special features """ 26 | m = MultiDict(a=5) 27 | m['a'] = 6 28 | self.assertEqual([5, 6], m.getall('a')) 29 | self.assertEqual([], m.getall('b')) 30 | self.assertEqual([('a', 5), ('a', 6)], list(m.iterallitems())) 31 | 32 | def test_isheader(self): 33 | """ HeaderDict replaces by default and title()s its keys """ 34 | m = HeaderDict(abc_def=5) 35 | m['abc_def'] = 6 36 | self.assertEqual(['6'], m.getall('abc_def')) 37 | m.append('abc_def', 7) 38 | self.assertEqual(['6', '7'], m.getall('abc_def')) 39 | self.assertEqual([('Abc-Def', '6'), ('Abc-Def', '7')], list(m.iterallitems())) 40 | 41 | def test_headergetbug(self): 42 | ''' Assure HeaderDict.get() to be case insensitive ''' 43 | d = HeaderDict() 44 | d['UPPER'] = 'UPPER' 45 | d['lower'] = 'lower' 46 | self.assertEqual(d.get('upper'), 'UPPER') 47 | self.assertEqual(d.get('LOWER'), 'lower') 48 | -------------------------------------------------------------------------------- /test/test_mount.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import bottle 3 | from .tools import ServerTestBase, api 4 | from bottle import response 5 | 6 | class TestAppMounting(ServerTestBase): 7 | def setUp(self): 8 | ServerTestBase.setUp(self) 9 | self.subapp = bottle.Bottle() 10 | 11 | @self.subapp.route('/') 12 | @self.subapp.route('/test/') 13 | def test(test='foo'): 14 | return test 15 | 16 | def test_mount_unicode_path_bug602(self): 17 | self.app.mount('/mount/', self.subapp) 18 | self.assertBody('äöü', '/mount/test/äöü') 19 | self.app.route('/route/', callback=lambda param: param) 20 | self.assertBody('äöü', '/route/äöü') 21 | 22 | def test_mount_order_bug581(self): 23 | self.app.mount('/test/', self.subapp) 24 | 25 | # This should not match 26 | self.app.route('/', callback=lambda test: test) 27 | 28 | self.assertStatus(200, '/test/') 29 | self.assertBody('foo', '/test/') 30 | 31 | def test_mount(self): 32 | self.app.mount('/test/', self.subapp) 33 | self.assertStatus(404, '/') 34 | self.assertStatus(404, '/test') 35 | self.assertStatus(200, '/test/') 36 | self.assertBody('foo', '/test/') 37 | self.assertStatus(200, '/test/test/bar') 38 | self.assertBody('bar', '/test/test/bar') 39 | 40 | def test_mount_meta(self): 41 | self.app.mount('/test/', self.subapp) 42 | self.assertEqual( 43 | self.subapp.config['_mount.prefix'], '/test/') 44 | self.assertEqual( 45 | self.subapp.config['_mount.app'], self.app) 46 | 47 | @api('0.9', '0.13') 48 | def test_no_slash_prefix(self): 49 | self.app.mount('/test', self.subapp) 50 | self.assertStatus(404, '/') 51 | self.assertStatus(200, '/test') 52 | self.assertBody('foo', '/test') 53 | self.assertStatus(200, '/test/') 54 | self.assertBody('foo', '/test/') 55 | self.assertStatus(200, '/test/test/bar') 56 | self.assertBody('bar', '/test/test/bar') 57 | 58 | def test_mount_no_plugins(self): 59 | def plugin(func): 60 | def wrapper(*a, **ka): 61 | return 'Plugin' 62 | return wrapper 63 | self.app.install(plugin) 64 | self.app.route('/foo', callback=lambda: 'baz') 65 | self.app.mount('/test/', self.subapp) 66 | self.assertBody('Plugin', '/foo') 67 | self.assertBody('foo', '/test/') 68 | 69 | def test_mount_wsgi(self): 70 | status = {} 71 | def app(environ, start_response): 72 | start_response('200 OK', [('X-Test', 'WSGI')]) 73 | return 'WSGI ' + environ['PATH_INFO'] 74 | self.app.mount('/test', app) 75 | self.assertStatus(200, '/test/') 76 | self.assertBody('WSGI /', '/test') 77 | self.assertBody('WSGI /', '/test/') 78 | self.assertHeader('X-Test', 'WSGI', '/test/') 79 | self.assertBody('WSGI /test/bar', '/test/test/bar') 80 | 81 | def test_mount_cookie(self): 82 | @self.subapp.route('/cookie') 83 | def test_cookie(): 84 | response.set_cookie('a', 'a') 85 | response.set_cookie('b', 'b') 86 | self.app.mount('/test/', self.subapp) 87 | c = self.urlopen('/test/cookie')['header']['Set-Cookie'] 88 | self.assertEqual(['a=a', 'b=b'], list(sorted(c.split(', ')))) 89 | 90 | def test_mount_wsgi_ctype_bug(self): 91 | status = {} 92 | def app(environ, start_response): 93 | start_response('200 OK', [('Content-Type', 'test/test')]) 94 | return 'WSGI ' + environ['PATH_INFO'] 95 | self.app.mount('/test', app) 96 | self.assertHeader('Content-Type', 'test/test', '/test/') 97 | 98 | def test_mount_json_bug(self): 99 | @self.subapp.route('/json') 100 | def route(): 101 | return {'a': 5} 102 | self.app.mount('/test/', self.subapp) 103 | self.assertHeader('Content-Type', 'application/json', '/test/json') 104 | 105 | def test_mount_get_url(self): 106 | @self.subapp.route('/test', name="test") 107 | def route(): 108 | return bottle.url("test") 109 | 110 | self.app.mount('/test/', self.subapp) 111 | self.assertBody('/test/test', '/test/test') 112 | 113 | 114 | class TestAppMerging(ServerTestBase): 115 | def setUp(self): 116 | ServerTestBase.setUp(self) 117 | self.subapp = bottle.Bottle() 118 | @self.subapp.route('/') 119 | @self.subapp.route('/test/') 120 | def test(test='foo'): 121 | return test 122 | 123 | def test_merge(self): 124 | self.app.merge(self.subapp) 125 | self.assertStatus(200, '/') 126 | self.assertBody('foo', '/') 127 | self.assertStatus(200, '/test/bar') 128 | self.assertBody('bar', '/test/bar') 129 | -------------------------------------------------------------------------------- /test/test_oorouting.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests & demonstrates various OO approaches to routes 3 | """ 4 | import unittest 5 | import sys 6 | 7 | if sys.version_info >= (3, 0, 0): 8 | from io import BytesIO 9 | else: 10 | from StringIO import StringIO as BytesIO 11 | 12 | __author__ = 'atc' 13 | 14 | from bottle import Bottle, request, tob, BaseRequest 15 | 16 | 17 | class TestRouter(object): 18 | """ 19 | A test class for wrapping routes to test certain OO scenarios 20 | """ 21 | 22 | app = Bottle() 23 | 24 | @app.post("/route1/") 25 | def route_1(self, msg): 26 | body = request.body.readline() 27 | return {'msg': msg, 'len': len(body)} 28 | 29 | 30 | class TestRoutes(unittest.TestCase): 31 | def test_route1(self): 32 | body = "abc" 33 | request.environ['CONTENT_LENGTH'] = str(len(tob(body))) 34 | request.environ['wsgi.input'] = BytesIO() 35 | request.environ['wsgi.input'].write(tob(body)) 36 | request.environ['wsgi.input'].seek(0) 37 | 38 | result = TestRouter().route_1("bob") 39 | self.assertEqual(result, dict(msg="bob", len=3)) 40 | -------------------------------------------------------------------------------- /test/test_resources.py: -------------------------------------------------------------------------------- 1 | from bottle import ResourceManager 2 | import os.path 3 | import unittest 4 | 5 | class TestResourceManager(unittest.TestCase): 6 | 7 | def test_path_normalize(self): 8 | tests = ('/foo/bar/', '/foo/bar/baz', '/foo/baz/../bar/blub') 9 | for test in tests: 10 | rm = ResourceManager() 11 | rm.add_path(test) 12 | self.assertEqual(rm.path, ['/foo/bar/']) 13 | 14 | def test_path_create(self): 15 | import tempfile, shutil 16 | tempdir = tempfile.mkdtemp() 17 | try: 18 | rm = ResourceManager() 19 | exists = rm.add_path('./test/', base=tempdir) 20 | self.assertEqual(exists, False) 21 | exists = rm.add_path('./test2/', base=tempdir, create=True) 22 | self.assertEqual(exists, True) 23 | finally: 24 | shutil.rmtree(tempdir) 25 | 26 | def test_path_absolutize(self): 27 | tests = ('./foo/bar/', './foo/bar/baz', './foo/baz/../bar/blub') 28 | abspath = os.path.abspath('./foo/bar/') + os.sep 29 | for test in tests: 30 | rm = ResourceManager() 31 | rm.add_path(test) 32 | self.assertEqual(rm.path, [abspath]) 33 | 34 | for test in tests: 35 | rm = ResourceManager() 36 | rm.add_path(test[2:]) 37 | self.assertEqual(rm.path, [abspath]) 38 | 39 | def test_path_unique(self): 40 | tests = ('/foo/bar/', '/foo/bar/baz', '/foo/baz/../bar/blub') 41 | rm = ResourceManager() 42 | [rm.add_path(test) for test in tests] 43 | self.assertEqual(rm.path, ['/foo/bar/']) 44 | 45 | def test_root_path(self): 46 | tests = ('/foo/bar/', '/foo/bar/baz', '/foo/baz/../bar/blub') 47 | for test in tests: 48 | rm = ResourceManager() 49 | rm.add_path('./baz/', test) 50 | self.assertEqual(rm.path, ['/foo/bar/baz/']) 51 | 52 | for test in tests: 53 | rm = ResourceManager() 54 | rm.add_path('baz/', test) 55 | self.assertEqual(rm.path, ['/foo/bar/baz/']) 56 | 57 | def test_path_order(self): 58 | rm = ResourceManager() 59 | rm.add_path('/middle/') 60 | rm.add_path('/first/', index=0) 61 | rm.add_path('/last/') 62 | self.assertEqual(rm.path, ['/first/', '/middle/', '/last/']) 63 | 64 | def test_get(self): 65 | rm = ResourceManager() 66 | rm.add_path('/first/') 67 | rm.add_path(__file__) 68 | rm.add_path('/last/') 69 | self.assertEqual(None, rm.lookup('notexist.txt')) 70 | self.assertEqual(__file__, rm.lookup(os.path.basename(__file__))) 71 | 72 | def test_open(self): 73 | rm = ResourceManager() 74 | rm.add_path(__file__) 75 | fp = rm.open(__file__) 76 | self.assertEqual(fp.read(), open(__file__).read()) 77 | -------------------------------------------------------------------------------- /test/test_route.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import bottle 3 | from .tools import api 4 | from bottle import _re_flatten 5 | 6 | 7 | class TestReFlatten(unittest.TestCase): 8 | 9 | def test_re_flatten(self): 10 | self.assertEqual(_re_flatten(r"(?:aaa)(_bbb)"), '(?:aaa)(?:_bbb)') 11 | self.assertEqual(_re_flatten(r"(aaa)(_bbb)"), '(?:aaa)(?:_bbb)') 12 | self.assertEqual(_re_flatten(r"aaa)(_bbb)"), 'aaa)(?:_bbb)') 13 | self.assertEqual(_re_flatten(r"aaa(_bbb)"), 'aaa(?:_bbb)') 14 | self.assertEqual(_re_flatten(r"aaa_bbb"), 'aaa_bbb') 15 | 16 | 17 | class TestRoute(unittest.TestCase): 18 | 19 | @api('0.12') 20 | def test_callback_inspection(self): 21 | def x(a, b): pass 22 | def d(f): 23 | def w(): 24 | return f() 25 | return w 26 | route = bottle.Route(bottle.Bottle(), None, None, d(x)) 27 | self.assertEqual(route.get_undecorated_callback(), x) 28 | self.assertEqual(set(route.get_callback_args()), set(['a', 'b'])) 29 | 30 | def d2(foo): 31 | def d(f): 32 | def w(): 33 | return f() 34 | return w 35 | return d 36 | 37 | route = bottle.Route(bottle.Bottle(), None, None, d2('foo')(x)) 38 | self.assertEqual(route.get_undecorated_callback(), x) 39 | self.assertEqual(set(route.get_callback_args()), set(['a', 'b'])) 40 | 41 | def test_callback_inspection_multiple_args(self): 42 | # decorator with argument, modifying kwargs 43 | def d2(f="1"): 44 | def d(fn): 45 | def w(*args, **kwargs): 46 | # modification of kwargs WITH the decorator argument 47 | # is necessary requirement for the error 48 | kwargs["a"] = f 49 | return fn(*args, **kwargs) 50 | return w 51 | return d 52 | 53 | @d2(f='foo') 54 | def x(a, b): 55 | return 56 | 57 | route = bottle.Route(bottle.Bottle(), None, None, x) 58 | 59 | # triggers the "TypeError: 'foo' is not a Python function" 60 | self.assertEqual(set(route.get_callback_args()), set(['a', 'b'])) 61 | 62 | def test_callback_inspection_newsig(self): 63 | env = {} 64 | eval(compile('def foo(a, *, b=5): pass', '', 'exec'), env, env) 65 | route = bottle.Route(bottle.Bottle(), None, None, env['foo']) 66 | self.assertEqual(set(route.get_callback_args()), set(['a', 'b'])) 67 | -------------------------------------------------------------------------------- /test/test_securecookies.py: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | import unittest 3 | 4 | import bottle 5 | from bottle import tob, touni 6 | from .tools import api 7 | 8 | 9 | class TestSignedCookies(unittest.TestCase): 10 | def setUp(self): 11 | self.data = touni('υηι¢σ∂є') 12 | self.secret = tob('secret') 13 | bottle.app.push() 14 | bottle.response.bind() 15 | 16 | def tear_down(self): 17 | bottle.app.pop() 18 | 19 | def get_pairs(self): 20 | for k, v in bottle.response.headerlist: 21 | if k == 'Set-Cookie': 22 | key, value = v.split(';')[0].split('=', 1) 23 | yield key.lower().strip(), value.strip() 24 | 25 | def set_pairs(self, pairs): 26 | header = ','.join(['%s=%s' % (k, v) for k, v in pairs]) 27 | bottle.request.bind({'HTTP_COOKIE': header}) 28 | 29 | def testValid(self): 30 | bottle.response.set_cookie('key', self.data, secret=self.secret) 31 | pairs = self.get_pairs() 32 | self.set_pairs(pairs) 33 | result = bottle.request.get_cookie('key', secret=self.secret) 34 | self.assertEqual(self.data, result) 35 | 36 | def testWrongKey(self): 37 | bottle.response.set_cookie('key', self.data, secret=self.secret) 38 | pairs = self.get_pairs() 39 | self.set_pairs([(k + 'xxx', v) for (k, v) in pairs]) 40 | result = bottle.request.get_cookie('key', secret=self.secret) 41 | self.assertEqual(None, result) 42 | 43 | 44 | class TestSignedCookiesWithPickle(TestSignedCookies): 45 | def setUp(self): 46 | super(TestSignedCookiesWithPickle, self).setUp() 47 | self.data = dict(a=5, b=touni('υηι¢σ∂є'), c=[1,2,3,4,tob('bytestring')]) 48 | 49 | @api("0.9", "0.13") 50 | def testValid(self): 51 | super(TestSignedCookiesWithPickle, self).testValid() 52 | 53 | @api("0.9", "0.13") 54 | def testWrongKey(self): 55 | super(TestSignedCookiesWithPickle, self).testWrongKey() 56 | -------------------------------------------------------------------------------- /test/tools.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import with_statement 3 | import os 4 | 5 | import bottle 6 | import sys 7 | import unittest 8 | import wsgiref 9 | import wsgiref.util 10 | import wsgiref.validate 11 | import warnings 12 | 13 | import mimetypes 14 | import uuid 15 | 16 | from bottle import tob, BytesIO 17 | 18 | 19 | def warn(msg): 20 | sys.stderr.write('WARNING: %s\n' % msg.strip()) 21 | 22 | 23 | def tobs(data): 24 | ''' Transforms bytes or unicode into a byte stream. ''' 25 | return BytesIO(tob(data)) 26 | 27 | 28 | class chdir(object): 29 | def __init__(self, dir): 30 | if os.path.isfile(dir): 31 | dir = os.path.dirname(dir) 32 | self.wd = os.path.abspath(dir) 33 | self.old = os.path.abspath('.') 34 | 35 | def __enter__(self): 36 | os.chdir(self.wd) 37 | 38 | def __exit__(self, exc_type, exc_val, tb): 39 | os.chdir(self.old) 40 | 41 | 42 | class assertWarn(object): 43 | def __init__(self, text): 44 | self.searchtext = text 45 | 46 | def __call__(self, func): 47 | def wrapper(*a, **ka): 48 | with warnings.catch_warnings(record=True) as wr: 49 | warnings.simplefilter("always") 50 | out = func(*a, **ka) 51 | messages = [repr(w.message) for w in wr] 52 | for msg in messages: 53 | if self.searchtext in msg: 54 | return out 55 | raise AssertionError("Could not find phrase %r in any warning messaged: %r" % (self.searchtext, messages)) 56 | return wrapper 57 | 58 | def api(introduced, deprecated=None, removed=None): 59 | current = tuple(map(int, bottle.__version__.split('-')[0].split('.'))) 60 | introduced = tuple(map(int, introduced.split('.'))) 61 | deprecated = tuple(map(int, deprecated.split('.'))) if deprecated else (99,99) 62 | removed = tuple(map(int, removed.split('.'))) if removed else (99,100) 63 | assert introduced < deprecated < removed 64 | 65 | def decorator(func): 66 | if current < introduced: 67 | return None 68 | elif current < deprecated: 69 | return func 70 | elif current < removed: 71 | func.__doc__ = '(deprecated) ' + (func.__doc__ or '') 72 | return assertWarn('DeprecationWarning')(func) 73 | else: 74 | return None 75 | return decorator 76 | 77 | 78 | def wsgistr(s): 79 | return s.encode('utf8').decode('latin1') 80 | 81 | class ServerTestBase(unittest.TestCase): 82 | def setUp(self): 83 | ''' Create a new Bottle app set it as default_app ''' 84 | self.port = 8080 85 | self.host = 'localhost' 86 | self.app = bottle.app.push() 87 | self.wsgiapp = wsgiref.validate.validator(self.app) 88 | 89 | def urlopen(self, path, method='GET', post='', env=None, crash=None): 90 | result = {'code':0, 'status':'error', 'header':{}, 'body':tob('')} 91 | def start_response(status, header, exc_info=None): 92 | if crash == "start_response": 93 | raise RuntimeError("Unittest requested crash in start_response") 94 | result['code'] = int(status.split()[0]) 95 | result['status'] = status.split(None, 1)[-1] 96 | for name, value in header: 97 | name = name.title() 98 | if name in result['header']: 99 | result['header'][name] += ', ' + value 100 | else: 101 | result['header'][name] = value 102 | env = env if env else {} 103 | wsgiref.util.setup_testing_defaults(env) 104 | env['REQUEST_METHOD'] = wsgistr(method.upper().strip()) 105 | env['PATH_INFO'] = wsgistr(path) 106 | env['QUERY_STRING'] = wsgistr('') 107 | if post: 108 | env['REQUEST_METHOD'] = 'POST' 109 | env['CONTENT_LENGTH'] = str(len(tob(post))) 110 | env['wsgi.input'].write(tob(post)) 111 | env['wsgi.input'].seek(0) 112 | response = self.wsgiapp(env, start_response) 113 | try: 114 | for part in response: 115 | try: 116 | result['body'] += part 117 | except TypeError: 118 | raise TypeError('WSGI app yielded non-byte object %s', type(part)) 119 | finally: 120 | bottle._try_close(response) 121 | return result 122 | 123 | def postmultipart(self, path, fields, files): 124 | env = multipart_environ(fields, files) 125 | return self.urlopen(path, method='POST', env=env) 126 | 127 | def tearDown(self): 128 | bottle.app.pop() 129 | 130 | def assertStatus(self, code, route='/', **kargs): 131 | self.assertEqual(code, self.urlopen(route, **kargs)['code']) 132 | 133 | def assertBody(self, body, route='/', **kargs): 134 | self.assertEqual(tob(body), self.urlopen(route, **kargs)['body']) 135 | 136 | def assertInBody(self, body, route='/', **kargs): 137 | result = self.urlopen(route, **kargs)['body'] 138 | if tob(body) not in result: 139 | self.fail('The search pattern "%s" is not included in body:\n%s' % (body, result)) 140 | 141 | def assertHeader(self, name, value, route='/', **kargs): 142 | self.assertEqual(value, self.urlopen(route, **kargs)['header'].get(name)) 143 | 144 | def assertHeaderAny(self, name, route='/', **kargs): 145 | self.assertTrue(self.urlopen(route, **kargs)['header'].get(name, None)) 146 | 147 | def assertInError(self, search, route='/', **kargs): 148 | bottle.request.environ['wsgi.errors'].errors.seek(0) 149 | err = bottle.request.environ['wsgi.errors'].errors.read() 150 | if search not in err: 151 | self.fail('The search pattern "%s" is not included in wsgi.error: %s' % (search, err)) 152 | 153 | def multipart_environ(fields, files): 154 | boundary = 'lowerUPPER-1234' 155 | env = {'REQUEST_METHOD':'POST', 156 | 'CONTENT_TYPE': 'multipart/form-data; boundary='+boundary} 157 | wsgiref.util.setup_testing_defaults(env) 158 | boundary = '--' + boundary 159 | body = '' 160 | for name, value in fields: 161 | body += boundary + '\r\n' 162 | body += 'Content-Disposition: form-data; name="%s"\r\n\r\n' % name 163 | body += value + '\r\n' 164 | for name, filename, content in files: 165 | mimetype = str(mimetypes.guess_type(filename)[0]) or 'application/octet-stream' 166 | body += boundary + '\r\n' 167 | body += 'Content-Disposition: file; name="%s"; filename="%s"\r\n' % \ 168 | (name, filename) 169 | body += 'Content-Type: %s\r\n\r\n' % mimetype 170 | body += content + '\r\n' 171 | body += boundary + '--\r\n' 172 | if isinstance(body, str): 173 | body = body.encode('utf8') 174 | env['CONTENT_LENGTH'] = str(len(body)) 175 | env['wsgi.input'].write(body) 176 | env['wsgi.input'].seek(0) 177 | return env 178 | -------------------------------------------------------------------------------- /test/views/jinja2_base.tpl: -------------------------------------------------------------------------------- 1 | begin {% block content %}{% endblock %} end -------------------------------------------------------------------------------- /test/views/jinja2_inherit.tpl: -------------------------------------------------------------------------------- 1 | {% extends "jinja2_base" %} 2 | {% block content %}abc{% endblock %} -------------------------------------------------------------------------------- /test/views/jinja2_simple.tpl: -------------------------------------------------------------------------------- 1 | start {{var}} end -------------------------------------------------------------------------------- /test/views/mako_base.tpl: -------------------------------------------------------------------------------- 1 | o${self.body()}o 2 | -------------------------------------------------------------------------------- /test/views/mako_inherit.tpl: -------------------------------------------------------------------------------- 1 | <%inherit file="mako_base.tpl"/> 2 | c${var}c 3 | -------------------------------------------------------------------------------- /test/views/mako_simple.tpl: -------------------------------------------------------------------------------- 1 | start ${var} end 2 | -------------------------------------------------------------------------------- /test/views/stpl_include.tpl: -------------------------------------------------------------------------------- 1 | before 2 | %include('stpl_simple', var=var) 3 | after 4 | -------------------------------------------------------------------------------- /test/views/stpl_no_vars.tpl: -------------------------------------------------------------------------------- 1 | hihi -------------------------------------------------------------------------------- /test/views/stpl_simple.tpl: -------------------------------------------------------------------------------- 1 | start {{var}} end 2 | -------------------------------------------------------------------------------- /test/views/stpl_t2base.tpl: -------------------------------------------------------------------------------- 1 | %test('base') 2 | {{base}}\\ 3 | %_ = include('stpl_t2inc', test=test) 4 | %_['test2']('base') 5 | -------------------------------------------------------------------------------- /test/views/stpl_t2inc.tpl: -------------------------------------------------------------------------------- 1 | %test('include') 2 | %def test2(var): 3 | -{{var}}- 4 | %end 5 | -------------------------------------------------------------------------------- /test/views/stpl_t2main.tpl: -------------------------------------------------------------------------------- 1 | %def test(var): 2 | +{{var}}+ 3 | %end 4 | %rebase('stpl_t2base', test=test) 5 | %test('main') 6 | !{{content}}! 7 | %_ = include('stpl_t2inc', test=test) 8 | %_['test2']('main') 9 | -------------------------------------------------------------------------------- /test/views/stpl_unicode.tpl: -------------------------------------------------------------------------------- 1 | start {{"ñç"}} {{var}} end 2 | --------------------------------------------------------------------------------