###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
| <!-- | |
| autor: Alex Dzul @alexjs88 | |
| Supongamos que tenemos miles de objetos a paginar. Django por sí solo no cuenta con una función que nos | |
| permita definir cuántas páginas queremos mostrar y en tu template te podría aparecer miles de páginas: | |
| < 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 N1.. N2.. etc ... > | |
| Si en nuestro sitio solo queremos mostrar un fragmento de páginas, entonces con este SNIP podemos definir | |
| el intervalo de páginas hacia la izquierda y hacia la derecha que necesitamos. | |
| def update_user_social_data(strategy, *args, **kwargs): | |
| """Set the name and avatar for a user only if is new. | |
| """ | |
| print 'update_user_social_data ::', strategy | |
| if not kwargs['is_new']: | |
| return | |
| full_name = '' | |
| backend = kwargs['backend'] |
| import base64 | |
| from django.core.files.base import ContentFile | |
| from rest_framework import serializers | |
| class Base64ImageField(serializers.ImageField): | |
| def from_native(self, data): | |
| if isinstance(data, basestring) and data.startswith('data:image'): | |
| # base64 encoded image - decode |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| import logging | |
| from django.utils import translation | |
| class SubdomainLanguageMiddleware(object): | |
| """ | |
| Set the language for the site based on the subdomain the request | |
| is being served on. For example, serving on 'fr.domain.com' would | |
| make the language French (fr). |