{ "info": { "author": "Vlad George Ardelean", "author_email": "asdf@yopmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Utilities" ], "description": "===============================\nlocalsrv\n===============================\n\n| |docs| |travis| |appveyor| |coveralls| |landscape| |scrutinizer|\n| |version| |downloads| |wheel| |supported-versions| |supported-implementations|\n\n.. |docs| image:: https://readthedocs.org/projects/localsrv/badge/?style=flat\n :target: https://readthedocs.org/projects/localsrv\n :alt: Documentation Status\n\n.. |travis| image:: http://img.shields.io/travis/vladiibine/localsrv/master.png?style=flat\n :alt: Travis-CI Build Status\n :target: https://travis-ci.org/vladiibine/localsrv\n\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/vladiibine/localsrv?branch=master\n :alt: AppVeyor Build Status\n :target: https://ci.appveyor.com/project/vladiibine/localsrv\n\n.. |coveralls| image:: http://img.shields.io/coveralls/vladiibine/localsrv/master.png?style=flat\n :alt: Coverage Status\n :target: https://coveralls.io/r/vladiibine/localsrv\n\n.. |landscape| image:: https://landscape.io/github/vladiibine/localsrv/master/landscape.svg?style=flat\n :target: https://landscape.io/github/vladiibine/localsrv/master\n :alt: Code Quality Status\n\n.. |version| image:: http://img.shields.io/pypi/v/django-localsrv.png?style=flat\n :alt: PyPI Package latest release\n :target: https://pypi.python.org/pypi/django-localsrv\n\n.. |downloads| image:: http://img.shields.io/pypi/dm/django-localsrv.png?style=flat\n :alt: PyPI Package monthly downloads\n :target: https://pypi.python.org/pypi/django-localsrv\n\n.. |wheel| image:: https://pypip.in/wheel/django-localsrv/badge.png?style=flat\n :alt: PyPI Wheel\n :target: https://pypi.python.org/pypi/django-localsrv\n\n.. |supported-versions| image:: https://pypip.in/py_versions/django-localsrv/badge.png?style=flat\n :alt: Supported versions\n :target: https://pypi.python.org/pypi/django-localsrv\n\n.. |supported-implementations| image:: https://pypip.in/implementation/django-localsrv/badge.png?style=flat\n :alt: Supported imlementations\n :target: https://pypi.python.org/pypi/django-localsrv\n\n.. |scrutinizer| image:: https://img.shields.io/scrutinizer/g/vladiibine/localsrv/master.png?style=flat\n :alt: Scrutinizer Status\n :target: https://scrutinizer-ci.com/g/vladiibine/localsrv/\n\n**django-localsrv** is a django app that allows you to serve content (files, strings, etc.) at configurable paths, with configurable response HTTP headers.\n\nIt's intended as a more useful test server than Python's SimpleHTTPServer, mainly because of the configuration options.\n\n* Free software: MIT license\n\n\nInstallation\n============\n\nFor the love of mankind, please use virtualenv.\n\n::\n\n pip install django-localsrv\n\nThen in your settings file of your django project (usually `settings.py`)\n\n::\n\n INSTALLED_APPS = (\n ...\n 'localsrv',\n ...\n )\n\nIn your url configuration file (usually `urls.py`) add the root path to where you want to serve the content from\n\n::\n\n from localsrv import urls as localsrv_urls\n\n urlpatterns = (\n ...\n # Put this at the end of the list, since it will capture any url beginning with /localsrv\n # You can also use a pattern like r'', and that will match any pattern that wasn't\n # matched by any other pattern. That can get confusing, so it's best to use a namespace\n # like the one in this example\n url(r'^localsrv/', include(localsrv_urls))\n )\n \n\nAdditional steps for the eager ones\n===================================\nThe app includes a simple settings file, that you can use to start using the app instantly. It's the module **localsrv.test_settings**\n\nLet's use it!\nThis app contains models, so we'll need to run migrations for our app\n\n::\n\n django-admin.py migrate --settings=localsrv.settings\n \nThis will create a sqlite database file in directory where the package was installed. If you don't have a problem with that, \nyou will be able to start the server now, and enjoy the app. If you want to integrate the app into some project of yours,\nthough I advise against it, you can do so. I won't teach you how, but it's a simple matter of including 'localsrv' in the \nINSTALLED_APPS list of the settings file of your project.\n\nCreate a superuser, to access the admin web console:\n\n::\n\n django-admin.py createsuperuser --settings=localsrv.test_settings\n \nAnd then run the server:\n\n::\n\n django-admin.py runserver 0:8989 --settings=localsrv.test_settings\n\nNow you're ready to start configuring what content you're going to serve at the url /localsrv/\n\nSpecifying the content to serve\n===============================\nSince this is a django app, if you did all the above steps (setting the app as a member of the INSTALLED_APPS list is the important thing),\nyou'll, you'll have access to the `Localsrv` entry on your django admin page.\n\nWorking on a simpler, command line interface to the app, with perhaps a simple configuration dictionary.\n\nThings to know: there are at the moment 3 types of content that you can serve:\n\n + Strings\n + Content found at another URL\n + Files on the local file system (these are a little buggy at the moment, but still usable)\n\nTo serve any of these, you need to create their corresponding resources. These are called `String Source`, `URL Source` and `File Source`.\nYou'll find all of these on the admin page, in the entry for the app `Localsrv`. Try to create a `String Source`, and specify the content\nto be this JSON for example (you can use any string you wish, of course)\n\n.. code-block:: json\n\n {\n \"asdf\": \"zxcv\",\n \"qwer\": [1, 2, 3]\n }\n\nAlso, along with the content, you can specify what additional HTTP Headers should be provided. Specifying these is easy. You must create\na `Servable Http Header`, where you'll be prompted for a name (e.g. **content-type**) and a value (e.g. **application/json**)\n\n\nNow finally, you'll need to specify where to serve your content. This is done by creating a `Servable Content` object, on the same admin page.\nFor it, you'll use a source that you defined previously, and (optionally) a header that you also defined. You'll also have to specify a path\nto serve this content from.\n\nSince in this example we introduced the url pattern `r'^localsrv/`, let's stick to this pattern and specify a path of `/localsrv/my_json`.\nThe path you choose here can be anything (that ca be considered a URL). We namespaced the url with `/localsrv/` just to avoid any collisions\nwith previous url pattern. The way `localsrv` handles requests is that it will respond to any unmatched URL, that starts with the namespace\nprovided, so in our example **/localsrv/asdaf/4/foo/bar** will match the `localsrv` urls, and will return either a 404, or some content\nthat you defined for this path.\n\nFinally, when accessing the URLs you configred (in our example `/localsrv/my_json`) you'll see your json string delivered with the proper\ncontent type header.\n\n\nDevelopment\n===========\n\nTo run the all tests run::\n\n tox\n\n\nChangelog\n=========\n\n0.1.2 (2015-04-26)\n------------------------------\n* Documentation chages only\n\n0.1.1 (2015-04-18)\n-----------------------------------------\n* Added test_settings module for running the app out of the box.\n\n0.1.0 (2015-04-18)\n-----------------------------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vladiibine/localsrv", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-localsrv", "package_url": "https://pypi.org/project/django-localsrv/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-localsrv/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/vladiibine/localsrv" }, "release_url": "https://pypi.org/project/django-localsrv/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Django app for serving static content from different sources (files, strings, urls, etc.) at custom paths, using custom HTTP headers. Intended as a more flexible option than Python's SimpleHTTPServer", "version": "0.1.2" }, "last_serial": 1521889, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "63ba8b866ab3ad4ef86e2943ea22342a", "sha256": "e7e6b4d868beb0c2ab0289d8b4a39903b0e799ebec5203d013b8b0c17216da63" }, "downloads": -1, "filename": "django-localsrv-0.1.0.tar.gz", "has_sig": false, "md5_digest": "63ba8b866ab3ad4ef86e2943ea22342a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30820, "upload_time": "2015-04-18T09:09:06", "url": "https://files.pythonhosted.org/packages/40/cb/5fec16bc53d8bd570baea24651232128f860f0ec3c8ae33f81bf2365d977/django-localsrv-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ae9afcb58d44541897c83c6d656dae49", "sha256": "4297516a579da220ed549d10cb115b77aeb12614997e1b236b76f8563b167a74" }, "downloads": -1, "filename": "django-localsrv-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ae9afcb58d44541897c83c6d656dae49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30963, "upload_time": "2015-04-18T09:18:41", "url": "https://files.pythonhosted.org/packages/a8/27/ead680c592636cdeb9a1aec21b201b45cba048d8706e308ab58162030cce/django-localsrv-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "11a1a03730ab751838b86591b2ed0b74", "sha256": "981269f64ec09e4dc2f8e946fad4bbda07a8c51e3e813b625d38149b5c6b0dad" }, "downloads": -1, "filename": "django-localsrv-0.1.2.tar.gz", "has_sig": false, "md5_digest": "11a1a03730ab751838b86591b2ed0b74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25399, "upload_time": "2015-04-26T18:19:58", "url": "https://files.pythonhosted.org/packages/4c/e3/d2ef85aa5433fc35dd51af20e0e6af9b2dc91d816ea61f937d3ff4146865/django-localsrv-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "11a1a03730ab751838b86591b2ed0b74", "sha256": "981269f64ec09e4dc2f8e946fad4bbda07a8c51e3e813b625d38149b5c6b0dad" }, "downloads": -1, "filename": "django-localsrv-0.1.2.tar.gz", "has_sig": false, "md5_digest": "11a1a03730ab751838b86591b2ed0b74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25399, "upload_time": "2015-04-26T18:19:58", "url": "https://files.pythonhosted.org/packages/4c/e3/d2ef85aa5433fc35dd51af20e0e6af9b2dc91d816ea61f937d3ff4146865/django-localsrv-0.1.2.tar.gz" } ] }