Skip to main content

A tool for helping with override Django configs.

django_confighelper on its own creates a config for the current django instance based on the current hostname, the current name of the effective uid and the current directory in which the django instance is sitting:

config/hostname/euidname__dirname.py

If the config already exists django_confighelper exits with a warning.

The ‘edit’ subcommand attempts to start a system editor on the config. It first tries the environment variable $EDITOR and then switches to “editor” from the execution path.

The ‘print’ subcommand prints the filename of the config file. This is so you can script further interactions, for example:

echo “CONFIG_SPECIAL=True” >> $(django_confighelper print)

The ‘default’ subcommand looks for a default config file in config/defaults/$user.py and if it exists, it creates a config using the values contained there in. It opens the newly created file just in case you need to change some values - like FRONTEND_PORT e.t.c

The ‘printval’ subcommand prints the value of a DJANGO config setting after the config has been applied. For example:

django_confighelper printval DATABASE_HOST

prints out the setting of the database host.

The ‘updatesettings’ subcommand appends the contents of configdir/templates.py to the end of the settings.py in the current directory. This is required to be run once (and once only), and simply adds some import statements to handle the additional import of per-instance settings files.

The ‘cat’ subcommands outputs the contents of the instance specific config file (i.e. config/hostname/euidname__dirname.py)

The ‘dir’ subcommand outputs the evaluated values of all settings managed by django_confighelper.

confignginx is also included. This is a management command you can use to generate Nginx configs from your Django app.

./manage.py confignginx –port=8100 –domain=www.example.com

will generare an nginx config that will proxy requests to the port but send all static data to the STATIC_ROOT via the STATIC_URL.

Metadata

Release files for django_configdir 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django_configdir 0.1.10
File Size Uploaded
django_configdir-0.1.10.tar.gz 6.5 kB Details

Release files / django_configdir-0.1.10.tar.gz

Download URL django_configdir-0.1.10.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5cc51ba73e9d060869866a73e8e3ce54f551f9ed116d4de60bd5fe4486c619ba
BLAKE2b-256 checksum
How to use checksums
f21e943d8d5833805380f8e49a3214718e06bab894af2e54e6eaea65122edb8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.10 This release

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page