{ "info": { "author": "Szymon Kowali\u0144ski", "author_email": "simonrekin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": "# django-mapbox-location-field\n [![Build Status](https://travis-ci.org/Simon-the-Shark/django-mapbox-location-field.svg?branch=master)](https://travis-ci.org/Simon-the-Shark/django-mapbox-location-field) [![Coverage Status](https://coveralls.io/repos/github/Simon-the-Shark/django-mapbox-location-field/badge.svg?branch=master)](https://coveralls.io/github/Simon-the-Shark/django-mapbox-location-field?branch=master)\n ![PyPI](https://img.shields.io/pypi/v/django-mapbox-location-field.svg)\n ****\n Simple in use **location model and form field** with **MapInput widget** for picking some location. Uses [mapbox gl js](https://docs.mapbox.com/mapbox-gl-js/), flexible map provider API. Fully compatible with bootstrap framework.\n ****\n\n\n# Table of contents\n* [Why this?](#why-this)\n* [Live demo](#live-demo)\n* [Compatibility](#compatibility)\n * [Instalation](#instalation)\n* [Configuration](#configuration)\n* [Usage](#usage)\n* [Customization](#customization)\n * [map_attrs](#map_attrs)\n * [bootstrap](#bootstrap)\n* [Admin interface usage](#admin-interface-usage)\n* [AddressAutoHiddenField](#addressautohiddenfield)\n* [Technologies](#technologies)\n\n# Why this?\nI was searching for some django location field which uses mapbox and I could use in my project. I didn't find anything which suits my needs in 100% and that is why I created this simple django app. My philosopy was simplicity but I wanted to create complete solution for picking location.\n\nFeel free to open issues, make pull request and request some features or instructions. Let me know if you think it is not flexible enought.\n# Compatibility\nAutomatically tested on Travis CI on versions:\n\n* Django 1.11, 2.0, 2.1, 2.2\n* Python 3.5, 3.6, 3.7\n\nPS. Django 1.11 does not support Python 3.7 anymore.\n\n#### Browser support\ndjango-mapbox-location-field support all browsers, which are suported by mapbox gl js. Read more [here](https://docs.mapbox.com/help/troubleshooting/mapbox-browser-support/#mapbox-gl-js)\n\n# Live demo\nCurious how it works and looks like ? See live demo on https://django-mapbox-location-field.herokuapp.com\nDemo app uses [django-bootstrap4](https://github.com/zostera/django-bootstrap4) for a little better looking form fields.\n\n# Instalation\nUsing pip:\n `pip install django-mapbox-location-field`\n\n# Configuration\n* Add `\"mapbox_location_field\"` to `INSTALLED_APPS` in your settings file\n\n```python\nINSTALLED_APPS += (\"mapbox_location_field\",)\n```\n\n* Define [MAPBOX_KEY](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/) in your settings file. This is vulnerable information which has to be passed to frontend, so it can be easily access by user. To ensure your safety, I would recommend using [url restrictions](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/#url-restrictions) and [public scopes](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/#scopes). More information on linked websites.\n```python\nMAPBOX_KEY = \"pk.eyJ1IjoibWlnaHR5c2hhcmt5IiwiYSI6ImNqd2duaW4wMzBhcWI0M3F1MTRvbHB0dWcifQ.1sDAD43q0ktK1Sr374xGfw\"\n```\n**PS. This above is only example access token. You have to paste here yours.**\n\n# Usage\n* Just create some model with LocationField.\n```python\nfrom django.db import models\nfrom mapbox_location_field.models import LocationField\n\nclass SomeLocationModel(models.Model):\n location = LocationField()\n\n```\n* Create ModelForm\n```python\nfrom django import forms\nfrom .models import Location\n\nclass LocationForm(forms.ModelForm):\n class Meta:\n model = Location\n fields = \"__all__\"\n```\nOf course you can also use CreateView, UpdateView or build Form yourself with mapbox_location_field.forms.LocationField\n\n\n* Then just use it in html view. It can't be simpler!\nPaste this in your html head:\n```django\n{% load mapbox_location_field_tags %}\n{% location_field_includes %}\n{% include_jquery %}\n```\n* And this in your body:\n```django\n
\n {% csrf_token %}\n {{form}}\n \n
\n{{ form.media }}\n```\n* Your form is ready! Start your website and see how it looks. If you want to change something look to the [customization](#customization) section.\n\n# Customization\nIn order to change few things you have to use `map_attrs` dictionary.\nDefault `map_attrs` looks like this:\n```python\ndefault_map_attrs = {\n \"style\": \"mapbox://styles/mapbox/outdoors-v11\",\n \"zoom\": 13,\n \"center\": [17.031645, 51.106715],\n \"cursor_style\": 'pointer',\n \"marker_color\": \"red\",\n \"rotate\": False,\n \"geocoder\": True,\n \"fullscreen_button\": True,\n \"navigation_buttons\": True,\n \"track_location_button\": True,\n \"readonly\": True,\n \"placeholder\": \"Pick a location on map below\",\n }\n```\nTo change some values, just pass it when you creates model.\n```python\nfrom django.db import models\nfrom mapbox_location_field.models import LocationField\n\nclass Location(models.Model):\n location = LocationField(map_attrs={\"center\": [0,0], \"marker_color\": \"blue\"})\n```\n## map_attrs\n* style - ``, mapbox style url. Read more [here](https://docs.mapbox.com/help/glossary/style-url/).\n* zoom - ``, map's zoom. Read more [here](https://docs.mapbox.com/help/glossary/zoom-level/).\n* center - `` or `` of ``s, defaults map's center point in [`latitude`, `longitude`]\n* cursor_style - ``, css cursor style. Read more [here](https://www.w3schools.com/cssref/pr_class_cursor.asp).\n* marker_color - `` css color property. Read more [here](https://www.w3schools.com/cssref/css_colors_legal.asp) and [here](https://www.w3schools.com/cssref/css_colors.asp).\n* rotate - ``, whether you can rotate map with right mouse click or not.\n* geocoder -``, whether geocoder searcher is showed or not.\n* fullscreen_button - ``, whether fullscreen button is showed or not.\n* navigation_buttons - ``, whether navigation buttons are showed or not.\n* track_location_button - ``, whether show my location button is showed or not.\n* readonly - ``, whether user can type location in text input\n* placeholder - ``, text input's placeholder\n\n## bootstrap\nMapInput widget is fully compatibile with bootstrap library. I can even recommend to use it with [django-bootstrap4](https://github.com/zostera/django-bootstrap4) or [django-crispy-forms](https://github.com/django-crispy-forms/django-crispy-forms).\n\n# Admin interface usage\nFirst create some model with location field like in [usage section](#usage).\nThen register it in admin interface like this:\n```python\nfrom django.contrib import admin\nfrom .models import Location\nfrom mapbox_location_field.admin import MapAdmin\n\nadmin.site.register(Location, MapAdmin)\n```\nIn example above, Location is name of your model.\nEverything from [customization section](#customization) also works in admin interface.\n\n# AddressAutoHiddenField\nAddressAutoHiddenField is field for storing address. It uses AddressAutoHiddenInput which is hidden and when you place your marker on map, automatically fill itself with proper address.\nIn order to use it just add it to your model. Something like this:\n```python\nclass Location(models.Model):\n location = LocationField()\n address = AddressAutoHiddenField()\n```\n\n# Technologies\n* Django\n* mapbox gl js\n* jquery\n* html and css", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/Simon-the-Shark/django-mapbox-location-field/archive/v0.2.6.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Simon-the-Shark/django-mapbox-location-field", "keywords": "DJANGO,WIDGETS,LOCATION,GEOCODING,MAP,FIELDS,FORMS", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-mapbox-location-field", "package_url": "https://pypi.org/project/django-mapbox-location-field/", "platform": "", "project_url": "https://pypi.org/project/django-mapbox-location-field/", "project_urls": { "Download": "https://github.com/Simon-the-Shark/django-mapbox-location-field/archive/v0.2.6.tar.gz", "Homepage": "https://github.com/Simon-the-Shark/django-mapbox-location-field" }, "release_url": "https://pypi.org/project/django-mapbox-location-field/0.2.6/", "requires_dist": null, "requires_python": "", "summary": "location field with MapInput widget for picking some location", "version": "0.2.6" }, "last_serial": 5500114, "releases": { "0.1.5": [ { "comment_text": "", "digests": { "md5": "909b110d34ad55b89edec3ddb7870e75", "sha256": "ea670d138da711bd748551dd81912cd753fd2c1ca78c2a82d7855078acc2501a" }, "downloads": -1, "filename": "django-mapbox-location-field-0.1.5.tar.gz", "has_sig": false, "md5_digest": "909b110d34ad55b89edec3ddb7870e75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11799, "upload_time": "2019-07-02T09:09:27", "url": "https://files.pythonhosted.org/packages/1d/52/d786d71d59dd9fcbdcdfb69447a639c2d48d930d520d0c843c971991d90d/django-mapbox-location-field-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "b3a1801395ec6835b63b9cb71f06b7ca", "sha256": "6b1c5ab0a82d5973f171bf500f449331c4390d03e5a6e30cac4a2f7815bea03f" }, "downloads": -1, "filename": "django-mapbox-location-field-0.1.6.tar.gz", "has_sig": false, "md5_digest": "b3a1801395ec6835b63b9cb71f06b7ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11812, "upload_time": "2019-07-02T10:10:10", "url": "https://files.pythonhosted.org/packages/f6/2b/109d4a916041829ad75c09e478ef541940f2c94d08653249a95ef33054f0/django-mapbox-location-field-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "bb9825f66b91d6356ee6092a01b950af", "sha256": "0ebd52dc217923d14b36d97fc93aaa3ce96701db79920d5814c5a45eef585139" }, "downloads": -1, "filename": "django-mapbox-location-field-0.1.7.tar.gz", "has_sig": false, "md5_digest": "bb9825f66b91d6356ee6092a01b950af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11973, "upload_time": "2019-07-02T11:15:11", "url": "https://files.pythonhosted.org/packages/36/ef/423191d484574bce0f37ce194acc984e6e12bcae35b9b1cd4b5dcf1e3325/django-mapbox-location-field-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "44b0a771836362e3b82cfbd055e2b0ac", "sha256": "a25aa1afc967f47e0400383f73a7acc73e019e7627cc21fc4fe8c09b750800c6" }, "downloads": -1, "filename": "django-mapbox-location-field-0.1.8.tar.gz", "has_sig": false, "md5_digest": "44b0a771836362e3b82cfbd055e2b0ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12257, "upload_time": "2019-07-02T22:32:52", "url": "https://files.pythonhosted.org/packages/37/ca/a6ddbc38bbb9d4a6e331e138a425a126d524fe990b7d17ebc813f954e659/django-mapbox-location-field-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "cd16a51cbafb1e9fb9b70d7dde3455e3", "sha256": "ffc38f9a7ca603baccb47e49b694f39ad055ebf379bf4f7b6eaed4e000a0a427" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.0.tar.gz", "has_sig": false, "md5_digest": "cd16a51cbafb1e9fb9b70d7dde3455e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12750, "upload_time": "2019-07-04T15:24:06", "url": "https://files.pythonhosted.org/packages/15/e5/2076fab1eaf4c1daa096cbcbaaf42a8fcc28938ca44dfdbddd948f6b8f7a/django-mapbox-location-field-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "a1d15f465f05de06c7f213345126e412", "sha256": "2995a427bcbe33f937af7b74c68329bbc232e7cc40f62eb3d07f77414f674c16" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a1d15f465f05de06c7f213345126e412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12748, "upload_time": "2019-07-05T14:43:14", "url": "https://files.pythonhosted.org/packages/09/ab/be08d97b3df9a8df41dd276bcf0aeb26ff014ac68b6e2798beaa072fcc6f/django-mapbox-location-field-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "382bbfa82ad503ec31eac7540defd0f7", "sha256": "8e14af8f9adddf1c655bcd5ddd55b033e2cde37e3c259e0105c2b0dd3d8c3d8e" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.2.tar.gz", "has_sig": false, "md5_digest": "382bbfa82ad503ec31eac7540defd0f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12756, "upload_time": "2019-07-05T15:51:10", "url": "https://files.pythonhosted.org/packages/8a/7a/0249b45e36316589097d8d44d9ff528063fd2ca50ae0fc17b0363bd86887/django-mapbox-location-field-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "78c264f4726960a784e67cb2da0f208b", "sha256": "ec98d52612ff37da3b15a520171c26c01dd0bf7503e6389423cc550a28cfdaf5" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.3.tar.gz", "has_sig": false, "md5_digest": "78c264f4726960a784e67cb2da0f208b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12758, "upload_time": "2019-07-05T18:45:33", "url": "https://files.pythonhosted.org/packages/7d/66/d74b26334cf8ee3da0adf4d03f10d449e666c86356f77764063e987158e2/django-mapbox-location-field-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "b2bf4dbd5f0e27c5d1f742b05558d85f", "sha256": "c05f4c553c99ef3ab8e27e642dbb28ac5650ad686c7d8a83f5979c8db206e821" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.4.tar.gz", "has_sig": false, "md5_digest": "b2bf4dbd5f0e27c5d1f742b05558d85f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12957, "upload_time": "2019-07-05T19:13:25", "url": "https://files.pythonhosted.org/packages/f8/3b/71e8c07cc36005695f058822ab314e374a92e4d5d53ef79a432c05130ac1/django-mapbox-location-field-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "e0f48764820e4b113e8f737f02db10c4", "sha256": "4791b952c92e8c87936546134fcc710297e5476e1c23c8aed01ae0716086f7d0" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.5.tar.gz", "has_sig": false, "md5_digest": "e0f48764820e4b113e8f737f02db10c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13880, "upload_time": "2019-07-08T09:55:42", "url": "https://files.pythonhosted.org/packages/1a/6f/a394a1bc85f380b7d3d823b767b716bd6fe4c768e303c7fd36f8855947fb/django-mapbox-location-field-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "dad9834fb7f70347cd62cbfde4cf3039", "sha256": "1220190db4bf22ec57c8bb66c3a2c7ac639a3083159c7965ad0dc984c01dc9b0" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.6.tar.gz", "has_sig": false, "md5_digest": "dad9834fb7f70347cd62cbfde4cf3039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13774, "upload_time": "2019-07-08T10:44:43", "url": "https://files.pythonhosted.org/packages/2d/66/5c7304672593ff9e47fa697b3ff0ed87fca409291e8d993d2766c51decf4/django-mapbox-location-field-0.2.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dad9834fb7f70347cd62cbfde4cf3039", "sha256": "1220190db4bf22ec57c8bb66c3a2c7ac639a3083159c7965ad0dc984c01dc9b0" }, "downloads": -1, "filename": "django-mapbox-location-field-0.2.6.tar.gz", "has_sig": false, "md5_digest": "dad9834fb7f70347cd62cbfde4cf3039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13774, "upload_time": "2019-07-08T10:44:43", "url": "https://files.pythonhosted.org/packages/2d/66/5c7304672593ff9e47fa697b3ff0ed87fca409291e8d993d2766c51decf4/django-mapbox-location-field-0.2.6.tar.gz" } ] }