Anonymous avatar Anonymous committed cc05de3

Supervisor

Comments (0)

Files changed (7)

+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+from __future__ import with_statement
+from fabric.api import *
+from fabric.contrib.console import confirm
+from fabric.colors import *
+from datetime import datetime as _date
+from project.settings import *
+
+def start():
+    with prefix(' cd %s' % ROOT_PATH):
+        with prefix('workon %s' % PROJECT_NAME):
+            local('python manage.py supervisor')

frontend/templates/home.html

 
     <div class='main-box'>
         <div class='home-initial-text'>
+        
+        <h1>Django application template</h1>
+        By <a href="http://twitter.com/eduherraiz">@eduherraiz</a>
+        
         </div>
 
         <div id="social">

frontend/views.py

             from_email = form.cleaned_data['sender']
             from_name = form.cleaned_data['name']
             to = settings.CONTACT_EMAIL
-            msg = EmailMessage(subject, html_content, from_email, [to])
+            msg = EmailMessage(subject, html_content, to, [to])
             msg.content_subtype = "html"  # Main content is now text/html
             msg.send()
             sended = True

project/settings.py

 # -*- coding: utf-8 -*-
 from os.path import abspath, dirname, basename, join
+from unipath import Path
 from django.utils.translation import ugettext_lazy
 from django.utils.translation import string_concat
 from datetime import timedelta
     }
 }
 
-ROOT_PATH = abspath(dirname(__file__))
+#ROOT_PATH = abspath(dirname(__file__))
+ROOT_PATH = Path(__file__).ancestor(2)
 PROJECT_NAME = basename(ROOT_PATH)
 
 LANGUAGES = (
 #CELERY_IMPORTS = ("tasks", )
 
 
-#EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
+EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
 #EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
-EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 #EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
 #EMAIL_FILE_PATH = '/tmp/app-messages' # change this to a proper location
 
     url(r'^robots\.txt$', lambda r: HttpResponse("", mimetype="text/plain")),
     url(r'', include('frontend.urls')),
     url(r'', include('social_auth.urls')),
-#    url(r'^accounts/', include('registration.backends.default.urls')),
+    url(r'^accounts/', include('registration.backends.default.urls')),
     url(r'^admin/', include(admin.site.urls)),
 )
