{ "info": { "author": "Alfredo Deza", "author_email": "alfredo [at] deza.pe", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3" ], "description": "Pecan Mount\n===========\nA utility to mount Pecan applications at different points to act as one.\n\n\nAdding applications\n-------------------\nPecan applications are usually mounted at `/` and they do not have an easy way\nto be able to compound different apps working in unison. If you are using\n`pecan_mount` you need to use the tree as the actual WSGI application as it\nacts as WSGI middleware to properly return the apps at given mount points.\n\nYou only need two things for mounting an app, an application configuration and\nthe mount point. The configuration can be either a path to a file or\na dictionary (Pecan takes care of this loading for us). So to mount a single\napplication at `/application` with a configuration file living in\n`/path/to/config.py` it would look like this::\n\n import pecan_mount\n pecan_mount.tree.mount('/application', '/path/to/config.py')\n\nThe nice things about Pecan configuration is that it will take care of finding\nthe right modules and everything necessary for your application. At most, the\nimportant decision here is the mount point.\n\n\nRunning multiple applications\n----------------------------\nIdeally, you would want to mount all the applications you need in one place,\nand this place should be where the WSGI application is constructed so that it\ncan be consumed by a WSGI server (for example `gunicorn` or Apache with\n`mod_wsgi`). This is how having 4 different applications would look in a file\ncalled `wsgi.py`::\n\n import pecan_mount\n\n pecan_mount.tree.mount('/', '/path/to/main_config.py')\n pecan_mount.tree.mount('/admin', '/path/to/admin_config.py')\n pecan_mount.tree.mount('/registration', '/path/to/registration_config.py')\n pecan_mount.tree.mount('/_metrics', '/path/to/metrics_config.py')\n\n application = pecan_mount.tree \n\n\nNaming the mounts\n-----------------\nOptionally, when mounting, you can pass in a ``mount_name`` that will be used\nadded to the WSGI app as an attribute. This is useful when debugging or when\nyou need to have a better representation of what application is mounted at some\npoint.\n\nIf no ``mount_name`` is passed in to the ``mount`` callable, it will default to\ninferring the name from the ``script_name``, which in turn will use ``root``\nfor empty strings or None and for dotted conversions for other paths.\n\nFor example, a ``script_name`` that looks like: ``/foo/bar`` will be translated\nto a ``mount_name`` of ``foo.bar``.\n\n\nPreventing overriding of mounts\n-------------------------------\nThe ``tree`` object will prevent you from mounting applications in locations\nwhere there is already an app mounted. This is convenient when there are\nmultiple applications mounted and unknowingly a new app is using a location\nalready taken. An ``AttributeError`` will be raised to indicate what\napplication at what mount point is being used and prevent further execution.\n\n\nMounting other WSGI apps\n------------------------\nOther WSGI applications can also be mounted easily. The WSGI app will need to\nbe properly configured before mounting and will use a different callable::\n\n import pecan_mount\n import my_app\n \n my_wsgi_app = my_app()\n\n pecan_mount.tree.graft(my_app, '/mount_point')", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "mount,pecan,wsgi", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pecan-mount", "package_url": "https://pypi.org/project/pecan-mount/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pecan-mount/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/pecan-mount/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Mount Pecan apps", "version": "0.0.2" }, "last_serial": 822603, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "07d5c23fbbfcbd5905129cdc67b23715", "sha256": "0560f0746e21e67185ecbb2c6fe5f8eb71f2493523dcef66d9ce5070de448960" }, "downloads": -1, "filename": "pecan-mount-0.0.1.tar.gz", "has_sig": false, "md5_digest": "07d5c23fbbfcbd5905129cdc67b23715", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6501, "upload_time": "2013-07-20T01:01:36", "url": "https://files.pythonhosted.org/packages/54/85/b61541d8d961eb502449dc2987151775b29f6e3737dc963977a93eba05a1/pecan-mount-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "033c91c1b1386e9fdea4a3ba6b88ab76", "sha256": "28de6a41ae7218c6efb7ba04c614fa44815a4b30f0f6c6102be074996c7e803e" }, "downloads": -1, "filename": "pecan-mount-0.0.2.tar.gz", "has_sig": false, "md5_digest": "033c91c1b1386e9fdea4a3ba6b88ab76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6462, "upload_time": "2013-07-22T23:51:23", "url": "https://files.pythonhosted.org/packages/c4/32/eed73dc172697b5c876fc8d184e241c6d3ef867395f9c17a38ba7376cb29/pecan-mount-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "033c91c1b1386e9fdea4a3ba6b88ab76", "sha256": "28de6a41ae7218c6efb7ba04c614fa44815a4b30f0f6c6102be074996c7e803e" }, "downloads": -1, "filename": "pecan-mount-0.0.2.tar.gz", "has_sig": false, "md5_digest": "033c91c1b1386e9fdea4a3ba6b88ab76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6462, "upload_time": "2013-07-22T23:51:23", "url": "https://files.pythonhosted.org/packages/c4/32/eed73dc172697b5c876fc8d184e241c6d3ef867395f9c17a38ba7376cb29/pecan-mount-0.0.2.tar.gz" } ] }