Django

Code

Ticket #4996 (closed: wontfix)

Opened 3 years ago

Last modified 2 years ago

runserver as daemon

Reported by: Charlie La Mothe <charlie@clamothe.com> Assigned to: nobody
Milestone: Component: django-admin.py runserver
Version: SVN Keywords: daemonize development server runserver
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Adds --daemonize option to runserver.

Simply adding a '&' to the end of a runserver call isn't enough.. it will kill the process when you log out of the shell. So I created this patch, which utilizes django.utils.become_daemon

Attachments

patch.diff (2.4 kB) - added by Charlie La Mothe <charlie@clamothe.com> on 07/27/07 19:22:24.
patch.2.diff (2.6 kB) - added by Charlie La Mothe <charlie@clamothe.com> on 07/28/07 18:21:37.

Change History

07/27/07 19:22:24 changed by Charlie La Mothe <charlie@clamothe.com>

  • attachment patch.diff added.

07/28/07 00:26:13 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch set to 1.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs set to 1.

Looks good, but the help_text message (line #1587) needs to be updated, and it'll need a brief line or two in the django-admin docs (django-admin.txt)

07/28/07 18:20:50 changed by Charlie La Mothe <charlie@clamothe.com>

  • needs_better_patch deleted.
  • needs_docs deleted.

Oh wow, right, can't believe I didn't change the help_text :P

Here is a fixed patch, and it's updated for the latest revision of management.py as well.

07/28/07 18:21:37 changed by Charlie La Mothe <charlie@clamothe.com>

  • attachment patch.2.diff added.

07/28/07 19:27:43 changed by mtredinnick

The development server isn't robust enough to be run as a daemon (for example, there are a few ways to cause errors that will crash it). Something like this would be promoting false expectations, I feel. It's simply not designed to be used like this. I'm -1 on including this at the moment.

07/28/07 19:27:52 changed by mtredinnick

  • stage changed from Accepted to Design decision needed.

07/28/07 19:52:04 changed by Charlie La Mothe <charlie@clamothe.com>

I'm using the development server with lighttpd (through mod_proxy) for development on my production server. I run a seperate codebase for production, using scgi. When I update some code here in my TextMate, I commit to the development branch, then my server automatically updates the development branch on the server, and the development server reloads the site.

Now you can see how daemonizing it can be handy... doing a runserver every time I want to use the dev server isn't something I want to do, when I'm using the dev server very often.

I see how this could lead to false expections, although as far as I know, the server as a daemon is just as robust as the server running in a shell.

So if this doesn't get incorporated, no big deal, but I hope you can see why I use this and why I'll probably add it myself to every django install I use on a remote server.

06/18/08 21:24:02 changed by cgrady

+1 here, I always leave runserver in the background for a few projects I tool around with regularly, so I can edit/reload easier, and it would be nice if you could daemonize it automatically (preferably with a pid file like runfcgi as well)

06/18/08 22:13:45 changed by jacob

  • status changed from new to closed.
  • resolution set to wontfix.

The development server isn't a real server. Letting it in the backround will just encourage its use that way, which we don't at all want. There's enough ways to daemonize something -- daemontools is my personal favorite -- if folks insist. This shouldn't be part of Django, though.


Add/Change #4996 (runserver as daemon)




Change Properties
Action