{ "info": { "author": "Benoit Chesneau", "author_email": "benoitc@e-engura.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": "dj-webmachine\n-------------\n\ndj-webmachine is an application layer that adds HTTP semantic awareness on \ntop of Django and provides a simple and clean way to connect that to\nyour applications' behavior. dj-webmachine also offers you the\npossibility to build simple API based on your model and the tools to\ncreate automatically docs and clients from it (work in progress).\n\n\n\nInstall\n+++++++\n\nMake sure that you have a working Python_ 2.x >=2.5 installed and Django_ >= 1.1.\n\n\nWith pip\n~~~~~~~~\n\n::\n \n $ pip install dj-webmachine\n\nFrom source\n~~~~~~~~~~~\n\nGet the dj-webmachine code::\n\n $ git clone https://github.com/benoitc/dj-webmachine.git\n $ cd dj-webmachine\n\nOr using a tarbal::\n\n $ wget http://github.com/benoitc/dj-webmachine/tarball/master -o dj-webmachine.tar.gz\n $ tar xvzf dj-webmachine.tar.gz\n $ cd dj-webmachine-$HASH/\n\nand install::\n\n $ sudo python setup.py install\n\n\ndj-webmachine in 5 minutes\n++++++++++++++++++++++++++\n\nWe will quickly create an Hello world accepting HTML and JSON.\n\n::\n\n $ django-admin startproject helloworld\n $ cd helloworld\n $ python manage.py startapp hello\n\nIn the hello folder create a file named ``resources.py``::\n\n import json\n from webmachine import Resource\n \n class Hello(Resource):\n\n def content_types_provided(self, req, resp):\n \"\"\"\" define the content type we render accoridng the Accept\n header.\n \"\"\"\n return ( \n (\"\", self.to_html),\n (\"application/json\", self.to_json)\n )\n\n def to_html(self, req, resp):\n return \"Hello world!\\n\"\n \n def to_json(self, req, resp):\n return \"%s\\n\" % json.dumps({\"message\": \"hello world!\", \"ok\": True})\n \nAdd **dj-webmachine** and your hello app to ``INSTALLED_APPS`` in your\nsettings::\n\n INSTALLED_APPS = (\n ...\n 'webmachine',\n 'helloworld.hello'\n )\n\nPut your the Hello resource in your ``urls.py``::\n\n from django.conf.urls.defaults import *\n\n from helloworld.hello.resource import Hello\n\n urlpatterns = patterns('',\n (r'^$', Hello()),\n )\n\nLaunch your application::\n\n $ python manage.py runserver\n\nTake a look! Point a web browser at http://localhost:8000/\n\nOr with curl::\n\n $ curl http://127.0.0.1:8000\n Hello world!\n\n $ curl http://127.0.0.1:8000 -H \"Accept: application/json\"\n {\"message\": \"hello world!\", \"ok\": true} \n\n\n \nThe first line ask the hello page as html while the second using the\nsame url ask for JSON. \n\nTo learn how to do more interresting things, checkout `some examples `_ or read `more documentations `_ .\n\n.. _Python: http://python.org\n.. _Django: http://djangoproject.org", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/benoitc/dj-webmachine", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "dj-webmachine", "package_url": "https://pypi.org/project/dj-webmachine/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dj-webmachine/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/benoitc/dj-webmachine" }, "release_url": "https://pypi.org/project/dj-webmachine/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Minimal Django Resource framework.", "version": "0.2.1" }, "last_serial": 789011, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "39d5700e0dedadeb04a9757231c7eeea", "sha256": "bb2a05b76d686ae6d1172aabd65be695949359841bd365e53125c3a0c8c3b51d" }, "downloads": -1, "filename": "dj-webmachine-0.1.0.tar.gz", "has_sig": false, "md5_digest": "39d5700e0dedadeb04a9757231c7eeea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30353, "upload_time": "2010-11-16T11:16:27", "url": "https://files.pythonhosted.org/packages/5b/42/8f2194d0d685c515798c760c1a2c49132fd22b1e605592b42c933d19dd08/dj-webmachine-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a56b641249de15530d50a443274a813d", "sha256": "2833003416efab2f3da7051fa8e4704e325b324c646aa095ed88a2157127a138" }, "downloads": -1, "filename": "dj-webmachine-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a56b641249de15530d50a443274a813d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32575, "upload_time": "2010-11-17T02:28:06", "url": "https://files.pythonhosted.org/packages/62/09/1ff1eb92ec86e07ef4cf5e7af5cf11a55ebb6dfd6a603ad9d9caf797c310/dj-webmachine-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "122b8bfc5e0a707f33c7a6a749129751", "sha256": "8c570806eabc21b3938f72af53e99c70270c0cad93c9846f5138a4204baad260" }, "downloads": -1, "filename": "dj-webmachine-0.2.1.tar.gz", "has_sig": false, "md5_digest": "122b8bfc5e0a707f33c7a6a749129751", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32570, "upload_time": "2010-11-17T13:08:08", "url": "https://files.pythonhosted.org/packages/52/66/33207672b267ad48dd2d5b35c7b5179e31846b8bddfb9a31a434b0c48ffd/dj-webmachine-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "122b8bfc5e0a707f33c7a6a749129751", "sha256": "8c570806eabc21b3938f72af53e99c70270c0cad93c9846f5138a4204baad260" }, "downloads": -1, "filename": "dj-webmachine-0.2.1.tar.gz", "has_sig": false, "md5_digest": "122b8bfc5e0a707f33c7a6a749129751", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32570, "upload_time": "2010-11-17T13:08:08", "url": "https://files.pythonhosted.org/packages/52/66/33207672b267ad48dd2d5b35c7b5179e31846b8bddfb9a31a434b0c48ffd/dj-webmachine-0.2.1.tar.gz" } ] }