Commits

Louis Opter  committed 60d0dfe

Activate celery events, launch celerycam and use a PostgreSQL database to make the Celery Djang Admin Monitor working

  • Participants
  • Parent commits d1d7a3d

Comments (0)

Files changed (3)

File dotcloud.yml

 
 workers:
     type: python-worker
+
+db:
+    type: postgresql

File minestrone/settings.py

 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': '/home/dotcloud/data/dev.sqlite3',  # Or path to database file if using sqlite3.
-        'USER': '',                      # Not used with sqlite3.
-        'PASSWORD': '',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',
+        'NAME': 'template1',
+        'USER': dotcloud_env['DOTCLOUD_DB_SQL_LOGIN'],
+        'PASSWORD': dotcloud_env['DOTCLOUD_DB_SQL_PASSWORD'],
+        'HOST': dotcloud_env['DOTCLOUD_DB_SQL_HOST'],
+        'PORT': int(dotcloud_env['DOTCLOUD_DB_SQL_PORT']),
     }
 }
 
     cat > $HOME/current/supervisord.conf << EOF
 [program:djcelery]
 directory = $HOME/current/
-command = python minestrone/manage.py celeryd -l info -c 2
+command = python minestrone/manage.py celeryd -E -l info -c 2
+stderr_logfile = /var/log/supervisor/%(program_name)s_error.log
+stdout_logfile = /var/log/supervisor/%(program_name)s.log
+
+[program:celerycam]
+directory = $HOME/current/
+command = python minestrone/manage.py celerycam
 stderr_logfile = /var/log/supervisor/%(program_name)s_error.log
 stdout_logfile = /var/log/supervisor/%(program_name)s.log
 EOF