/chapushillo

Example of using Pusher Channels with Asyncio and FastAPI

Primary LanguagePythonMIT LicenseMIT

Overview

This is the PoC for SaaS Realtime notifications concept, written in async Python (3.6+).

SaaS: Pusher Channels

API: FastAPI

Testing

  1. Create the Channels application in Pusher
  2. Create and activate virtual environment
  3. Set credentials in crm/index.html
    const pusherKey = "__PUSHER_KEY__";  // smth like 08fae1e0be54746e9270
    const pusherCluster = "eu";
  1. cd events
  2. Install requirements requirements.txt
  3. Create .env based on .env.tpl with credentials from your Pusher application, PUSHER_MASTER_KEY must be manually generated (f.e. openssl rand -base64 32)
  4. Start HTTP server: uvicorn api:app --reload
  5. Open crm/index.html in your favorite browser
  6. Run events generator python event.py
  7. Enjoy received messages in the tab of your browser!

Troubleshooting

MacOS SSL issues