Simple classes related to the django sites framework for clinicedc projects.
Project description
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file edc_sites-0.1.14-py3-none-any.whl.
File metadata
- Download URL: edc_sites-0.1.14-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edfcc9c5017f830f6de1a05b81e5a440f6f49f46d293fcae06ffaeb2d804faa4
|
|
| MD5 |
476bd39f4f12975cf9420a65b2e27956
|
|
| BLAKE2b-256 |
f267bc2c8dba75673f4623dfd446fd5e4b179742794b2684e1f8af4f0f80374b
|