pip install django-reversion
Add reversion to INSTALLED_APPS
INSTALLED_APPS = [
...
...
...
.table-container th.asc:after { | |
content: '\0000a0\0025b2'; | |
} | |
.table-container th.desc:after { | |
content: '\0000a0\0025bc'; | |
} | |
.pagination { | |
text-align: center; | |
} |
from django.forms import ModelForm | |
from django.forms.models import inlineformset_factory | |
from models import Sponsor, Sponsorship | |
class SponsorForm(ModelForm): | |
class Meta: | |
model = Sponsor |
package com.example.twitter; | |
import oauth.signpost.OAuthConsumer; | |
import oauth.signpost.OAuthProvider; | |
import oauth.signpost.basic.DefaultOAuthProvider; | |
import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer; | |
import oauth.signpost.exception.OAuthCommunicationException; | |
import oauth.signpost.exception.OAuthExpectationFailedException; |
function validaRut(campo){ | |
if ( campo.length == 0 ){ return false; } | |
if ( campo.length < 8 ){ return false; } | |
campo = campo.replace('-','') | |
campo = campo.replace(/\./g,'') | |
var suma = 0; | |
var caracteres = "1234567890kK"; | |
var contador = 0; |
pip install django-reversion
Add reversion to INSTALLED_APPS
INSTALLED_APPS = [
...
...
...
import chardet | |
def determinar_encoding(input_file='despachos.csv'): | |
file = open(input_file, 'rb').read() | |
encoding = chardet.detect(file) | |
if encoding: | |
return encoding['encoding'] | |
return None |
import re | |
texto = 'Supermercado (1,10,5)' | |
busqueda_coordenada = re.search(r'(.+)(\(.{5,}\))', texto) | |
print(busqueda_coordenada.groups()) | |
if busqueda_coordenada: | |
if len(busqueda_coordenada.groups()) >= 2: | |
texto = busqueda_coordenada.group(1).strip() | |
coordenada = re.sub('[()]', '', busqueda_coordenada.group(2)).split(',') |
There are two main modes to run the Let's Encrypt client (called Certbot
):
Webroot is better because it doesn't need to replace Nginx (to bind to port 80).
In the following, we're setting up mydomain.com
.
HTML is served from /var/www/mydomain
, and challenges are served from /var/www/letsencrypt
.
apt-get install python-pygraphviz | |
pip install django-extensions | |
# add 'django_extensions' to INSTALLED_APPS in settings.py | |
python manage.py graph_models trees -o test.png |
# admin.py: admin action definition | |
def make_copy(self, request, queryset): | |
form = None | |
if 'apply' in request.POST: | |
form = CopyPageForm(request.POST) | |
if form.is_valid(): | |
issue = form.cleaned_data['issue'] |