This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ heroku logs --tail --ps worker | |
2013-01-10T13:40:31+00:00 app[worker.1]: return Database.Cursor.execute(self, query, params) | |
2013-01-10T13:40:31+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql | |
2013-01-10T13:40:31+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/worker/consumer.py", line 392, in start | |
2013-01-10T13:40:31+00:00 app[worker.1]: self._result_cache = list(self.iterator()) | |
2013-01-10T13:40:31+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 273, in iterator | |
2013-01-10T13:40:31+00:00 app[worker.1]: for row in compiler.results_iter(): | |
2013-01-10T13:40:31+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 680, in results_iter | |
2013-01-10T13:40:31+00:00 app[worker.1]: for rows in self.execute_sql(MULTI): | |
2013-01-10T13:40:31+00:00 app[worker. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FuncionarioForm(forms.ModelForm): | |
""" Sobrescreve formulário de funcionários """ | |
class Meta: | |
model = Funcionario | |
exclude = ('usuario', ) | |
def __init__(self, *args, **kwargs): | |
super(FuncionarioForm, self).__init__(*args, **kwargs) | |
# Editar funcionário: valores iniciais |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Formulário --> | |
<form action="/foo/bar/url/" method="POST" id="id_form">{% csrf_token %} | |
{% for hidden in foo_form.hidden_fields %} | |
{{ hidden }} | |
{% endfor %} | |
<!-- Outros campos do formulário --> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tue Jul 23 14:30:08 UTC 2013 | |
/var/lib/openshift/51ede3a585194317da000107/python-2.7/virtenv/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory | |
Tue Jul 23 14:45:08 UTC 2013 | |
/var/lib/openshift/51ede3a585194317da000107/python-2.7/virtenv/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python src/manage.py celeryd -l DEBUG worker -Q documents | |
INFO 2014-03-24 17:14:01,628 base 2336 139880823154432 Raven is not configured (logging is disabled). Please see the documentation for more information. | |
UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments! [loaders.py:108] | |
[2014-03-24 17:14:03,849: WARNING/MainProcess] | |
-------------- celery@ubuntu-server-10044-x64-vbox4210 v2.5.5 | |
---- **** ----- | |
--- * *** * -- [Configuration] | |
-- * - **** --- . broker: amqp://guest@localhost:5672// | |
- ** ---------- . loader: djcelery.loaders.DjangoLoader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [19]: subprocess.call(["/tmp"]) | |
ERROR: An unexpected error occurred while tokenizing input | |
The following traceback may be corrupted or invalid | |
The error message is: ('EOF in multi-line statement', (20, 0)) | |
--------------------------------------------------------------------------- | |
OSError Traceback (most recent call last) | |
/vagrant/sherpany/onlinebr/venv/local/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>() | |
----> 1 subprocess.call(["/tmp"]) | |
/usr/lib/python2.7/subprocess.pyc in call(*popenargs, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2014-03-25 15:33:23,188: DEBUG/MainProcess] Consumer: Ready to accept tasks! | |
[2014-03-25 15:34:04,095: INFO/MainProcess] Got task from broker: documents.tasks.CreateProcessedPdfTask[966c69a8-8018-4e0b-903d-c138e7a48483] | |
[2014-03-25 15:34:04,130: INFO/MainProcess] Got task from broker: documents.tasks.CreateProcessedPdfTask[98d65a88-b801-4dc8-ae91-e2f0e8adc54e] | |
[2014-03-25 15:34:04,144: DEBUG/MainProcess] Mediator: Running callback for task: documents.tasks.CreateProcessedPdfTask[966c69a8-8018-4e0b-903d-c138e7a48483] | |
[2014-03-25 15:34:04,144: DEBUG/MainProcess] TaskPool: Apply <function execute_and_trace at 0x4b6aaa0> (args:('documents.tasks.CreateProcessedPdfTask', '966c69a8-8018-4e0b-903d-c138e7a48483', (<Document: django10-cheat-sheet (application/pdf)>, <BRUser: [email protected]>, 2), {}) kwargs:{'hostname': 'ubuntu-server-10044-x64-vbox4210', 'request': {'retries': 0, 'task': 'documents.tasks.CreateProcessedPdfTask', 'utc': False, 'loglevel': 10, 'delivery_info': {'routing_key': u'documents', 'ex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from celery.registry import tasks | |
from celery.signals import task_sent, task_prerun, task_postrun | |
def on_task_postrun(**kwargs): | |
print "on_task_postrun" | |
def on_task_sent(**kwargs): | |
print "on_task_sent" | |
task_sent.connect(on_task_sent, tasks['documents.tasks.CreateBoardbook']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def diff(a, b): | |
b = set(b) | |
return [aa for aa in a if aa not in b] | |
def set_diff(a, b): | |
return list(set(a) - set(b)) | |
diff_lamb_hension = lambda l1,l2: [x for x in l1 if x not in l2] | |
diff_lamb_filter = lambda l1,l2: filter(lambda x: x not in l2, l1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onlinebr-project$ bin/django shell | |
File not found: /etc/onlinebr/config.cfg | |
Execute: $ fab sendsmsconfig : url = http://send.sms.com, user = test, password = S3cr3t3 | |
INFO 2014-04-21 17:10:21,531 base 21357 140377689782016 Raven is not configured (logging is disabled). Please see the documentation for more information. | |
Python 2.7.3 (default, Feb 27 2014, 19:58:35) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 0.12 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. |
OlderNewer