django-editor-ymaps


Namedjango-editor-ymaps JSON
Version 2.3.7 PyPI version JSON
download
home_pagehttps://github.com/kebasyaty/django-editor-ymaps
SummaryCreating and editing Yandex maps.
upload_time2023-10-04 11:37:52
maintainer
docs_urlNone
authorkebasyaty
requires_python
licenseMIT License
keywords django yandex maps admin editor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. figure:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/logo.png?raw=true
   :target: https://pypi.org/project/django-editor-ymaps/
   :alt: Logo

|

.. image:: https://img.shields.io/badge/pypi-v23.2.1%20-blue.svg
   :target: https://pypi.org/project/pip/
   :alt: PyPI badge
.. image:: https://img.shields.io/badge/python-%3E%3D%203.8-yellow.svg
   :target: https://www.python.org/
   :alt: Python badge
.. image:: https://img.shields.io/badge/django-%3E%3D%203.2.4-brightgreen.svg
   :target: https://www.djangoproject.com/
   :alt: Django badge
.. image:: https://pepy.tech/badge/django-editor-ymaps
   :target: https://pepy.tech/project/django-editor-ymaps
   :alt: Downloads badge
.. image:: https://snyk.io/advisor/python/django-editor-ymaps/badge.svg
   :target: https://snyk.io/advisor/python/django-editor-ymaps
   :alt: django-editor-ymaps
.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
   :target: https://github.com/kebasyaty/django-editor-ymaps/blob/master/LICENSE
   :alt: MIT badge

DjEYM ( django-editor-ymaps )
=============================
- **(ru)** *Удобное использование картографической службы Яндекса для веб-разработки на популярном и свободном фреймворке Django.*
- **(en)** *Convenient use of the Yandex map service for web development on the popular and free Django framework.*

Условия использования API Яндекс.Карт ( *Terms of use for the API* )
--------------------------------------------------------------------
- **(ru)** `Условия использования Яндекс.Карт <https://tech.yandex.ru/maps/jsapi/doc/2.1/quick-start/index-docpage/#get-api-key>`_
- **(ru)** `Получить API-ключ <https://tech.yandex.ru/maps/jsapi/doc/2.1/quick-start/index-docpage/#get-api-key>`_
- 
- **(en)** `Terms of use for the Yandex.Maps <https://tech.yandex.com/maps/jsapi/doc/2.1/terms/index-docpage/>`_
- **(en)** `Get the API key <https://tech.yandex.com/maps/jsapi/doc/2.1/quick-start/index-docpage/#get-api-key>`_

|

Attention
---------

Don't forget to add to settings ( djeym >= 2.2.x )::

    MIDDLEWARE = [
        ...
        'django.middleware.locale.LocaleMiddleware',
        'djeym.middlewares.AjaxMiddleware',
    ]

For those who are updating to version 2.3.x::

  python manage.py migrate djeym

|

Requirements
------------
- **Python** >= 3.8
- **Django** >= 3.2.4
- **Pillow** - `https://pypi.org/project/Pillow/ <https://pypi.org/project/Pillow/>`_
- **django-imagekit** - `https://github.com/matthewwithanm/django-imagekit <https://github.com/matthewwithanm/django-imagekit>`_
- **python-slugify** - `https://github.com/un33k/python-slugify <https://github.com/un33k/python-slugify>`_
- **django-ckeditor** - `https://github.com/django-ckeditor/django-ckeditor <https://github.com/django-ckeditor/django-ckeditor>`_
- **lxml** - `https://pypi.org/project/lxml/ <https://pypi.org/project/lxml/>`_
- **django-ipware** - `https://github.com/un33k/django-ipware <https://github.com/un33k/django-ipware>`_
- **django-colorful** - `<https://pypi.org/project/django-colorful/>`_
- **django-admin-sortable** - `<https://pypi.org/project/django-admin-sortable/>`_
-
- **Vue.js** - `<https://vuejs.org/>`_
- **Vuetify.js** - `<https://vuetifyjs.com/>`_

Installation
------------
Install libraries ( Ubuntu >= 18.04, Mint 19.x )::

    sudo apt install -y python-dev python3-dev libjpeg8-dev python-pil libevent-dev build-essential libpq-dev libxml2-dev libxslt1-dev gettext libjpeg-dev python-setuptools python3-setuptools

Install django-editor-ymaps using pip::

    pip install django-editor-ymaps

Settings
--------

