If you’re building a Django web or mobile app, you can easily include real-time notifications by using the SwampDragon package.

SwampDragon: Real-Time Notifications for your Django App

Modern websites must include real-time notifications. Facebook, LinkedIn, and Gmail are classic examples. But many smaller business websites and apps use notifications to improve user interaction.

If you’re building a Django web or mobile app, you can easily include real-time notifications by using the SwampDragon package. 

 

About SwampDragon

According to its developers, “SwampDragon is a pub/sub solution running on top of Tornado, and is compatible with Django models.”

They go on to state that “it allows data to be published to channels via routers and does all the heavy lifting.“

These are the main feature of SwampDragon:

    • Real-time data

    • Self-publishing model

    • Serializers handling Django models

    • Customisable field serializers

    • Routers easy to understand

    • Angular JS support

    • Query style data subscriptions

    • Easy to implement in existing Django projects

 

Requirements

SwampDragon makes use of Django’s ORM, Tornados WebSocket support (with fallback), and Redis.

Installation

The first step is to install the SwampDragon package:

    pip install swampdragon

Now you can create your own project.

 

New Project

To create a new project, you should run:

    dragon-admin startproject notifications

    cd notifications

    django-admin.py startapp demo

The next step is to add demo to the INSTALLED_APPS. After that, you should open the  notifications/settings.py file in your preferred text editor and include the lines:

    STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')

 

    MEDIA_URL = '/media/'

    MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

 

    # Additional locations of static files

    STATICFILES_DIRS = [

        os.path.join(BASE_DIR, 'static'),

    ]

 

    TEMPLATE_DIRS = [

        os.path.join(BASE_DIR, 'templates')

]

 

And that’s all! The next step will depend on what you want to do. If you’re at a lost, you should check out SwampDragon’s documentation.

How to Comply With EU Cookie Law in Django Projects

Using Django and need to comply with the EU law about cookies? We've got you covered, with a simple 6-step guide about it!

Read more

Why We Document Our Django Projects With Django Rest Swagger

As a software developer, you understand how essential good API documentation is. Django Rest Swagger does most of the work for us!

Read more
Cookies disclaimer

I agree Our site saves small pieces of text information (cookies) on your device in order to deliver better content and for statistical purposes. You can disable the usage of cookies by changing the settings of your browser. By browsing our website without changing the browser settings you grant us permission to store that information on your device.