# -*- coding: utf-8 -*-
from distutils.core import setup

packages = \
['wagtail_graphql', 'wagtail_graphql.types']

package_data = \
{'': ['*']}

install_requires = \
['graphene_django>=2.2,<3.0',
 'graphene_django_optimizer>=0.3.5,<0.4.0',
 'python-dateutil>=2.7,<3.0',
 'wagtail>=2.3,<3.0']

extras_require = \
{'menus': ['wagtailmenus>=2.12,<3.0']}

setup_kwargs = {
    'name': 'wagtail-graphql',
    'version': '0.2.0',
    'description': 'An app to automatically add graphql support to a Wagtail website',
    'long_description': "# wagtail-graphql\n> An app to automatically add GraphQL support to a Wagtail website\n\nThis [Wagtail](https://wagtail.io/) app adds [GraphQL](https://graphql.org/) types to other Wagtail apps. The objective is for this library to interact with an existing website in a generic way and with minimal effort.\nIn particular, it makes minimal assumptions about the structure of the website\nto allow for a generic API.\n\n## Installing / Getting started\n\nTo install as a general app:\n\n```shell\npip install wagtail-graphql\n```\n\nAdd it together with [graphene_django](https://github.com/graphql-python/graphene-django) to the Django INSTALLED_APPS:\n\n```python\nINSTALLED_APPS = [\n    ...\n    'wagtail_graphql',\n    'graphene_django',\n    ...\n]\n\n```\n\n### Initial Configuration\n\nAdd the required [graphene](https://github.com/graphql-python/graphene) schema `GRAPHENE` and a `GRAPHQL_API` dictionary.\nInclude all the Wagtail apps the library should generate bindings to in the `APPS` list and optionally specify the prefix for each app in `PREFIX`. To remove a leading part of all the urls for a specific site, specify the `URL_PREFIX` parameter for each needed host.\n\n```python\nGRAPHENE = {\n    'SCHEMA': 'wagtail_graphql.schema.schema',\n}\n\nGRAPHQL_API = {\n    'APPS': [\n        'home'\n    ],\n    'PREFIX': {\n        'home': ''        # optional, prefix for all the app classes generated by the wrapper\n    },\n    'URL_PREFIX': {\n        'localhost': '/home'   # optional, read from the site information if not specified \n    }\n}\n```\nThe example above generates bindings for the `home` app, .  Every url in this example\nwill be stripped of the initial `/home` substring.\n\nFinally, set up the GraphQL views in the project `urls.py`.\nFor example, to add two endpoints for GraphQL and the [GraphiQL](https://github.com/graphql/graphiql) IDE: \n\n```python\nfrom django.views.decorators.csrf import csrf_exempt\nfrom graphene_django.views import GraphQLView\n\nurlpatterns = [\n    ...\n    url(r'^api/graphql', csrf_exempt(GraphQLView.as_view())),\n    url(r'^api/graphiql', csrf_exempt(GraphQLView.as_view(graphiql=True, pretty=True)),\n    ...\n]\n```\nNote that the urls above need to appear before the `wagtail_urls` catchall entry.\n\n#### Images\n\nTo be able to generate urls for images the following also needs to be included in the project's `urls.py`:\n\n```python\nfrom wagtail.images.views.serve import ServeView\n\nurlpatterns = [\n    ...\n    url(r'^images/([^/]*)/(\\d*)/([^/]*)/[^/]*$', ServeView.as_view(), name='wagtailimages_serve'),\n    ...\n]\n```\n\n\n### Multi-site configuration\nThis library works transparently with a multi-site Wagtail install without any extra configuration required.  To strip a custom leading prefix for each site, specify each host in the `URL_PREFIX`.  For exaple, for two hosts `host1.example.com` and `host2.example.com`:\n\n```\nGRAPHQL_API = {\n    ...\n    'URL_PREFIX': {\n        'host1.example.com': '/prefix1',\n        'host2.example.com': '/prefix2'\n    }\n    ...\n}\n```\nNote that the prefix for a site is taken from the root page url if a host is not included in the `URL_PREFIX` dictionary. \n\n\n## Developing\n\nTo develop this library, download the source code and install a local version in your Wagtail website.\n\n\n## Features\n\nThis project is intended to require minimal configuration and interaction. It currently supports \n\n* [Page models](https://docs.wagtail.io/en/master/topics/pages.html)\n* [Snippets](https://docs.wagtail.io/en/master/topics/snippets.html)\n* Images\n* Documents\n* [StreamFields](https://docs.wagtail.io/en/master/topics/streamfield.html) with [Basic Blocks](https://docs.wagtail.io/en/naster/topics/streamfield.html#basic-block-types) and [StructBlocks](https://docs.wagtail.io/en/master/topics/streamfield.html#structblock) \n \n\n## Contributing\n\nIf you'd like to contribute, please fork the repository and use a feature\nbranch. Pull requests are welcome.\n\n## Links\n\n- Repository: https://github.com/tr11/wagtail-graphql\n- Issue tracker: https://github.com/tr11/wagtail-graphql/issues\n\n## Licensing\n\nThe code in this project is licensed under MIT license.\n\n",
    'author': 'Tiago Requeijo',
    'author_email': 'tiago.requeijo.dev@gmail.com',
    'url': 'https://github.com/tr11/wagtail-graphql',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'extras_require': extras_require,
    'python_requires': '>=3.6,<3.8',
}


setup(**setup_kwargs)
