Skip to main content

Django Server Config Generator

PyPI - Python Version PyPI - License

Django server config generator is a simple django extension which generates apache config by running a management command, It automatically detects document root, static root/url, media root/url, and also the path to the current running virtual environment.

Installation

$ pip install django-server-config-generator

Requirements

  • Python3.6+
  • Apache2.4

Usage

  • Add server_config_generator to the installed app in the settings file,
	INSTALLED_APPS = (
	# other apps
	"server_config_generator",
    )
  • Run python manage.py generate_apache_config,
	$ python manage.py generate_apache_config 
  • User will be prompted to enter the type of virtual hosting,
	Please enter name based or IP based hosting (name/ip):?
  • Enter a valid option and press 'Enter' key
  • Then the user will be prompted to enter the server name or the ip address based on the previous input,
	Enter the server name:

OR

	Enter your IP: 
  • Enter a valid server name or ip address
  • Then the user will be prompted to enter port number, default value for which will be 80,
	Enter the port (default:80):
  • Enter the required port number and press the 'Enter' key. In the case of the default value just press 'Enter' key
  • If STATIC_URL/STATIC_ROOT or MEDIA_URL/MEDIA_ROOT is not configured, then the user will be notified with a warning message and the system will wait for the user confirmation,
	Warning: Static root/url not configured
	Warning: Media root/url not configured

	 1. Press q to quit 
	 2. Press any key to continue 
  • Press 'Enter' key to continue, else press "q" and press 'Enter' key
  • Then the user will be prompted for https configuration,
	Do you want https ? 

 	 1. Press 'n' for no 
 	 2. Press any key to continue 
  • To configure https, user can press on any key else press 'n' and enter key on keyboard
  • Then the user will prompted of an automatic redirect from http to https
	Do you automatic http to https redirect?

	 1. Press 'n' for no 
 	 2. Press any key to continue
  • To configure autoredirect, user can press on any key else press 'n' and enter key on keyboard
  • User will be prompted to enter the path for certificate file
	Enter certificate path:
  • After specifying the path to the certificate file, user will be prompted to enter the path to the key file
	Enter certificate key path:
  • After specifying the path to the key file, user will be prompted to enter the path to the chain file
	Enter chain file path or press enter if no chain file
  • After entering the path to the chain file, user will be prompted to specify the https port
	Enter the port (default:443):
  • If a different port is in use than the default port, enter the port and press enter key
  • Verify the Apache config file generated in root folder with name as <your_projectname.conf>
  • Copy the the conf file to the Apache site-available folder
  • Run configtest command
  • Enable the site
  • Reload Apache

Communication

  • If you find a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Author

Afsal Salim, afsals@qburst.com

License

Django Server Config Generator is available under the MIT license. See the LICENSE file for more info.

Metadata

Release files for django-server-config-generator 1.0.0

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-server-config-generator 1.0.0
File Size Uploaded Provenance
django-server-config-generator-1.0.0.tar.gz 7.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-server-config-generator 1.0.0
File Interpreter ABI Platform
django_server_config_generator-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / django-server-config-generator-1.0.0.tar.gz

Download URL django-server-config-generator-1.0.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3a34f530d0c2f246272c1f57fa23f5ed7f3ff43143f20c841da7854dc5e61ef7
BLAKE2b-256 checksum
How to use checksums
a3751c57779480eb604e4d15a9118fa6749c8b848ef71eb1bce1e29ecdc93d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

Release files / django_server_config_generator-1.0.0-py3-none-any.whl

Download URL django_server_config_generator-1.0.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46f03c441488c41ed49e9d63f51ba7704949b2ad75c0b50a2570b3f3752246b6
BLAKE2b-256 checksum
How to use checksums
a57a207465cb562dac73cf02ac7541c192659f63d5440ba9a7a57bd7b60a9439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

Security for django-server-config-generator 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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