Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
#This is a little example of how to make a PUT request (see http://microformats.org/wiki/rest/urls ) | |
#To a API written with tastypie (https://github.com/toastdriven/django-tastypie ) | |
# import the standard JSON parser | |
import json | |
# import the REST library (from http://code.google.com/p/python-rest-client/) | |
from restful_lib import Connection | |
#site url | |
base_url = "http://IP/api/v1" |
class UserUpdateView(AuthenticatorViewMixin, UpdateView): | |
model = User | |
template_name = 'manager/authenticator/user_list.html' | |
def get_form_class(self): | |
return modelformset_factory(User, extra=0) | |
def get_form_kwargs(self): | |
kwargs = super(UserUpdateView, self).get_form_kwargs() | |
kwargs['queryset'] = kwargs['instance'] |
## views.py | |
import tempfile | |
import os | |
import commands | |
import cgi | |
from django import http | |
from django.views.decorators.csrf import csrf_exempt | |
from django.shortcuts import render |
# Assuming you have a Article Model like this | |
# class Article(models.Model): | |
# ... Some field | |
# media = models.FileField(upload_to="path_to_inner_media_folder", blank=True) | |
from django.core.files.base import ContentFile | |
import os | |
# Create an article with the associated model | |
new_article = Article() |
from django.forms import ModelForm | |
from django.forms.models import inlineformset_factory | |
from models import Sponsor, Sponsorship | |
class SponsorForm(ModelForm): | |
class Meta: | |
model = Sponsor |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
/* | |
* Copyright (C) 2014 Antonio Leiva Gordillo. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2014 Matthieu Harlé | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |