Skip to main content

Simple classes related to the django sites framework for clinicedc projects.

Project description

pypi travis codecov downloads

edc-sites

Site definitions to work with Django’s Sites Framework.

Define a sites.py. This is usually in a separate project module. For example, for project meta there is a module meta_sites that contains a sites.py.

# sites.py

fqdn = "meta.clinicedc.org"

meta_sites = (
    (1, "reviewer", ""),
    (10, "hindu_mandal", "Hindu Mandal Hospital"),
    (20, "amana", "Amana Hospital"),
)

Register a post_migrate signal in apps.py to update the django model Site and the EDC model SiteProfile on the next migration:

# apps.py

from .sites import meta_sites, fqdn

def post_migrate_update_sites(sender=None, **kwargs):
    from edc_sites.add_or_update_django_sites import add_or_update_django_sites

    sys.stdout.write(style.MIGRATE_HEADING("Updating sites:\n"))
    add_or_update_django_sites(
        apps=django_apps, sites=meta_sites, fqdn=fqdn, verbose=True
    )
    sys.stdout.write("Done.\n")
    sys.stdout.flush()

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

edc_sites-0.1.16-py3-none-any.whl (22.5 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