Add settings::

    import os
    
    # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    INSTALLED_APPS = [
        ...
        'imagekit',
        'ckeditor',
        'ckeditor_uploader',
        'colorful',
        'adminsortable',
        'djeym',
        ...
    ]

    MIDDLEWARE = [
        ...
        'django.middleware.locale.LocaleMiddleware',
        'djeym.middlewares.AjaxMiddleware',
    ]

    # Static files (CSS, JavaScript, Images)
    # https://docs.djangoproject.com/en/3.0/howto/static-files/
    STATIC_URL = '/static/'
    STATIC_ROOT = os.path.join(BASE_DIR, 'static')
    
    MEDIA_URL = '/media/'
    MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

    # To send test messages.
    # 1. Notify administrator of a new custom marker.
    # 2. Notify user about successful moderation of his marker.
    # Mail server for testings: $ python -m smtpd -n -c DebuggingServer localhost:1025
    EMAIL_HOST = 'localhost'
    EMAIL_PORT = 1025
    EMAIL_HOST_USER = ''
    EMAIL_HOST_PASSWORD = ''
    EMAIL_USE_TLS = False
    DEFAULT_FROM_EMAIL = 'noreply@site.net'

    # django-ckeditor
    # https://github.com/django-ckeditor/django-ckeditor
    CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/'
    CKEDITOR_UPLOAD_PATH = 'uploads/'
    CKEDITOR_FILENAME_GENERATOR = 'djeym.utils.get_filename'
    CKEDITOR_THUMBNAIL_SIZE = (300, 300)
    CKEDITOR_FORCE_JPEG_COMPRESSION = True
    CKEDITOR_IMAGE_QUALITY = 40
    CKEDITOR_IMAGE_BACKEND = 'pillow'
    CKEDITOR_ALLOW_NONIMAGE_FILES = False  # False - Only image files. (At your discretion)
    CKEDITOR_CONFIGS = {
        'default': {
            'toolbar': 'full',
            'height': 400,
            'width': '100%',
        },
        'djeym': {
            'toolbar': 'full',
            'height': 400,
            'width': 362,
            'colorButton_colors': 'F44336,C62828,E91E63,AD1457,9C27B0,6A1B9A,'
                                  '673AB7,4527A0,3F51B5,283593,2196F3,1565C0,'
                                  '03A9F4,0277BD,00BCD4,00838F,009688,00695C,'
                                  '4CAF50,2E7D32,8BC34A,558B2F,CDDC39,9E9D24,'
                                  'FFEB3B,F9A825,FFC107,FF8F00,FF9800,EF6C00,'
                                  'FF5722,D84315,795548,4E342E,607D8B,37474F,'
                                  '9E9E9E,424242,000000,FFFFFF',
            'colorButton_enableAutomatic': False,
            'colorButton_enableMore': True
        }
    }
    
    # (If a non-authenticated user requests an editor page.)
    # (Если не аутентифицированный пользователь запросит страницу редактора.)
    LOGIN_URL = '/admin/'  # or change to your URL
    
    # Required for django-admin-sortable
    # https://github.com/alsoicode/django-admin-sortable#configuration
    CSRF_COOKIE_HTTPONLY = False
    
    # The API key is used in the free and paid versions.
    # You can get the key in the developer’s office - https://passport.yandex.com/
    # ( API-ключ используется в свободной и платной версиях.
    #   Получить ключ можно в кабинете разработчика - https://developer.tech.yandex.ru/ )
    DJEYM_YMAPS_API_KEY = ''
    
    # For paid use API --> True
    # ( Для платного использования --> True )
    DJEYM_YMAPS_API_KEY_FOR_ENTERPRISE = False
    
    # Map download mode. Default = 'release'
    # (Режим загрузки карт.)
    # DJEYM_YMAPS_DOWNLOAD_MODE = 'debug' if DEBUG else 'release'

Add to main URLs
----------------

urls.py::

    from django.contrib import admin
    from django.urls import path, include
    from django.conf import settings
    from django.contrib.staticfiles.urls import static
    
    urlpatterns = [
        ...
        path('admin/', admin.site.urls),
        path('ckeditor/', include('ckeditor_uploader.urls')),
        path('djeym/', include('djeym.urls', namespace='djeym')),
        ...
    ] + static(
        settings.STATIC_URL,
        document_root=settings.STATIC_ROOT
    ) + static(
        settings.MEDIA_URL,
        document_root=settings.MEDIA_ROOT
    )

Add media directory to your project
-----------------------------------

    media/uploads

Update Migrations
-----------------

    python manage.py migrate djeym

Usage
-----
1) Добавьте иконку кластера. ( *Add Cluster Icon.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. `Скачайте коллекцию кластеров. (Download the cluster collection.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Cluster_Collection.zip?raw=true>`_
2. **Ознакомьтесь с содержимым архива.** ( *Read the contents of the archive.* )
3. **Выберите иконку кластера и добавьте по адресу - Панель администратора > ЯНДЕКС КАРТЫ > Иконки для кластеров > Добавить Иконку для кластеров.**
   ( *Select the cluster icon and add it to the address - Admin Panel > YANDEX MAPS > Icons for Clusters > Add Icon for Clusters.* )

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/add_cluster.png?raw=true
   :alt: Add Cluster

2) Добавьте коллекцию маркеров. ( *Add a collection of markers.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. `Скачайте коллекцию маркеров. (Download the marker collection.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Marker_Collection.zip?raw=true>`_
2. **Ознакомьтесь с содержимым архива.** ( *Read the contents of the archive.* )
3. **Прочитайте readme файл, выберите коллекцию и добавьте через панель администратора.**
   ( *Read the readme file, select the collection and add it through the admin panel.* )

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/import_icon_collection.png?raw=true
   :alt: Import the Marker Collection

**Добавляя собственные иконки, проверяйте смещение по эталону.** ( *By adding your own icons, check the offset by standard.* )

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/offset_icon_for_markers.png?raw=true
   :alt: Check marker icon offset

3) Добавьте источники тайловых слоев. ( *Add tile sources.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. `Скачайте источники тайловых слоев. (Download tile sources.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Tile.zip?raw=true>`_
2. **Ознакомьтесь с содержимым архива.** ( *Read the contents of the archive.* )
3. **Прочитайте readme файл и добавьте источники через панель администратора.** ( *Read the readme file and add sources through the admin panel.* )

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/import_tile_sources.png?raw=true
   :alt: Import the Tile Sources

4) Добавьте иконку индикатора загрузки. ( *Add loading indicator icon.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. `Скачайте иконки для индикатора загрузки. (Download the icon for the loading indicator.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Spinner.zip?raw=true>`_
2. **Ознакомьтесь с содержимым архива.** ( *Read the contents of the archive.* )
3. **Прочитайте readme файл и добавьте иконку через панель администратора.** ( *Read the readme file and add the icon through the admin panel.* )

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/add_loading_indicator.png?raw=true
   :alt: Add Loading Indicator

5) Создайте вашу первую карту. ( *Create your first map.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. **Перейдите по адресу - Панель администратора > ЯНДЕКС КАРТЫ >  Карты > Добавить Карту.**
   ( *Navigate to the address - Admin Panel > YANDEX MAPS > Maps > Add Map.* )

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/create_map.png?raw=true
   :alt: Create map

6) Редактировать карту. ( *Edit map.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/edit_map.png?raw=true
   :alt: Edit map

Обзор страницы редактора. ( *Editor page overview.* )
-----------------------------------------------------

1) Меню редактора - Фильтры по категориям. ( *Editor Menu - Filters by category.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_filters.png?raw=true
   :alt: Editor Menu - Filters by category

2) Меню редактора - Источники тайлов. ( *Editor Menu - Tile Sources.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_tile.png?raw=true
   :alt: Editor Menu - Tile Sources

3) Меню редактора - Общие настройки. ( *Editor Menu - General settings.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_general_settings.png?raw=true
   :alt: Editor Menu - General settings

4) Меню редактора - Элементы управления. ( *Editor Menu - Controls.* )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_controls.png?raw=true
   :alt: Editor Menu - Controls

