This file contains hidden or 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
{ | |
"version": 1, | |
"signals": [ | |
{"name": "test_signal", "providing_args": ["uuid"]}, | |
{"name": "else_signal", "providing_args": ["uuid"]} | |
], | |
"queues": [ | |
{"name": "test_queue"} | |
] | |
} |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import re | |
import argparse | |
def _update_equal(content): | |
items = re.findall('assert \S+ == \S+', content) | |
def _f(x): |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# requirements: | |
# requests==2.9.1 | |
# Django==1.9.1 | |
from __future__ import unicode_literals | |
import re | |
import requests |
This file contains hidden or 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
# Django-ORM usage example | |
class RatingModelMixin(models.Model): | |
_statistic = None | |
anonymous_views = models.PositiveIntegerField( | |
u'Количество анонимных просмотров', default=0) | |
anonymous_likes = models.PositiveIntegerField( | |
u'Количество анонимных лайков', default=0) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import threading | |
from utils import logger | |
from django.conf import settings | |
from django.template.loader import render_to_string | |
from django.core.mail import EmailMultiAlternatives | |
from django.utils import translation |
This file contains hidden or 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.auth.tokens import default_token_generator | |
from django.contrib.sites.shortcuts import get_current_site | |
from django.utils.http import urlsafe_base64_decode | |
class PasswordResetView(generics.GenericAPIView): | |
""" | |
Сброс пароля. | |
POST: {"email": "foo@bar.com"} |