# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['address', 'address.migrations', 'address.tests']

package_data = \
{'': ['*'], 'address': ['static/address/js/*', 'static/js/*']}

install_requires = \
['Django>=2.1']

setup_kwargs = {
    'name': 'django-address',
    'version': '0.2.6',
    'description': 'A django application for describing addresses.',
    'long_description': "# Django Address \n\n**Django models for storing and retrieving postal addresses.** \n\n---\n\n# Overview\nDjango Address is a set of models and methods for working with postal addresses.\n\n# Requirements\n * Python (3.5, 3.6, 3.7, 3.8)\n * Django (2.2, 3.0)\n\nWe **recommend** and only officially support the latest patch release of each Python and Django series. \n\n# Installation\nFor more detailed instructions, [view the Readme for the example site](https://github.com/furious-luke/django-address/blob/master/example_site/README.md) included with this package.\n\n```bash\npip install django-address\n```\n\nThen, add `address` to your `INSTALLED_APPS` list in `settings.py`:\n\n```\nINSTALLED_APPS = [\n    # ... \n    'address',\n    # ... \n]\n```\n\nYou can either store your Google API key in an environment variable as `GOOGLE_API_KEY` or you can\n specify the key in `settings.py`. If you have an environment variable set it will override what you put in settings.py.\n For more information, including enabling the Google Places API, refer to [the example site](https://github.com/furious-luke/django-address/blob/master/example_site/README.md).\n \n```\nGOOGLE_API_KEY = 'AIzaSyD--your-google-maps-key-SjQBE'\n```\n\n# The Model\n\nThe rationale behind the model structure is centered on trying to make\nit easy to enter addresses that may be poorly defined. The model field included\nuses Google Maps API v3 (via the nicely done [geocomplete jquery plugin](http://ubilabs.github.io/geocomplete/)) to\ndetermine a proper address where possible. However if this isn't possible the\nraw address is used and the user is responsible for breaking the address down\ninto components.\n\nIt's currently assumed any address is represent-able using four components:\ncountry, state, locality and street address. In addition, country code, state\ncode and postal code may be stored, if they exist.\n\nThere are four Django models used:\n\n```\n  Country\n    name\n    code\n\n  State\n    name\n    code\n    country -> Country\n\n  Locality\n    name\n    postal_code\n    state -> State\n\n  Address\n    raw\n    street_number\n    route\n    locality -> Locality\n```\n\n# Address Field\n\nTo simplify storage and access of addresses, a subclass of `ForeignKey` named\n`AddressField` has been created. It provides an easy method for setting new\naddresses.\n\n## ON_DELETE behavior of Address Field\n\nBy default, if you delete an Address that is related to another object, \nDjango's [cascade behavior](https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete) \nis used. This means the related object will also be deleted. You may also choose\nto set `null=True` when defining an address field to have the address set\nto Null instead of deleting the related object. For more information and an example,\nsee the readme for the `django-address` example_site.\n \n## Creation\n\nIt can be created using the same optional arguments as a ForeignKey field.\nFor example:\n\n```python\n  from address.models import AddressField\n\n  class MyModel(models.Model):\n    address1 = AddressField()\n    address2 = AddressField(related_name='+', blank=True, null=True)\n```\n\n## Setting Values\n\nValues can be set either by assigning an Address object:\n\n```python\n  addr = Address(...)\n  addr.save()\n  obj.address = addr\n```\n\nOr by supplying a dictionary of address components:\n\n```python\n  obj.address = {'street_number': '1', 'route': 'Somewhere Ave', ...}\n```\n\nThe structure of the address components is as follows:\n\n```python\n  {\n    'raw': '1 Somewhere Ave, Northcote, VIC 3070, AU',\n    'street_number': '1',\n    'route': 'Somewhere Ave',\n    'locality': 'Northcote',\n    'postal_code': '3070',\n    'state': 'Victoria',\n    'state_code': 'VIC',\n    'country': 'Australia',\n    'country_code': 'AU'\n  }\n```\n\nAll except the `raw` field can be omitted. In addition, a raw address may\nbe set directly:\n\n```python\nobj.address = 'Out the back of 1 Somewhere Ave, Northcote, Australia'\n```\n\n## Getting Values\n\nWhen accessed, the address field simply returns an Address object. This way\nall components may be accessed naturally through the object. For example::\n\n```python\n  route = obj.address.route\n  state_name = obj.address.locality.state.name\n```\n\n## Forms\n\nIncluded is a form field for simplifying address entry. A Google maps\nauto-complete is performed in the browser and passed to the view. If\nthe lookup fails the raw entered value is used.\n\nTODO: Talk about this more.\n\n## Partial Example\n\nThe model:\n\n```python\nfrom address.models import AddressField\n\nclass Person(models.Model):\n  address = AddressField(on_delete=models.CASCADE)\n```\n\nThe form:\n\n```\nfrom address.forms import AddressField\n\nclass PersonForm(forms.Form):\n  address = AddressField()\n```\n\nThe template:\n\n```html\n<head>\n{{ form.media }} <!-- needed for JS/GoogleMaps lookup -->\n</head>\n<body>\n  {{ form }}\n</body>\n```\n\n## Running Django-Address Tests\nDjango-address currently has partial form and model test coverage using `django.test.TestCase`.\n\nTo run the current tests:\n\n 1. [Clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) `django-address` locally.\n 1. Navigate to the example site, . `/django-address/example_site`\n 1. Create a [virtual environment](https://www.tangowithdjango.com/book17/chapters/requirements.html#virtual-environments) and install the example site dependencies. For example:\n \n    ```\n    mkvirtualenv -p python3 django-address\n    pip install -r requirements.txt\n    ```\n 1. Run `./manage.py test`\n\n## Important note regarding US Territories\nDjango-address does not currently support the parsing of US territories aka Protectorates such as Guam or Puerto Rico.\n\nThis topic is under active consideration and its status is described in [#82](https://github.com/furious-luke/django-address/issues/82)\n \n## Project Status Notes\n\nThis library was created by [Luke Hodkinson](@furious-luke) originally focused on Australian addresses.\n\nIn 2015 Luke began working to abstract the project so it could handle a wider variety of international addresses.\n\nThis became the current `dev` branch.  While good progress was made on this, the branch became stale and releases\ncontinued under the current model architecture on master. \n\nThe project is currently in open development, read more about the project status [in this issue](#98).  \n\nIf you have questions, bug reports or suggestions please create a New Issue for the project.\n",
    'author': 'Luke Hodkinson',
    'author_email': 'furious.luke@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/furious-luke/django-address',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.5',
}


setup(**setup_kwargs)