+[program:webserver]
+command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py runserver --noreload
+
+[program:celeryd]
+command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py celeryd -l info 
+2013-03-27 15:59:35,100 INFO RPC interface 'supervisor' initialized
+2013-03-27 15:59:35,101 INFO supervisord started with pid 22815
+2013-03-27 15:59:36,104 INFO spawned: 'autoreload' with pid 22824
+2013-03-27 15:59:36,106 INFO spawned: 'celeryd' with pid 22825
+2013-03-27 15:59:36,110 INFO spawned: 'webserver' with pid 22826
+2013-03-27 15:59:36,380 DEBG 'celeryd' stdout output:
+/home/edu/virtualenvs/proyecto/local/lib/python2.7/site-packages/celery/utils/__init__.py:73: CPendingDeprecationWarning: 
+    The 'BROKER_VHOST' setting is scheduled for deprecation in     version 2.5 and removal in version v4.0.     Use BROKER_URL instead
+
+  warnings.warn(w)
+
+
+2013-03-27 15:59:36,380 DEBG 'celeryd' stdout output:
+/home/edu/virtualenvs/proyecto/local/lib/python2.7/site-packages/celery/utils/__init__.py:73: CPendingDeprecationWarning: 
+    The 'BROKER_HOST' setting is scheduled for deprecation in     version 2.5 and removal in version v4.0.     Use BROKER_URL instead
+
+  warnings.warn(w)
+
+
+2013-03-27 15:59:36,575 DEBG 'celeryd' stdout output:
+/home/edu/virtualenvs/proyecto/local/lib/python2.7/site-packages/djcelery/loaders.py:132: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
+  warnings.warn("Using settings.DEBUG leads to a memory leak, never "
+
+
+2013-03-27 15:59:36,575 DEBG 'celeryd' stdout output:
+[2013-03-27 15:59:36,574: WARNING/MainProcess] /home/edu/virtualenvs/proyecto/local/lib/python2.7/site-packages/djcelery/loaders.py:132: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
+  warnings.warn("Using settings.DEBUG leads to a memory leak, never "
+
+
+2013-03-27 15:59:36,576 DEBG 'celeryd' stdout output:
+[2013-03-27 15:59:36,576: WARNING/MainProcess] celery@white ready.
+
+2013-03-27 15:59:36,579 DEBG 'celeryd' stdout output:
+[2013-03-27 15:59:36,579: INFO/MainProcess] consumer: Connected to redis://127.0.0.1:6379/0.
+
+2013-03-27 15:59:37,579 INFO success: autoreload entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
+2013-03-27 15:59:37,580 INFO success: celeryd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
+2013-03-27 15:59:37,580 INFO success: webserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
+2013-03-27 15:59:50,298 DEBG 'webserver' stdout output:
+/home/edu/virtualenvs/proyecto/local/lib/python2.7/site-packages/django/conf/urls/defaults.py:3: DeprecationWarning: django.conf.urls.defaults is deprecated; use django.conf.urls instead
+  DeprecationWarning)
+
+
+2013-03-27 15:59:50,348 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /done/ HTTP/1.1" 200 6952
+
+2013-03-27 15:59:50,395 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-scrollspy.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,399 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/jquery.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,401 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-popover.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,403 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/less.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,406 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-tooltip.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,407 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-button.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,408 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-collapse.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,410 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-tab.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,412 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/css/flags.css HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,419 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-typeahead.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,420 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-carousel.js HTTP/1.1" 304 0
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-transition.js HTTP/1.1" 304 0
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-alert.js HTTP/1.1" 304 0
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-modal.js HTTP/1.1" 304 0
+[27/Mar/2013 15:59:50] "GET /static/js/bootstrap-dropdown.js HTTP/1.1" 304 0
+
+2013-03-27 15:59:50,795 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:50] "GET /static/img/blank.gif HTTP/1.1" 304 0
+
+2013-03-27 15:59:52,253 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:52] "GET / HTTP/1.1" 302 0
+
+2013-03-27 15:59:57,938 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:57] "POST /i18n/setlang/ HTTP/1.1" 302 0
+
+2013-03-27 15:59:57,957 DEBG 'webserver' stdout output:
+[27/Mar/2013 15:59:57] "GET /contact/ HTTP/1.1" 200 8342
+
+2013-03-27 16:00:14,270 WARN received SIGINT indicating exit request
+2013-03-27 16:00:14,270 DEBG killing webserver (pid 22826) with signal SIGTERM
+2013-03-27 16:00:14,270 INFO waiting for autoreload, celeryd, webserver to die
+2013-03-27 16:00:14,278 DEBG fd 14 closed, stopped monitoring <POutputDispatcher at 50484504 for <Subprocess at 49852568 with name webserver in state STOPPING> (stdout)>
+2013-03-27 16:00:14,278 INFO stopped: webserver (terminated by SIGTERM)
+2013-03-27 16:00:14,278 DEBG received SIGCLD indicating a child quit
+2013-03-27 16:00:14,279 DEBG killing celeryd (pid 22825) with signal SIGTERM
+2013-03-27 16:00:14,333 DEBG 'celeryd' stdout output:
+ 
+ -------------- celery@white v3.0.17 (Chiastic Slide)
+---- **** ----- 
+--- * ***  * -- [Configuration]
+-- * - **** --- . broker:      redis://127.0.0.1:6379/0
+- ** ---------- . app:         default:0x1fb8b50 (djcelery.loaders.DjangoLoader)
+- ** ---------- . concurrency: 4 (processes)
+- ** ---------- . events:      ON
+- ** ---------- 
+- *** --- * --- [Queues]
+-- ******* ---- . celery:      exchange:celery(direct) binding:celery
+--- ***** ----- 
+
+[Tasks]
+  . djcelery_email_send
+
+
+2013-03-27 16:00:14,336 DEBG fd 11 closed, stopped monitoring <POutputDispatcher at 50484216 for <Subprocess at 49762248 with name celeryd in state STOPPING> (stdout)>
+2013-03-27 16:00:14,337 INFO stopped: celeryd (exit status 0)
+2013-03-27 16:00:14,337 DEBG received SIGCLD indicating a child quit
+2013-03-27 16:00:14,337 DEBG killing autoreload (pid 22824) with signal SIGTERM
+2013-03-27 16:00:14,344 DEBG fd 8 closed, stopped monitoring <POutputDispatcher at 50483784 for <Subprocess at 49762032 with name autoreload in state STOPPING> (stdout)>
+2013-03-27 16:00:14,743 INFO stopped: autoreload (terminated by SIGTERM)
+2013-03-27 16:00:14,743 DEBG received SIGCLD indicating a child quit
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.