This file contains 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
# Example how to add rich editor capabilities to your models in admin. | |
from django.contrib.admin import site, ModelAdmin | |
import models | |
# we define our resources to add to admin pages | |
class CommonMedia: | |
js = ( | |
'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js', |
This file contains 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
<script id="componentTypeRowTpl" type="text/html"> | |
<td>{{ name }}</td> | |
<td class="ellipsis_100">{{ description }}</td> | |
</script> |
This file contains 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
[program:hello] | |
command = docker run --rm busybox /bin/sh -c "while true; do echo hello world; sleep 1; done" | |
autostart = true | |
autorestart = true |
This file contains 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 django.contrib.sessions.models import Session | |
for s in Session.objects.iterator(): | |
session_dict = s.get_decoded() | |
if '_auth_user_backend' in session_dict.keys(): | |
#New backend is social.backends.facebook.FacebookOAuth2 | |
#Change from old backend | |
if session_dict['_auth_user_backend'] == 'social_auth.backends.facebook.FacebookBackend': | |
session_dict['_auth_user_backend'] = 'social.backends.facebook.FacebookOAuth2' | |
new_s = Session.objects.save(s.session_key, session_dict, s.expire_date) | |
print new_s.pk |