Skip to content

Instantly share code, notes, and snippets.

@morenopc
morenopc / cron_send_tweet.log
Created July 23, 2013 14:58
Twitneraio: Shell script send tweets
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
@morenopc
morenopc / Django-form.html
Last active December 19, 2015 00:19
Usando o script https://github.com/morenopc/serializeAnything para adicionar o csrf_token ao POST do formulário
<!-- 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>
@morenopc
morenopc / admin.py
Last active June 28, 2018 05:09
Funcionários models Sobrescrever formulário admin para adicionar dois objetos User e Funcionario
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
@morenopc
morenopc / gist:4502539
Created January 10, 2013 14:44
Full log: heroku celery ImportError: No module named _bsddb
$ 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.