Catalog PyPI
PACKAGE EXPLORERView in registry

accordsync-django

PyPI

Accord sync server for Django: app, URLs and management commands.

crdtlocal-firstoffline-firstsync
Versions collected1
Direct dependencies2From release 0.3.2
Last observed20 Oct, 18:00 UTC

README

Version 0.3.2 documentation

accordsync-django

The Accord sync server for Django: an app with the /v1/push, /v1/pull and /health URLs, management commands accord_migrate and accord_compact, and a system check. All behaviour comes from accordsync-server; this package only routes to it. Part of Accord.

Install

pip install accordsync-django

Configure

# settings.py
INSTALLED_APPS = [..., "accordsync_django"]
ACCORD_SERVER = "myapp.sync:server"  # a ServerDefinition made with define_server(...)
ACCORD_DATABASE_URL = "postgresql://..."  # optional, see below
ACCORD_POOL_SIZE = 20  # optional
ACCORD_SCHEDULE_COMPACTION = True  # optional

# urls.py
urlpatterns = [path("sync/", include("accordsync_django.urls")), ...]

The database is ACCORD_DATABASE_URL (setting, else environment variable), or else the default database's settings, which must then use django.db.backends.postgresql. The sync server uses its own psycopg connection pool, opened on the first request, never Django's ORM connections. The views are CSRF-exempt, opt out of ATOMIC_REQUESTS, and need no session or auth middleware (requests authenticate with the JWT in Authorization).

manage.py check reports accordsync.E001 when ACCORD_SERVER is missing, cannot be imported or is not a ServerDefinition, and accordsync.E002 when no PostgreSQL database is configured.

python manage.py accord_migrate

Compaction

With compaction.interval_ms > 0 in the definition (default one hour), each process compacts on that interval in a background thread started by its first sync request. With several worker processes, set ACCORD_SCHEDULE_COMPACTION = False and run from cron:

python manage.py accord_compact

Notes

  • Serve with a threaded WSGI server (e.g. waitress, gunicorn --threads); each request holds a thread while it waits on PostgreSQL.
  • Rate limits are per process (in memory).
  • examples/django_app in this repository serves the conformance profile with waitress and passes the shared server conformance suite (68/68). Its control API is for tests only (ACCORD_CONTROL=1).

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.28 Oct 20262

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
crossben/accordsync-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:00 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:f8a62ac7442da12cd4e0cddf1066c8dae0ba6234857d9c2cedda9f63591bdd71