Home

runserver

Runserver is a Django management command that starts a lightweight web server for a Django project. It is intended for development and testing rather than production deployment, providing a quick way to run and test code locally without configuring a full production stack. The server serves the Django application over HTTP and is typically invoked via the project’s manage.py script.

Usage and syntax commonly involve running a command such as python manage.py runserver, optionally followed by

Key features include development-friendly behavior such as automatic reloading and a simple static file handling workflow

Limitations and deployment considerations: runserver is not designed for production use. It lacks the robustness, security,

an
address
and
port.
By
default
it
binds
to
127.0.0.1
on
port
8000,
accessible
at
http://127.0.0.1:8000/.
A
developer
can
specify
a
custom
address
and
port,
for
example
python
manage.py
runserver
0.0.0.0:8000
to
listen
on
all
interfaces.
The
command
automatically
reloads
the
code
when
files
change,
and
it
can
be
stopped
with
Ctrl-C.
during
DEBUG
mode.
Options
commonly
encountered
with
runserver
include
--noreload
to
disable
auto-reloading,
--nothread
to
run
in
a
single-threaded
mode,
--nostatic
to
disable
built-in
static
file
serving,
and
--insecure
to
serve
static
files
when
DEBUG
is
False.
Additional
Django
management
options,
such
as
--settings
or
--pythonpath,
can
also
be
used
to
customize
the
running
environment.
and
performance
characteristics
required
for
publicly
accessible
sites.
For
production
deployments,
Django
projects
are
typically
served
by
a
WSGI
server
(e.g.,
Gunicorn
or
uWSGI)
behind
a
reverse
proxy
such
as
Nginx
or
Apache.