virtualenv env
source env/bin/activate
pip install -r requirements_dev.txt
This file contains 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 django.http import Http404 | |
from django.conf import settings | |
import mongoengine | |
from rest_framework import viewsets | |
from rest_framework.response import Response | |
from rest_framework import status | |
from sx.apps.schemes import backend | |
from sx.apps.schemes.backends import SchemeNotFoundError |
This file contains 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 django.conf import settings | |
from rest_framework import authentication | |
from rest_framework import exceptions | |
class ApiKeyAuthentication(authentication.BaseAuthentication): | |
''' | |
Аутентификация по задаанным в настройках ключам | |
''' |
This file contains 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 collections import OrderedDict | |
# ... | |
class OrderFormMixin(object): | |
''' | |
To apply add to Meta 'order' iterable | |
''' | |
def __init__(self, *args, **kwargs): | |
super(OrderFormMixin, self).__init__(*args, **kwargs) |
This file contains 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
#!/usr/bin/env python2 | |
# coding: utf-8 | |
''' | |
Напишите функцию, получающую на входе строку, | |
содержащую математическое выражение в обратной польской нотации | |
(например, «5 8 3 + *»), и возвращающую | |
значение этого выражения (в примере — 55). | |
Run in shell: | |
$ ./test_task.py '5 8 3 + *' |
This file contains 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 | |
# Ответ на https://gist.github.com/dmitry-mukhin/fbc28d3b75605d4dd528 | |
from collections import defaultdict | |
from django.db import models | |
class Item(models.Model): | |
# ..... |
This file contains 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
click==6.7 | |
pyaml==16.12.2 | |
markdown==2.6.7 |
This file contains 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
-r requirements.txt | |
pip==9.0.1 | |
bumpversion==0.5.3 | |
wheel==0.29.0 | |
watchdog==0.8.3 | |
flake8==2.6.0 | |
tox==2.3.1 | |
coverage==4.1 | |
Sphinx==1.4.8 |
This file contains 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 os | |
import logging | |
import smtplib | |
from email.mime.text import MIMEText | |
import types | |
import re |
This file contains 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
--- | |
gmail: | |
server: smtp.gmail.com | |
port: 587 | |
tls: yes | |
yandex: | |
server: smtp.yandex.ru | |
port: 465 | |
ssl: yes |
OlderNewer