Skip to content

Instantly share code, notes, and snippets.

@Alexx-G
Alexx-G / sitemaps.py
Last active February 26, 2016 11:38
Helper for autodiscovering of sitemaps modules based on Django's sitemap
# app/sitemaps.py
'''
Example of sitemaps module for a list of products.
For more info about sitemaps check out django docs
https://docs.djangoproject.com/en/stable/ref/contrib/sitemaps/
'''
from django.contrib.sitemaps import Sitemap
from .models import Product
@Alexx-G
Alexx-G / notification_clients.py
Created October 31, 2016 14:23
Interchangeable clients for sending notifications (in context of a Django app)
'''
This module contains interchangeable clients for sending notifications.
Use cases for those helpers:
- send notifications using a common interface;
- change the client in a transparent way (based on settings);
'''
from __future__ import unicode_literals
import logging