getting-things-gnome / GTGOnline

An Online Application for Getting Things Gnome!
21 stars 7 forks source link

Help: Run as a daemon? #14

Closed gangelop closed 10 years ago

gangelop commented 10 years ago

Hello. I've just set up GTGOnline with a simple sqlite3 backend. This might be a silly question since I'm unfamiliar with django but...

How do I run this as a daemon, in the background, on boot, like a proper service?

This is a general question but I'm currently setting this up on ubuntu 14.04

parinporecha commented 10 years ago

I found a ticket for this on Django's bugzilla which they have closed as 'wontfix'. The developers' opinion is that the development server isn't robust enough to be run as a daemon.

But if you want to run it in the background, there are ways for that. Found 2 relevant answers on SO -

To start the server on boot, you can add it to the 'reboot' entry of Cron scheduler, or just add it to the list of 'Startup Applications'.

gangelop commented 10 years ago

I'm already running apache and wsgi on this server for another application, so it looks like this is the way to go for this case. Thnx for the quick reply!

EDIT: I'll try to update this issue when I figure out how to set it up with apache and wsgi.

izidormatusov commented 10 years ago

The way how Django apps are deployed is that you put Django behind either uWSGI or gunicorn. To make it really fast, you put in front of it nginx that can serve static files really quickly. Description of that architecture: http://rogueleaderr.com/post/65157477648/the-idiomatic-guide-to-deploying-django-in-production (You can replace nginx with apache and get the same result :)

Or you can us ea service that is going to solve all of those problems for you like Google App Engine or Heroku.