Skip to main content

Реинкарнация интеграции фреймворка Django с сервисом sape.ru. За основу были взяты идеи проекта на https://github.com/Dimmma/sape и его форка(https://github.com/fedosov/sape).

Данное приложение ориентировано исключительно на работу с Python 3. Причиной его создания послужила работа по миграции одного “пожилого” сайта с PHP на Python.

Установка

pip install django-sape3

или

pip install git+https://github.com/dalay/django-sape3.git

Настройка

settings.py

INSTALLED_APPS = (
    ...
    'sape',
)
# SAPE.RU
# Обязательные настройки
SAPE_DOMAIN = 'example.com'
SAPE_USER = 'sape_username'
# Остальные настройки
SAPE_SHOW_CODE = False # Показывать или нет проверочный код sape
                       # (при добавлении страниц сайте в сервис).
SAPE_CHARSET = 'utf8' # Кодировка сайта
SAPE_DIR = '/tmp/sape_cache/' # Где будет храниться файл,
                              # содержащий полученные с sape ссылки.

Шаблоны

Общее использование

{% load sape %}
...
{% sape_links %}
или так, если нужен заголовок для блока с ссылками
{% sape_links 'Заголовок блока ссылок' %}

Встроенные базовые шаблоны приложения

Родительский шаблон с кодом блока ссылок.

sape/block.hml

Дочерний шаблон вывода для конкретно ссылок.

sape/links.html

Обновление ссылочной базы

Получение ссылок для сайта с сервера sape.ru

./manage.py sape update

Metadata

Release files for django-sape3 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sape3 0.2
File Size Uploaded Provenance Actions
django-sape3-0.2.tar.gz 5.1 kB Without provenance Details for django-sape3-0.2.tar.gz

Release files / django-sape3-0.2.tar.gz

Download URL django-sape3-0.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3f78d1a4cd316b3e332eac4b291e2a749a2152aab74b2d889474c057fc34660c
BLAKE2b-256 checksum
How to use checksums
9a10dc4833029936cc538340aba1218e8a85c4706c2b6ec0e167ceba6acad2fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-sape3 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page