5) Меню редактора - Настройки тепловой карты. (*Editor Menu - Heatmap settings.*)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_heatmap.png?raw=true
   :alt: Editor Menu - Heatmap settings

6) Меню редактора - Индикаторы загрузки. (*Editor Menu - Loading indicators.*)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_loading_indicators.png?raw=true
   :alt: Editor Menu - Loading indicators

Добавление геообъектов на карту. ( *Adding geo-objects to the map.* )
---------------------------------------------------------------------

- **(ru)** Левый клик на карте, откроется меню с предложением выбрать тип объекта.
- **(en)** Left-clicking on the map opens a menu with a suggestion to choose the type of object.

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/adding_geo_objects.png?raw=true
   :alt: Adding geo-objects

- **(ru)** Маркер - Сменить иконку.
- **(en)** Marker - Change icon.

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/marker_change_icon.png?raw=true
   :alt: Marker - Change icon

- **(ru)** Пример маршрута на карте.
- **(en)** Example route on the map.

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/example_route.png?raw=true
   :alt: Example of the route

- **(ru)** Пример территории на карте.
- **(en)** An example of the territory on the map.

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/example_territory.png?raw=true
   :alt: Example of the territory

Выводим карту на страницу сайта. ( *Display a map on the site page.* )
----------------------------------------------------------------------

Добавьте в шаблон. ( Add to template. )::

    {% load i18n static djeymtags %}

    <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">

      <!-- START VENDORS CSS -->
      <!-- Roboto Font:
            Usage (css):
              font-size: 16px;
              font-family: Roboto, sans-serif !important;
              font-weight: 100|300|400|500|700|900;
              font-style: italic!important; -->
      <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
      <!-- Material Design Icons:
            url: https://materialdesignicons.com/
            Usage (html):
              <span class="mdi mdi-name"></span>
              Size: mdi-18px|mdi-24px|mdi-36px|mdi-48px or font-size: 16px;
              Rotate: mdi-rotate-45|mdi-rotate-90|mdi-rotate-135|mdi-rotate-180|mdi-rotate-225|mdi-rotate-270|mdi-rotate-315
              Flip: mdi-flip-h|mdi-flip-v
              Color: mdi-light|mdi-light mdi-inactive|mdi-dark|mdi-dark mdi-inactive or color: #212121; -->
      <link href="https://cdn.jsdelivr.net/npm/@mdi/font@7.x/css/materialdesignicons.min.css" rel="stylesheet">
      <!-- END VENDORS CSS -->
    </head>

    <body>
      <!-- START MAP -->
      <!-- Buttons are optional.
           (Кнопки не являются обязательными.) -->
      <style type="text/css">
        .djeym-button {
          font-family: Roboto, sans-serif !important;
          background-color: #4CAF50;
          border: none;
          color: white;
          padding: 10px 24px;
          text-align: center;
          text-decoration: none;
          display: inline-block;
          font-size: 16px;
          margin: 4px 2px;
          cursor: pointer;
        }
        .djeym-button-bar {
          display: none;
          margin-bottom: 10px;
        }
      </style>
      <div class="djeym-button-bar">
        <button id="djeym-open-panel" type="button" class="djeym-button">
          <span class="mdi mdi-arrow-expand-right"></span>
          Open Panel
        </button>
        <button id="djeym-add-marker" type="button" class="djeym-button">
          <span class="mdi mdi-map-marker-plus"></span>
          Add Marker
        </button>
      </div>
      <div id="djeym-app" class="djeym"></div>
      <!-- END MAP -->

      <!-- START VENDORS JS -->
      <script type="text/javascript" src="{% static "djeym/js/jquery.min.js" %}"></script>
      <script src="{% static "djeym/js/jquery-regex.min.js" %}"></script>
      ...
      {% djeym_yandex_map slug='test-map' lang=request.LANGUAGE_CODE %}
      <!-- END VENDORS JS -->
    </body>

Карта с открытой панелью. ( *Map with open panel.* )
----------------------------------------------------

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/map_opened_panel.png?raw=true
    :alt: Map with open panel

Карта с открытой формой для добавления пользовательских маркеров. ( *Map with an open form for adding custom markers.* )
------------------------------------------------------------------------------------------------------------------------

- **(ru)** Для безопасности, в названии и описании, все html теги удаляются.
- **(en)** For security, in the title and description, all html tags are deleted.

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/map_opened_form.png?raw=true
    :alt: Map with open form

