{ "info": { "author": "Zackary Troop", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "## Django Rest Framework Discovery\n\n[![Build Status](https://travis-ci.org/ztroop/django-rest-framework-discovery.svg?branch=master)](https://travis-ci.org/ztroop/django-rest-framework-discovery)\n[![PyPI version](https://badge.fury.io/py/djangorestframework-discovery.svg)](https://badge.fury.io/py/djangorestframework-discovery)\n\nDiscovery allows you to create an API from an existing database with little to no effort. This project is based on Shabda Raaj's [Bookrest][1]. You can then leverage the capabilties of the Django Rest Framework to apply [filtering][2], [pagination][3] and [documentation][4] generation. A project demonstration is [available][5].\n\n[1]: https://github.com/agiliq/bookrest\n[2]: https://django-rest-framework.org/api-guide/filtering/\n[3]: https://django-rest-framework.org/api-guide/pagination/\n[4]: https://django-rest-framework.org/topics/documenting-your-api/\n[5]: https://github.com/ztroop/django-discovery-example\n\n### Requirements\n\nFor successful generation, you need to have a primary key present in the table. Otherwise, it will be silently ignored.\n\n### Installation\n\n```bash\npip install djangorestframework-discovery\n```\n\nIn your `settings.py`:\n\n```python\nINSTALLED_APPS = [\n # ...\n \"rest_framework\",\n \"rest_framework_discovery\",\n]\n```\n\nAdd a variable to your `settings.py` named `DISCOVERY_ALIAS_NAME`. You can use any value, but `discovery` is recommended. You will use that to define the database you would like to use for viewset generation.\n\n```python\nDISCOVERY_ALIAS_NAME = 'discovery'\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),\n },\n 'discovery': {\n 'NAME': 'YOUR_DB_NAME',\n 'ENGINE': 'django.db.backends.postgresql',\n 'USER': 'YOUR_DB_USER',\n 'PASSWORD': 'YOUR_DB_PASSWORD',\n 'HOST': 'YOUR_DB_HOST',\n 'PORT': 'YOUR_DB_PORT',\n },\n}\n```\n\nAdd the generated patterns to the rest of your application by modifying the `urls.py`.\n\n```python\nurlpatterns = [\n # ...\n url(r'^api/discovery/', include('rest_framework_discovery.urls')),\n]\n```\n\n### Testing\n\nYou can run through the testing suite by running `runtests.py` or `tox`.\n\n### Configuration\n\nYou can configure the following in `settings.py`:\n- `DISCOVERY_ALIAS_NAME`: (required) The database alias name to use with discovery.\n- `DISCOVERY_READ_ONLY`: (optional) `True` or `False`, whether or not the viewsets should be read-only.\n- `DISCOVERY_INCLUDE`: (optional) A list of tables that you would like to *only* include.\n- `DISCOVERY_EXCLUDE`: (optional) A list of tables that you would like to ignore.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ztroop/djangorestframework-discovery", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "djangorestframework-discovery", "package_url": "https://pypi.org/project/djangorestframework-discovery/", "platform": "", "project_url": "https://pypi.org/project/djangorestframework-discovery/", "project_urls": { "Homepage": "https://github.com/ztroop/djangorestframework-discovery" }, "release_url": "https://pypi.org/project/djangorestframework-discovery/0.1.7/", "requires_dist": [ "django (>=2.0.0)", "djangorestframework (>=3.8.0)" ], "requires_python": "", "summary": "Create a queryable data source from an existing database.", "version": "0.1.7" }, "last_serial": 3922416, "releases": { "0.1.6": [ { "comment_text": "", "digests": { "md5": "5a2a584685267b290653d7a33be03c54", "sha256": "5e1b191ca6a1cd530fe4faaa344dc27c4c43511db0540e007ba6fac24865c91d" }, "downloads": -1, "filename": "djangorestframework_discovery-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "5a2a584685267b290653d7a33be03c54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5827, "upload_time": "2018-04-20T16:55:56", "url": "https://files.pythonhosted.org/packages/ff/e5/901db71566970950d8f915f5247521216f1d7f644e936bd3e0033bf87811/djangorestframework_discovery-0.1.6-py3-none-any.whl" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "316e0a3234592b68b9e119075bb8ecb0", "sha256": "e71ac43a95c3e246ef2152a0bd299b368320a3e9ce87242097461bdc18b08e88" }, "downloads": -1, "filename": "djangorestframework_discovery-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "316e0a3234592b68b9e119075bb8ecb0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9155, "upload_time": "2018-06-01T21:54:19", "url": "https://files.pythonhosted.org/packages/3b/7e/a00788debcfe22328df4b3bef8052036b399630632b38be8b39cfbac34f1/djangorestframework_discovery-0.1.7-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "316e0a3234592b68b9e119075bb8ecb0", "sha256": "e71ac43a95c3e246ef2152a0bd299b368320a3e9ce87242097461bdc18b08e88" }, "downloads": -1, "filename": "djangorestframework_discovery-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "316e0a3234592b68b9e119075bb8ecb0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9155, "upload_time": "2018-06-01T21:54:19", "url": "https://files.pythonhosted.org/packages/3b/7e/a00788debcfe22328df4b3bef8052036b399630632b38be8b39cfbac34f1/djangorestframework_discovery-0.1.7-py3-none-any.whl" } ] }