Git Product home page Git Product logo

django-rundevserver's Introduction

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.1.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

django-rundevserver's People

Contributors

seapagan avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.