Skip to content

Instantly share code, notes, and snippets.

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.
# import one model
from app.models import Blog
# import a bunch
from app.models import *
# import one view
from app.views import Blog
# import a bunch
from app.views import *
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):
# Amazon AWS
AWS_ACCESS_KEY = 'AKIA........'
AWS_SECRET_KEY = 'w71v........'
from app.lib.amazonses import SESMessage
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
from django.contrib import messages
# within a view method
messages.add_message(request, messages.INFO, 'This message will appear after the redirect!')
{% if messages %}
<div class="notice">
{% for message in messages %}
{{ message }}
{% endfor %}
</div>
{% endif %}
#!/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