#360 closed defect (fixed)
[PATCH] django-admin.py runserver only takes a port when it could also take an ip:port
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently django-admin.py's runserver command can only take a port number and will always use 127.0.0.1 as the bind address. This patch allows an IP address to be specified by passing <ip address>:<port> instead of just <port>.
Attachments (4)
Change History (10)
by , 19 years ago
Attachment: | django-server-addr.diff added |
---|
by , 19 years ago
Attachment: | django-server-addr.2.diff added |
---|
Fixed version (fixes up empty addr string)
comment:1 by , 19 years ago
Thanks for this patch.
Before we roll it in, I have a question: What's the use-case for this? Why would somebody need to run the development server (which should NOT be run on a production site) on a separate IP address?
comment:2 by , 19 years ago
Here's a use case: you are running the development server on a machine which has a public internet facing IP address and another address that is only visible to your network. You would want the development server to face internally only. This isn't that unlikely in a small development shop where the dev box might double up as the office router.
comment:3 by , 19 years ago
Status: | new → assigned |
---|
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 by , 19 years ago
In my case, this patch makes the the server refuse remote connections if I don't explicitly indicate the public interface IP. E.g., I have to use:
$ django-admin.py runserver 192.168.1.4:8000
Changing line 550 in core/management.py (http://code.djangoproject.com/file/django/trunk/django/core/management.py?rev=539) to just addr = ''
fixes this.
by , 19 years ago
Attachment: | dj360_539.diff added |
---|
Don't explicitly specify the binding address for the server
by , 19 years ago
Attachment: | dj360_539.2.diff added |
---|
Don't explicitly specify the binding address for the server (second try)
comment:6 by , 18 years ago
another use case: I'm developing on a virtual machine with a minimal installation and connecting from my real one to test. I applied the same change as in dj360_539.2.diff by myself, because it is so much easier to work that way.
Patch to add ip:port as well as port argument to runserver.