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
CommandError: One or more models did not validate: | |
app.blogcomment: 'blog' has a relation with model <class 'app.models.blog.Blog'>, which has either not been installed or is abstract. |
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
# import one model | |
from app.models import Blog | |
# import a bunch | |
from app.models import * |
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 app.views.blog import Blog |
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
# import one view | |
from app.views import Blog | |
# import a bunch | |
from app.views import * |
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 email.utils import COMMASPACE | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from boto.ses import SESConnection | |
from django.conf import settings | |
class SESMessage(object): | |
def __init__(self, source, to_addresses, subject, **kw): |
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
# Amazon AWS | |
AWS_ACCESS_KEY = 'AKIA........' | |
AWS_SECRET_KEY = 'w71v........' |
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 app.lib.amazonses import SESMessage | |
def contact(request): | |
if request.method == 'POST': | |
form = ContactForm(request.POST) | |
if form.is_valid(): |
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 import messages | |
# within a view method | |
messages.add_message(request, messages.INFO, 'This message will appear after the redirect!') |
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
{% if messages %} | |
<div class="notice"> | |
{% for message in messages %} | |
{{ message }} | |
{% endfor %} | |
</div> | |
{% endif %} |
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
#!/bin/bash -e | |
# | |
# Test for a reboot, if this is a reboot just skip this script. | |
# | |
if test "$RS_REBOOT" = "true" ; then | |
echo "Skip software update on reboot." | |
logger -t RightScale "Software update, skipped on a reboot." | |
exit 0 | |
fi |