Действия администратора после успешной модерации. ( *Admin actions after successful moderation.* )
------------------------------------------------------------------------------------------------------------------------

.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/after_successful_moderation.png?raw=true
    :alt: After successful moderation

Уведомление о новом пользовательском маркере. ( *Notification of a new custom marker.* )
----------------------------------------------------------------------------------------

Add in views.py::

    from django.core.mail import send_mail
    from django.db.models.signals import post_save
    from django.dispatch import receiver
    from djeym.models import Placemark
    
    # SIMPLE EXAMPLE.
    # 1. Notify administrator of a new custom marker.
    # 2. Notify user about successful moderation of his marker.
    # Mail server for testings: $ python -m smtpd -n -c DebuggingServer localhost:1025
    @receiver(post_save, sender=Placemark)
    def notify_email(instance, **kwargs):
        """Notify by email of a new custom marker."""
    
        """
        # May come in handy. (Может пригодится.)
        title = instance.header  # (html)
        description = instance.body  # (html)
        image_url = instance.user_image.url
        """
        # Notify administrator of a new custom marker.
        if instance.is_user_marker and not instance.is_sended_admin_email:
            subject = 'Text subject'
            message = 'Text message - Url: ' + \
                'http(s)://your.domain/admin/djeym/placemark/{}/change/'.format(instance.pk)
            from_email = 'admin@site.net'  # or corporate email
            recipient_list = ['admin@site.net']  # Your work email
            send_mail(subject, message, from_email,
                      recipient_list, fail_silently=False)
            # Required
            instance.is_sended_admin_email = True
            instance.save()
        # Notify user about successful moderation of his marker.
        elif instance.active and instance.is_user_marker and not instance.is_sended_user_email:
            subject = 'Text subject'
            message = 'Text message'
            from_email = 'admin@site.net'  # Your work email
            recipient_list = [instance.user_email]
            send_mail(subject, message, from_email,
                      recipient_list, fail_silently=False)
            # Required
            instance.is_sended_user_email = True
            instance.save()

LICENSE
-------
- `MIT License <https://github.com/kebasyaty/django-editor-ymaps/blob/master/LICENSE>`_
- Copyright (c) 2014 kebasyaty

CHANGELOG
---------
`View the change history. <https://github.com/kebasyaty/django-editor-ymaps/blob/master/CHANGELOG.rst>`_

