Skip to main content

A helper for switching between test and production versions of a service module

Project description


A helper for switching between test and production versions of a service


Lets you easily switch between versions of a service based on a Django setting entry. Good for situations where you want to use different versions between production and development and/or test. In the client code you might use: from . import my_service which might go to either .services.MyService or .services.MyFakeService depending on the content of your settings.


Construct your service as a class whose init takes no arguments.


class MyService:
    def __init__(self):
    def hello(self):
        print("hello world")

Declare the service.


from lazy_services import LazyService
my_service = LazyService("MY_SERVICE")

Select the service.



Use the service.

from . import my_serivce

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-lazy-services-0.0.2.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

django_lazy_services-0.0.2-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page