wagtail-maps


Namewagtail-maps JSON
Version 0.3.0 PyPI version JSON
download
home_page
SummaryCreate and display maps with points in Wagtail
upload_time2023-06-07 10:21:05
maintainer
docs_urlNone
authorCliss XXI
requires_python<4,>=3.8
licenseAGPLv3+
keywords wagtail map leaflet
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # wagtail-maps

Create and display maps with points in Wagtail.

**Warning!** This project is still early on in its development lifecycle. It is
possible for breaking changes to occur between versions until reaching a stable
1.0. Feedback and pull requests are welcome.

This package extend Wagtail to add a new Map model, which is composed by one or
more points. Each point may have a title, some content and link to an internal
or external URL. Once you have configured your map from the Wagtail admin, you
will be able to display it in a page - e.g. as a StreamField block.

## Requirements

This package requires the following:
- **Wagtail** (4.1 LTS, 5.0)
- **Django** (3.2 LTS, 4.2 LTS)
- **Python 3** (3.8, 3.9, 3.10, 3.11)

## Installation

1. Install using ``pip``:
   ```shell
   pip install wagtail-maps
   ```
2. Add ``wagtail_maps`` to your ``INSTALLED_APPS`` setting:
   ```python
   INSTALLED_APPS = [
       # ...
       'wagtail_maps',
       # ...
   ]
   ```
3. Include the URL of *wagtail-maps* to your ``urls.py`` file:
   ```python
   from wagtail_maps import urls as wagtailmaps_urls

   urlpatterns = [
       # ...
       path('maps/', include(wagtailmaps_urls)),
       # ...
   ]
   ```
4. Run ``python manage.py migrate`` to create the models

## Usage

A StreamField block `wagtail_maps.blocks.MapBlock` can be used to display a
given `Map` object with its points in your page. To render this block in your
frontend, you will have to include the following assets in the templates which
can contain it - or in your base template:

* the JavaScript code that renders the map with [Leaflet] thanks to a
  [Stimulus] controller:
  ```django
  <script src="{% static "wagtail_maps/js/map-block.js" %}"></script>
  ```
* the default Leaflet stylesheet if you don't provide your own:
  ```django
  <link rel="stylesheet" href="{% static "wagtail_maps/vendor/leaflet.css" %}">
  ```

[Leaflet]: https://leafletjs.com/
[Stimulus]: https://stimulus.hotwired.dev/

## Development
### Quick start

To set up a development environment, ensure that Python 3 is installed on your
system. Then:

1. Clone this repository
2. Create a virtual environment and activate it:
   ```shell
   python3 -m venv venv
   source venv/bin/activate
   ```
3. Install this package and its requirements:
   ```shell
   (venv)$ pip install -r requirements-dev.txt
   ```

### Contributing

The tests are written with [pytest] and code coverage is measured with [coverage].
You can use the following commands while developing:
- ``make test``: run the tests and output a quick report of code coverage
- ``make test-wip``: only run the tests marked as 'wip'
- ``make test-all``: run the tests on all supported versions of Django and
  Wagtail with [nox]

The Python code is formatted and linted thanks to [flake8], [isort] and [black].
All of these tools are configured in [pre-commit] and you should consider to
install its git hook scripts by running:
```shell
(venv)$ pre-commit install
```

When submitting a pull-request, please ensure that the code is well formatted
and covered, and that all the tests pass.

[pytest]: https://docs.pytest.org/
[coverage]: https://coverage.readthedocs.io/
[nox]: https://nox.thea.codes/
[flake8]: https://flake8.pycqa.org/
[isort]: https://pycqa.github.io/isort/
[black]: https://black.readthedocs.io/
[pre-commit]: https://pre-commit.com/

## License

This extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and
licensed under the [AGPLv3+](LICENSE). Any contribution is welcome!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "wagtail-maps",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": "",
    "keywords": "wagtail,map,leaflet",
    "author": "Cliss XXI",
    "author_email": "contact@cliss21.com",
    "download_url": "https://files.pythonhosted.org/packages/a1/cc/8fa8ea1c02d01e32da210c459a884b78d306340b51686a966a55c4eb9465/wagtail_maps-0.3.0.tar.gz",
    "platform": null,
    "description": "# wagtail-maps\n\nCreate and display maps with points in Wagtail.\n\n**Warning!** This project is still early on in its development lifecycle. It is\npossible for breaking changes to occur between versions until reaching a stable\n1.0. Feedback and pull requests are welcome.\n\nThis package extend Wagtail to add a new Map model, which is composed by one or\nmore points. Each point may have a title, some content and link to an internal\nor external URL. Once you have configured your map from the Wagtail admin, you\nwill be able to display it in a page - e.g. as a StreamField block.\n\n## Requirements\n\nThis package requires the following:\n- **Wagtail** (4.1 LTS, 5.0)\n- **Django** (3.2 LTS, 4.2 LTS)\n- **Python 3** (3.8, 3.9, 3.10, 3.11)\n\n## Installation\n\n1. Install using ``pip``:\n   ```shell\n   pip install wagtail-maps\n   ```\n2. Add ``wagtail_maps`` to your ``INSTALLED_APPS`` setting:\n   ```python\n   INSTALLED_APPS = [\n       # ...\n       'wagtail_maps',\n       # ...\n   ]\n   ```\n3. Include the URL of *wagtail-maps* to your ``urls.py`` file:\n   ```python\n   from wagtail_maps import urls as wagtailmaps_urls\n\n   urlpatterns = [\n       # ...\n       path('maps/', include(wagtailmaps_urls)),\n       # ...\n   ]\n   ```\n4. Run ``python manage.py migrate`` to create the models\n\n## Usage\n\nA StreamField block `wagtail_maps.blocks.MapBlock` can be used to display a\ngiven `Map` object with its points in your page. To render this block in your\nfrontend, you will have to include the following assets in the templates which\ncan contain it - or in your base template:\n\n* the JavaScript code that renders the map with [Leaflet] thanks to a\n  [Stimulus] controller:\n  ```django\n  <script src=\"{% static \"wagtail_maps/js/map-block.js\" %}\"></script>\n  ```\n* the default Leaflet stylesheet if you don't provide your own:\n  ```django\n  <link rel=\"stylesheet\" href=\"{% static \"wagtail_maps/vendor/leaflet.css\" %}\">\n  ```\n\n[Leaflet]: https://leafletjs.com/\n[Stimulus]: https://stimulus.hotwired.dev/\n\n## Development\n### Quick start\n\nTo set up a development environment, ensure that Python 3 is installed on your\nsystem. Then:\n\n1. Clone this repository\n2. Create a virtual environment and activate it:\n   ```shell\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n3. Install this package and its requirements:\n   ```shell\n   (venv)$ pip install -r requirements-dev.txt\n   ```\n\n### Contributing\n\nThe tests are written with [pytest] and code coverage is measured with [coverage].\nYou can use the following commands while developing:\n- ``make test``: run the tests and output a quick report of code coverage\n- ``make test-wip``: only run the tests marked as 'wip'\n- ``make test-all``: run the tests on all supported versions of Django and\n  Wagtail with [nox]\n\nThe Python code is formatted and linted thanks to [flake8], [isort] and [black].\nAll of these tools are configured in [pre-commit] and you should consider to\ninstall its git hook scripts by running:\n```shell\n(venv)$ pre-commit install\n```\n\nWhen submitting a pull-request, please ensure that the code is well formatted\nand covered, and that all the tests pass.\n\n[pytest]: https://docs.pytest.org/\n[coverage]: https://coverage.readthedocs.io/\n[nox]: https://nox.thea.codes/\n[flake8]: https://flake8.pycqa.org/\n[isort]: https://pycqa.github.io/isort/\n[black]: https://black.readthedocs.io/\n[pre-commit]: https://pre-commit.com/\n\n## License\n\nThis extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and\nlicensed under the [AGPLv3+](LICENSE). Any contribution is welcome!\n",
    "bugtrack_url": null,
    "license": "AGPLv3+",
    "summary": "Create and display maps with points in Wagtail",
    "version": "0.3.0",
    "project_urls": {
        "Bug Tracker": "https://framagit.org/cliss21/wagtail-maps/-/issues",
        "Source Code": "https://framagit.org/cliss21/wagtail-maps"
    },
    "split_keywords": [
        "wagtail",
        "map",
        "leaflet"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4bfdbb2400dd33e3fc639c7967a5bd9515ba9ea7bb30a81153a28564666735c",
                "md5": "421977f5a6090769c7d44f3042d8eba0",
                "sha256": "09e1ceef3dcc2809168cb4a1e1baa966d63b82aceedce8184be4fb786b0e93c2"
            },
            "downloads": -1,
            "filename": "wagtail_maps-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "421977f5a6090769c7d44f3042d8eba0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 384012,
            "upload_time": "2023-06-07T10:21:02",
            "upload_time_iso_8601": "2023-06-07T10:21:02.930257Z",
            "url": "https://files.pythonhosted.org/packages/d4/bf/dbb2400dd33e3fc639c7967a5bd9515ba9ea7bb30a81153a28564666735c/wagtail_maps-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a1cc8fa8ea1c02d01e32da210c459a884b78d306340b51686a966a55c4eb9465",
                "md5": "0e209eafb26946cf331e5e8f70b36094",
                "sha256": "14240d4142031c55317d745c5a101b9fc9107bfa310d1e11ea311f2576185e64"
            },
            "downloads": -1,
            "filename": "wagtail_maps-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0e209eafb26946cf331e5e8f70b36094",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 427689,
            "upload_time": "2023-06-07T10:21:05",
            "upload_time_iso_8601": "2023-06-07T10:21:05.459475Z",
            "url": "https://files.pythonhosted.org/packages/a1/cc/8fa8ea1c02d01e32da210c459a884b78d306340b51686a966a55c4eb9465/wagtail_maps-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-07 10:21:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "wagtail-maps"
}
        
Elapsed time: 0.07439s