.. contents:: Contents
   :depth: 3

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kebasyaty/django-editor-ymaps",
    "name": "django-editor-ymaps",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django,yandex,maps,admin,editor",
    "author": "kebasyaty",
    "author_email": "kebasyaty@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/59/88/d2c48a9d1a5401af9abd9960272cb5568d6a8cb6034a89f5c1d7b51cf510/django-editor-ymaps-2.3.7.tar.gz",
    "platform": "any",
    "description": ".. figure:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/logo.png?raw=true\r\n   :target: https://pypi.org/project/django-editor-ymaps/\r\n   :alt: Logo\r\n\r\n|\r\n\r\n.. image:: https://img.shields.io/badge/pypi-v23.2.1%20-blue.svg\r\n   :target: https://pypi.org/project/pip/\r\n   :alt: PyPI badge\r\n.. image:: https://img.shields.io/badge/python-%3E%3D%203.8-yellow.svg\r\n   :target: https://www.python.org/\r\n   :alt: Python badge\r\n.. image:: https://img.shields.io/badge/django-%3E%3D%203.2.4-brightgreen.svg\r\n   :target: https://www.djangoproject.com/\r\n   :alt: Django badge\r\n.. image:: https://pepy.tech/badge/django-editor-ymaps\r\n   :target: https://pepy.tech/project/django-editor-ymaps\r\n   :alt: Downloads badge\r\n.. image:: https://snyk.io/advisor/python/django-editor-ymaps/badge.svg\r\n   :target: https://snyk.io/advisor/python/django-editor-ymaps\r\n   :alt: django-editor-ymaps\r\n.. image:: https://img.shields.io/github/license/mashape/apistatus.svg\r\n   :target: https://github.com/kebasyaty/django-editor-ymaps/blob/master/LICENSE\r\n   :alt: MIT badge\r\n\r\nDjEYM ( django-editor-ymaps )\r\n=============================\r\n- **(ru)** *\u0423\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Django.*\r\n- **(en)** *Convenient use of the Yandex map service for web development on the popular and free Django framework.*\r\n\r\n\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u042f\u043d\u0434\u0435\u043a\u0441.\u041a\u0430\u0440\u0442 ( *Terms of use for the API* )\r\n--------------------------------------------------------------------\r\n- **(ru)** `\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u042f\u043d\u0434\u0435\u043a\u0441.\u041a\u0430\u0440\u0442 <https://tech.yandex.ru/maps/jsapi/doc/2.1/quick-start/index-docpage/#get-api-key>`_\r\n- **(ru)** `\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c API-\u043a\u043b\u044e\u0447 <https://tech.yandex.ru/maps/jsapi/doc/2.1/quick-start/index-docpage/#get-api-key>`_\r\n- \r\n- **(en)** `Terms of use for the Yandex.Maps <https://tech.yandex.com/maps/jsapi/doc/2.1/terms/index-docpage/>`_\r\n- **(en)** `Get the API key <https://tech.yandex.com/maps/jsapi/doc/2.1/quick-start/index-docpage/#get-api-key>`_\r\n\r\n|\r\n\r\nAttention\r\n---------\r\n\r\nDon't forget to add to settings ( djeym >= 2.2.x )::\r\n\r\n    MIDDLEWARE = [\r\n        ...\r\n        'django.middleware.locale.LocaleMiddleware',\r\n        'djeym.middlewares.AjaxMiddleware',\r\n    ]\r\n\r\nFor those who are updating to version 2.3.x::\r\n\r\n  python manage.py migrate djeym\r\n\r\n|\r\n\r\nRequirements\r\n------------\r\n- **Python** >= 3.8\r\n- **Django** >= 3.2.4\r\n- **Pillow** - `https://pypi.org/project/Pillow/ <https://pypi.org/project/Pillow/>`_\r\n- **django-imagekit** - `https://github.com/matthewwithanm/django-imagekit <https://github.com/matthewwithanm/django-imagekit>`_\r\n- **python-slugify** - `https://github.com/un33k/python-slugify <https://github.com/un33k/python-slugify>`_\r\n- **django-ckeditor** - `https://github.com/django-ckeditor/django-ckeditor <https://github.com/django-ckeditor/django-ckeditor>`_\r\n- **lxml** - `https://pypi.org/project/lxml/ <https://pypi.org/project/lxml/>`_\r\n- **django-ipware** - `https://github.com/un33k/django-ipware <https://github.com/un33k/django-ipware>`_\r\n- **django-colorful** - `<https://pypi.org/project/django-colorful/>`_\r\n- **django-admin-sortable** - `<https://pypi.org/project/django-admin-sortable/>`_\r\n-\r\n- **Vue.js** - `<https://vuejs.org/>`_\r\n- **Vuetify.js** - `<https://vuetifyjs.com/>`_\r\n\r\nInstallation\r\n------------\r\nInstall libraries ( Ubuntu >= 18.04, Mint 19.x )::\r\n\r\n    sudo apt install -y python-dev python3-dev libjpeg8-dev python-pil libevent-dev build-essential libpq-dev libxml2-dev libxslt1-dev gettext libjpeg-dev python-setuptools python3-setuptools\r\n\r\nInstall django-editor-ymaps using pip::\r\n\r\n    pip install django-editor-ymaps\r\n\r\nSettings\r\n--------\r\n\r\nAdd settings::\r\n\r\n    import os\r\n    \r\n    # Build paths inside the project like this: os.path.join(BASE_DIR, ...)\r\n    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\r\n\r\n    INSTALLED_APPS = [\r\n        ...\r\n        'imagekit',\r\n        'ckeditor',\r\n        'ckeditor_uploader',\r\n        'colorful',\r\n        'adminsortable',\r\n        'djeym',\r\n        ...\r\n    ]\r\n\r\n    MIDDLEWARE = [\r\n        ...\r\n        'django.middleware.locale.LocaleMiddleware',\r\n        'djeym.middlewares.AjaxMiddleware',\r\n    ]\r\n\r\n    # Static files (CSS, JavaScript, Images)\r\n    # https://docs.djangoproject.com/en/3.0/howto/static-files/\r\n    STATIC_URL = '/static/'\r\n    STATIC_ROOT = os.path.join(BASE_DIR, 'static')\r\n    \r\n    MEDIA_URL = '/media/'\r\n    MEDIA_ROOT = os.path.join(BASE_DIR, 'media')\r\n\r\n    # To send test messages.\r\n    # 1. Notify administrator of a new custom marker.\r\n    # 2. Notify user about successful moderation of his marker.\r\n    # Mail server for testings: $ python -m smtpd -n -c DebuggingServer localhost:1025\r\n    EMAIL_HOST = 'localhost'\r\n    EMAIL_PORT = 1025\r\n    EMAIL_HOST_USER = ''\r\n    EMAIL_HOST_PASSWORD = ''\r\n    EMAIL_USE_TLS = False\r\n    DEFAULT_FROM_EMAIL = 'noreply@site.net'\r\n\r\n    # django-ckeditor\r\n    # https://github.com/django-ckeditor/django-ckeditor\r\n    CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/'\r\n    CKEDITOR_UPLOAD_PATH = 'uploads/'\r\n    CKEDITOR_FILENAME_GENERATOR = 'djeym.utils.get_filename'\r\n    CKEDITOR_THUMBNAIL_SIZE = (300, 300)\r\n    CKEDITOR_FORCE_JPEG_COMPRESSION = True\r\n    CKEDITOR_IMAGE_QUALITY = 40\r\n    CKEDITOR_IMAGE_BACKEND = 'pillow'\r\n    CKEDITOR_ALLOW_NONIMAGE_FILES = False  # False - Only image files. (At your discretion)\r\n    CKEDITOR_CONFIGS = {\r\n        'default': {\r\n            'toolbar': 'full',\r\n            'height': 400,\r\n            'width': '100%',\r\n        },\r\n        'djeym': {\r\n            'toolbar': 'full',\r\n            'height': 400,\r\n            'width': 362,\r\n            'colorButton_colors': 'F44336,C62828,E91E63,AD1457,9C27B0,6A1B9A,'\r\n                                  '673AB7,4527A0,3F51B5,283593,2196F3,1565C0,'\r\n                                  '03A9F4,0277BD,00BCD4,00838F,009688,00695C,'\r\n                                  '4CAF50,2E7D32,8BC34A,558B2F,CDDC39,9E9D24,'\r\n                                  'FFEB3B,F9A825,FFC107,FF8F00,FF9800,EF6C00,'\r\n                                  'FF5722,D84315,795548,4E342E,607D8B,37474F,'\r\n                                  '9E9E9E,424242,000000,FFFFFF',\r\n            'colorButton_enableAutomatic': False,\r\n            'colorButton_enableMore': True\r\n        }\r\n    }\r\n    \r\n    # (If a non-authenticated user requests an editor page.)\r\n    # (\u0415\u0441\u043b\u0438 \u043d\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430.)\r\n    LOGIN_URL = '/admin/'  # or change to your URL\r\n    \r\n    # Required for django-admin-sortable\r\n    # https://github.com/alsoicode/django-admin-sortable#configuration\r\n    CSRF_COOKIE_HTTPONLY = False\r\n    \r\n    # The API key is used in the free and paid versions.\r\n    # You can get the key in the developer\u2019s office - https://passport.yandex.com/\r\n    # ( API-\u043a\u043b\u044e\u0447 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u0438 \u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.\r\n    #   \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 - https://developer.tech.yandex.ru/ )\r\n    DJEYM_YMAPS_API_KEY = ''\r\n    \r\n    # For paid use API --> True\r\n    # ( \u0414\u043b\u044f \u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f --> True )\r\n    DJEYM_YMAPS_API_KEY_FOR_ENTERPRISE = False\r\n    \r\n    # Map download mode. Default = 'release'\r\n    # (\u0420\u0435\u0436\u0438\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u0430\u0440\u0442.)\r\n    # DJEYM_YMAPS_DOWNLOAD_MODE = 'debug' if DEBUG else 'release'\r\n\r\nAdd to main URLs\r\n----------------\r\n\r\nurls.py::\r\n\r\n    from django.contrib import admin\r\n    from django.urls import path, include\r\n    from django.conf import settings\r\n    from django.contrib.staticfiles.urls import static\r\n    \r\n    urlpatterns = [\r\n        ...\r\n        path('admin/', admin.site.urls),\r\n        path('ckeditor/', include('ckeditor_uploader.urls')),\r\n        path('djeym/', include('djeym.urls', namespace='djeym')),\r\n        ...\r\n    ] + static(\r\n        settings.STATIC_URL,\r\n        document_root=settings.STATIC_ROOT\r\n    ) + static(\r\n        settings.MEDIA_URL,\r\n        document_root=settings.MEDIA_ROOT\r\n    )\r\n\r\nAdd media directory to your project\r\n-----------------------------------\r\n\r\n    media/uploads\r\n\r\nUpdate Migrations\r\n-----------------\r\n\r\n    python manage.py migrate djeym\r\n\r\nUsage\r\n-----\r\n1) \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. ( *Add Cluster Icon.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n1. `\u0421\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432. (Download the cluster collection.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Cluster_Collection.zip?raw=true>`_\r\n2. **\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0430\u0440\u0445\u0438\u0432\u0430.** ( *Read the contents of the archive.* )\r\n3. **\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 - \u041f\u0430\u043d\u0435\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 > \u042f\u041d\u0414\u0415\u041a\u0421 \u041a\u0410\u0420\u0422\u042b > \u0418\u043a\u043e\u043d\u043a\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 > \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0418\u043a\u043e\u043d\u043a\u0443 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432.**\r\n   ( *Select the cluster icon and add it to the address - Admin Panel > YANDEX MAPS > Icons for Clusters > Add Icon for Clusters.* )\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/add_cluster.png?raw=true\r\n   :alt: Add Cluster\r\n\r\n2) \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432. ( *Add a collection of markers.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n1. `\u0421\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432. (Download the marker collection.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Marker_Collection.zip?raw=true>`_\r\n2. **\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0430\u0440\u0445\u0438\u0432\u0430.** ( *Read the contents of the archive.* )\r\n3. **\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 readme \u0444\u0430\u0439\u043b, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043d\u0435\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.**\r\n   ( *Read the readme file, select the collection and add it through the admin panel.* )\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/import_icon_collection.png?raw=true\r\n   :alt: Import the Marker Collection\r\n\r\n**\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u043a\u043e\u043d\u043a\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u044d\u0442\u0430\u043b\u043e\u043d\u0443.** ( *By adding your own icons, check the offset by standard.* )\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/offset_icon_for_markers.png?raw=true\r\n   :alt: Check marker icon offset\r\n\r\n3) \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0442\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u043b\u043e\u0435\u0432. ( *Add tile sources.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n1. `\u0421\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0442\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u043b\u043e\u0435\u0432. (Download tile sources.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Tile.zip?raw=true>`_\r\n2. **\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0430\u0440\u0445\u0438\u0432\u0430.** ( *Read the contents of the archive.* )\r\n3. **\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 readme \u0444\u0430\u0439\u043b \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043d\u0435\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.** ( *Read the readme file and add sources through the admin panel.* )\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/import_tile_sources.png?raw=true\r\n   :alt: Import the Tile Sources\r\n\r\n4) \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. ( *Add loading indicator icon.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n1. `\u0421\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. (Download the icon for the loading indicator.) <https://github.com/kebasyaty/django-editor-ymaps/blob/master/Spinner.zip?raw=true>`_\r\n2. **\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0430\u0440\u0445\u0438\u0432\u0430.** ( *Read the contents of the archive.* )\r\n3. **\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 readme \u0444\u0430\u0439\u043b \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043d\u0435\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.** ( *Read the readme file and add the icon through the admin panel.* )\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/add_loading_indicator.png?raw=true\r\n   :alt: Add Loading Indicator\r\n\r\n5) \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0430\u0448\u0443 \u043f\u0435\u0440\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443. ( *Create your first map.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n1. **\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 - \u041f\u0430\u043d\u0435\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 > \u042f\u041d\u0414\u0415\u041a\u0421 \u041a\u0410\u0420\u0422\u042b >  \u041a\u0430\u0440\u0442\u044b > \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u041a\u0430\u0440\u0442\u0443.**\r\n   ( *Navigate to the address - Admin Panel > YANDEX MAPS > Maps > Add Map.* )\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/create_map.png?raw=true\r\n   :alt: Create map\r\n\r\n6) \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0443. ( *Edit map.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/edit_map.png?raw=true\r\n   :alt: Edit map\r\n\r\n\u041e\u0431\u0437\u043e\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. ( *Editor page overview.* )\r\n-----------------------------------------------------\r\n\r\n1) \u041c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 - \u0424\u0438\u043b\u044c\u0442\u0440\u044b \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c. ( *Editor Menu - Filters by category.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_filters.png?raw=true\r\n   :alt: Editor Menu - Filters by category\r\n\r\n2) \u041c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 - \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0442\u0430\u0439\u043b\u043e\u0432. ( *Editor Menu - Tile Sources.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_tile.png?raw=true\r\n   :alt: Editor Menu - Tile Sources\r\n\r\n3) \u041c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 - \u041e\u0431\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. ( *Editor Menu - General settings.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_general_settings.png?raw=true\r\n   :alt: Editor Menu - General settings\r\n\r\n4) \u041c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 - \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. ( *Editor Menu - Controls.* )\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_controls.png?raw=true\r\n   :alt: Editor Menu - Controls\r\n\r\n5) \u041c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 - \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u043f\u043b\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. (*Editor Menu - Heatmap settings.*)\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_heatmap.png?raw=true\r\n   :alt: Editor Menu - Heatmap settings\r\n\r\n6) \u041c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 - \u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. (*Editor Menu - Loading indicators.*)\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/editor_menu_loading_indicators.png?raw=true\r\n   :alt: Editor Menu - Loading indicators\r\n\r\n\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0435\u043e\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443. ( *Adding geo-objects to the map.* )\r\n---------------------------------------------------------------------\r\n\r\n- **(ru)** \u041b\u0435\u0432\u044b\u0439 \u043a\u043b\u0438\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044e \u0441 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430.\r\n- **(en)** Left-clicking on the map opens a menu with a suggestion to choose the type of object.\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/adding_geo_objects.png?raw=true\r\n   :alt: Adding geo-objects\r\n\r\n- **(ru)** \u041c\u0430\u0440\u043a\u0435\u0440 - \u0421\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443.\r\n- **(en)** Marker - Change icon.\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/marker_change_icon.png?raw=true\r\n   :alt: Marker - Change icon\r\n\r\n- **(ru)** \u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435.\r\n- **(en)** Example route on the map.\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/example_route.png?raw=true\r\n   :alt: Example of the route\r\n\r\n- **(ru)** \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435.\r\n- **(en)** An example of the territory on the map.\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/example_territory.png?raw=true\r\n   :alt: Example of the territory\r\n\r\n\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043a\u0430\u0440\u0442\u0443 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u0430\u0439\u0442\u0430. ( *Display a map on the site page.* )\r\n----------------------------------------------------------------------\r\n\r\n\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d. ( Add to template. )::\r\n\r\n    {% load i18n static djeymtags %}\r\n\r\n    <head>\r\n      <meta charset=\"utf-8\">\r\n      <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui\">\r\n\r\n      <!-- START VENDORS CSS -->\r\n      <!-- Roboto Font:\r\n            Usage (css):\r\n              font-size: 16px;\r\n              font-family: Roboto, sans-serif !important;\r\n              font-weight: 100|300|400|500|700|900;\r\n              font-style: italic!important; -->\r\n      <link href=\"https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900\" rel=\"stylesheet\">\r\n      <!-- Material Design Icons:\r\n            url: https://materialdesignicons.com/\r\n            Usage (html):\r\n              <span class=\"mdi mdi-name\"></span>\r\n              Size: mdi-18px|mdi-24px|mdi-36px|mdi-48px or font-size: 16px;\r\n              Rotate: mdi-rotate-45|mdi-rotate-90|mdi-rotate-135|mdi-rotate-180|mdi-rotate-225|mdi-rotate-270|mdi-rotate-315\r\n              Flip: mdi-flip-h|mdi-flip-v\r\n              Color: mdi-light|mdi-light mdi-inactive|mdi-dark|mdi-dark mdi-inactive or color: #212121; -->\r\n      <link href=\"https://cdn.jsdelivr.net/npm/@mdi/font@7.x/css/materialdesignicons.min.css\" rel=\"stylesheet\">\r\n      <!-- END VENDORS CSS -->\r\n    </head>\r\n\r\n    <body>\r\n      <!-- START MAP -->\r\n      <!-- Buttons are optional.\r\n           (\u041a\u043d\u043e\u043f\u043a\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.) -->\r\n      <style type=\"text/css\">\r\n        .djeym-button {\r\n          font-family: Roboto, sans-serif !important;\r\n          background-color: #4CAF50;\r\n          border: none;\r\n          color: white;\r\n          padding: 10px 24px;\r\n          text-align: center;\r\n          text-decoration: none;\r\n          display: inline-block;\r\n          font-size: 16px;\r\n          margin: 4px 2px;\r\n          cursor: pointer;\r\n        }\r\n        .djeym-button-bar {\r\n          display: none;\r\n          margin-bottom: 10px;\r\n        }\r\n      </style>\r\n      <div class=\"djeym-button-bar\">\r\n        <button id=\"djeym-open-panel\" type=\"button\" class=\"djeym-button\">\r\n          <span class=\"mdi mdi-arrow-expand-right\"></span>\r\n          Open Panel\r\n        </button>\r\n        <button id=\"djeym-add-marker\" type=\"button\" class=\"djeym-button\">\r\n          <span class=\"mdi mdi-map-marker-plus\"></span>\r\n          Add Marker\r\n        </button>\r\n      </div>\r\n      <div id=\"djeym-app\" class=\"djeym\"></div>\r\n      <!-- END MAP -->\r\n\r\n      <!-- START VENDORS JS -->\r\n      <script type=\"text/javascript\" src=\"{% static \"djeym/js/jquery.min.js\" %}\"></script>\r\n      <script src=\"{% static \"djeym/js/jquery-regex.min.js\" %}\"></script>\r\n      ...\r\n      {% djeym_yandex_map slug='test-map' lang=request.LANGUAGE_CODE %}\r\n      <!-- END VENDORS JS -->\r\n    </body>\r\n\r\n\u041a\u0430\u0440\u0442\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u044c\u044e. ( *Map with open panel.* )\r\n----------------------------------------------------\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/map_opened_panel.png?raw=true\r\n    :alt: Map with open panel\r\n\r\n\u041a\u0430\u0440\u0442\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u043e\u0439 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432. ( *Map with an open form for adding custom markers.* )\r\n------------------------------------------------------------------------------------------------------------------------\r\n\r\n- **(ru)** \u0414\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438, \u0432\u0441\u0435 html \u0442\u0435\u0433\u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f.\r\n- **(en)** For security, in the title and description, all html tags are deleted.\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/map_opened_form.png?raw=true\r\n    :alt: Map with open form\r\n\r\n\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438. ( *Admin actions after successful moderation.* )\r\n------------------------------------------------------------------------------------------------------------------------\r\n\r\n.. image:: https://github.com/kebasyaty/django-editor-ymaps/blob/master/screenshots_v3/after_successful_moderation.png?raw=true\r\n    :alt: After successful moderation\r\n\r\n\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e \u043d\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043c\u0430\u0440\u043a\u0435\u0440\u0435. ( *Notification of a new custom marker.* )\r\n----------------------------------------------------------------------------------------\r\n\r\nAdd in views.py::\r\n\r\n    from django.core.mail import send_mail\r\n    from django.db.models.signals import post_save\r\n    from django.dispatch import receiver\r\n    from djeym.models import Placemark\r\n    \r\n    # SIMPLE EXAMPLE.\r\n    # 1. Notify administrator of a new custom marker.\r\n    # 2. Notify user about successful moderation of his marker.\r\n    # Mail server for testings: $ python -m smtpd -n -c DebuggingServer localhost:1025\r\n    @receiver(post_save, sender=Placemark)\r\n    def notify_email(instance, **kwargs):\r\n        \"\"\"Notify by email of a new custom marker.\"\"\"\r\n    \r\n        \"\"\"\r\n        # May come in handy. (\u041c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.)\r\n        title = instance.header  # (html)\r\n        description = instance.body  # (html)\r\n        image_url = instance.user_image.url\r\n        \"\"\"\r\n        # Notify administrator of a new custom marker.\r\n        if instance.is_user_marker and not instance.is_sended_admin_email:\r\n            subject = 'Text subject'\r\n            message = 'Text message - Url: ' + \\\r\n                'http(s)://your.domain/admin/djeym/placemark/{}/change/'.format(instance.pk)\r\n            from_email = 'admin@site.net'  # or corporate email\r\n            recipient_list = ['admin@site.net']  # Your work email\r\n            send_mail(subject, message, from_email,\r\n                      recipient_list, fail_silently=False)\r\n            # Required\r\n            instance.is_sended_admin_email = True\r\n            instance.save()\r\n        # Notify user about successful moderation of his marker.\r\n        elif instance.active and instance.is_user_marker and not instance.is_sended_user_email:\r\n            subject = 'Text subject'\r\n            message = 'Text message'\r\n            from_email = 'admin@site.net'  # Your work email\r\n            recipient_list = [instance.user_email]\r\n            send_mail(subject, message, from_email,\r\n                      recipient_list, fail_silently=False)\r\n            # Required\r\n            instance.is_sended_user_email = True\r\n            instance.save()\r\n\r\nLICENSE\r\n-------\r\n- `MIT License <https://github.com/kebasyaty/django-editor-ymaps/blob/master/LICENSE>`_\r\n- Copyright (c) 2014 kebasyaty\r\n\r\nCHANGELOG\r\n---------\r\n`View the change history. <https://github.com/kebasyaty/django-editor-ymaps/blob/master/CHANGELOG.rst>`_\r\n\r\n.. contents:: Contents\r\n   :depth: 3\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Creating and editing Yandex maps.",
    "version": "2.3.7",
    "project_urls": {
        "Download": "https://github.com/kebasyaty/django-editor-ymaps/tarball/master",
        "Homepage": "https://github.com/kebasyaty/django-editor-ymaps"
    },
    "split_keywords": [
        "django",
        "yandex",
        "maps",
        "admin",
        "editor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5988d2c48a9d1a5401af9abd9960272cb5568d6a8cb6034a89f5c1d7b51cf510",
                "md5": "a35bd5723a073310e4fce39d944f30ea",
                "sha256": "b0a33f91a8a77bd5c20b5c71b335450ff789d00dd691b95847936d4f332ddc19"
            },
            "downloads": -1,
            "filename": "django-editor-ymaps-2.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "a35bd5723a073310e4fce39d944f30ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 768227,
            "upload_time": "2023-10-04T11:37:52",
            "upload_time_iso_8601": "2023-10-04T11:37:52.659464Z",
            "url": "https://files.pythonhosted.org/packages/59/88/d2c48a9d1a5401af9abd9960272cb5568d6a8cb6034a89f5c1d7b51cf510/django-editor-ymaps-2.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-04 11:37:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kebasyaty",
    "github_project": "django-editor-ymaps",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "django-editor-ymaps"
}
        
Elapsed time: 0.13424s