Skip to main content

A Django command to run a development server with custom settings.

Project description

django-rundevserver

PyPI version

A simple Django addon to provide a new management command which runs a development server with custom host/port set in the applications settings.py file. You can also set the DEBUG variable here, allowing the default setting to be False for production.

Installation

Install the addon using pip:

pip install django-rundevserver

OR, if you have forked this repository to your local machine, you can build the package using the following steps:

pip install -r requirements.txt
python setup.py sdist
pip install dist/django-rundevserver-0.3.tar.gz

This implies your Python and Pip commands are as above, substitute your own versions if different.

Usage

Add this app to your Django settings.py INSTALLED_APPS like any other:

INSTALLED_APPS = [
        ...
        'rundevserver',
    ]

Now, just use rundevserver instead of runserver:

python manage.py rundevserver

By default, this will function exactly as the standard runserver except it automatically enables the DEBUG setting. In this way, you can leave DEBUG=False in your main settings.py file so it is correct for production, but during development or debugging it will be set to True.

Configuration variables are set in the project settings.py and current accepted values are as below. If all of these are unspecified, rundevserver will function exactly as runserver (except for the aforementioned DEBUG setting!):

# Chose which port to listen to, defaults to 8000 if unspecified
RDS_PORT = 8001

# Listen on all interfaces (ie 0.0.0.0) if true. Otherwise (or if unspecified),
# it will use the standard 127.0.0.1.
RDS_ALL_INTERFACES = True

# Force DEBUG mode if True OR unspecified. If you dont want DEBUG set in
# development for some reason, specifiy False here
RDS_DEBUG = True

RDS_ALL_INTERFACES is very useful if you are developing on a remote machine where the default runserver localhost would not let you connect.

Todo

  • Add documentation
  • Add Tests

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-rundevserver-0.3.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_rundevserver-0.3.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file django-rundevserver-0.3.1.tar.gz.

File metadata

  • Download URL: django-rundevserver-0.3.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for django-rundevserver-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c79bb0c55b05e04b1be8c0bfd01849835a7f0126424a0fbe20fb22ff102dc4b3
MD5 0eb089520591b2a646fae522af9405b6
BLAKE2b-256 03f17821570e11788a17fb72e5763945f263c1bc69685592c2a1765d2275dd96

See more details on using hashes here.

File details

Details for the file django_rundevserver-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: django_rundevserver-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for django_rundevserver-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6225e3c1aed0c07af96de8a599185c04987bc96fd0dfd54b72abed13292ef017
MD5 071da171ecd531292ea46acbcc1ae4e3
BLAKE2b-256 e5cc7836daf4a1cd854537897b6b38a1f620edd15a714db4606dd2ec5f034a18

See more details on using hashes here.

Supported by

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