{ "info": { "author": "Micha\u0142 Pasternak", "author_email": "michal.dtz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.7" ], "description": "django-reciprocity\n==================\n\n.. image:: https://travis-ci.org/mpasternak/django-reciprocity.svg?branch=develop\n :target: https://travis-ci.org/mpasternak/django-reciprocity\n\nTo make a long story short, read description of `django-nginx-push-stream`_ . This is\na bit higher level, than `django-nginx-push-stream`_ - it is an implementation of an\ninteractive web UI in JavaScript (based on jQuery and Foundation 6) and Python (Django).\nIt sits on top of ``nginx-push-stream``.\n\n.. _django-nginx-push-stream: http://github.com/mpasternak/django-nginx-push-stream\n\nRunning the demo\n----------------\n\nnginx and rabbitmq\n~~~~~~~~~~~~~~~~~~\n\nRun the nginx with http-push-stream module. You can run it locally (see `django-nginx-push-stream`_ docs),\nyou can run it using included image. In this repo's root dir:\n\n.. code-block:: shell\n\n docker-compose up webserver rabbitmq\n\nThis will boot a container running nginx with HTTP-push-stream module and a RabbitMQ node.\n\nThis nginx server is a proxy to a service running on your local machine (it loops back to\n``docker.host.internal`` port 8080). It listens by default on port 9080. If you ever need to\nchange this port, make sure to adjust variables ``NGINX_PUSH_STREAM_PUB_PORT`` and\n``NGINX_PUSH_STREAM_SUB_PORT`` defined in ``test_project.settings``.\n\nCelery container defined in that compose file listens by default on port 45672. If you want\nto change it, please make sure to adjust variable ``CELERY_BROKER_URL`` in\n``test_project.settings``.\n\nThere may be more containers defined in the ``docker-compose.yml`` file. They're utilized\nfor tests and may take more time to download, so that's why it is good to specify which\ncontainers to start when running ``docker-compose``. \n\nSet-up test_project with requirements\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFrom the root directory of the repo, please:\n\n.. code-block:: shell\n\n cd test_project\n yarn\n pip install -r requirements.txt\n export PYTHONPATH=..\n python manage.py migrate\n\n\ncelery\n~~~~~~\n\nIt's time to launch our background worker, that will handle long-running tasks.\n\n.. code-block:: shell\n\n celery worker -A test_project.celery -E -l INFO\n\nCelery should say something about our transport being \"amqp://guest:**@localhost:45672//\". The port\nshould match the port used in docker-compose container.\n\nDjango\n~~~~~~\n\nNow, launch another terminal window and boot up your Django part of the deal.\nIt is IMPORTANT to run the sever listening on all interfaces of your host,\nso Nginx from Docker image will be able to proxy requests to it:\n\n.. code-block:: shell\n\n cd test_project\n export PYTHONPATH=..\n python manage.py runserver 0.0.0.0:8080\n\nTesting\n~~~~~~~\n\nGo to http://localhost:9080/ to see your stack in action. Click the link,\nas web page says, to launch long running task, as defined in ``test_app.tasks`` module. The\nweb page will pass its UUID to the long running task and in turn the task will be able\nto notify the web page about its progress.\n\nWhere to go now?\n~~~~~~~~~~~~~~~~\n\nYou can try the commands, described below in the \"Command-line interface\" section.\n\n\nCommand-line interface\n----------------------\n\nDifferent channels\n~~~~~~~~~~~~~~~~~~\n\nSend a message to all users:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"callout\", \"header\": \"Nice optional title.\", \"body\": \"Just a message.\", \"class\": \"success\"}'\n\nSend a message to all authorised (logged-in) users:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __authorized__ -d '{\"type\": \"callout\", \"header\": \"Nice optional title.\", \"body\": \"Just a message.\", \"class\": \"success\"}'\n\nSend a message to a specific session:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __session__SESSION-ID -d '{\"type\": \"callout\", \"header\": \"Nice optional title.\", \"body\": \"Just a message.\", \"class\": \"success\"}'\n\nSend a message to a specific web page:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __uuid__WEB-PAGE-UUID4 -d '{\"type\": \"callout\", \"header\": \"Nice optional title.\", \"body\": \"Just a message.\", \"class\": \"success\"}'\n\nCommand-line interface\n~~~~~~~~~~~~~~~~~~~~~~\n\nSend a message (callout) to all web browsers:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"callout\", \"header\": \"Nice optional title.\", \"body\": \"Just a message.\", \"class\": \"success\"}'\n\nSend a clickable message to all web browsers:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"callout-with-link\", \"href\": \"http://www.onet.pl\", \"header\": \"\", \"body\": \"Processing has finished. Please click this link to access report. \", \"class\": \"success\"}'\n\nMake all web browsers visit a different web page:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"goto-page\", \"href\": \"http://www.onet.pl\"}'\n\nShow a modal dialog:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"modal-dialog\", \"header\": \"http://www.onet.pl\", \"lead\": \"lead\", \"paragraph\": \"paragraphs\"}'\n\nClose a previously shown modal dialog:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\":\"close-modal-dialog\"}'\n\nShow a please-wait dialog:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"please-wait-dialog\", \"header\": \"Please wait patiently...\", \"lead\": \"The server is working\", \"paragraph\": \"After the operation is complete, the page will refresh.\"}'\n\n\nClose a please-wait dialog:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\":\"close-please-wait-dialog\"}'\n\n\nReplace HTML of a given jQuery selector:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"html\", \"selector\": \"body\", \"value\": \"LOL\"}'\n\nExecute JavaScript via eval:\n\n.. code-block:: shell\n\n python manage.py publish_message -q __all__ -d '{\"type\": \"eval\", \"value\": \"console.log(123);\"}'\n\n\n\n0.0.1\n-----\n* first public release\n \n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mpasternak/django-reciprocity", "keywords": "", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "django_reciprocity", "package_url": "https://pypi.org/project/django_reciprocity/", "platform": "", "project_url": "https://pypi.org/project/django_reciprocity/", "project_urls": { "Homepage": "https://github.com/mpasternak/django-reciprocity" }, "release_url": "https://pypi.org/project/django_reciprocity/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Interactive web apps with Django", "version": "0.0.1" }, "last_serial": 4829787, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a067b17e26daadfc457df0954d70f11b", "sha256": "dc1cbf9b493b8cb4f2ebc3361c949ed1847f19d6e423f26c2dd6b792cdb39404" }, "downloads": -1, "filename": "django_reciprocity-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a067b17e26daadfc457df0954d70f11b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 52828, "upload_time": "2019-02-16T21:36:59", "url": "https://files.pythonhosted.org/packages/89/c8/7b6e5ca20c0f4a739601a84394c178fd8c2a500edf2b5b5306c77ecba671/django_reciprocity-0.0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a067b17e26daadfc457df0954d70f11b", "sha256": "dc1cbf9b493b8cb4f2ebc3361c949ed1847f19d6e423f26c2dd6b792cdb39404" }, "downloads": -1, "filename": "django_reciprocity-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a067b17e26daadfc457df0954d70f11b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 52828, "upload_time": "2019-02-16T21:36:59", "url": "https://files.pythonhosted.org/packages/89/c8/7b6e5ca20c0f4a739601a84394c178fd8c2a500edf2b5b5306c77ecba671/django_reciprocity-0.0.1-py3-none-any.whl" } ] }