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 flask import Flask, request | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hello World!" | |
@app.route('/upload', methods=['POST']) | |
def upload_file(): |
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
''' | |
WebSms messaging class. | |
Copyright © 2018 confirm IT solutions | |
''' | |
__all__ = ( | |
'WebSms', | |
) |
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
class KeyValue(unicode): | |
''' | |
This class can be used to represent newline-separated colon-based and | |
key-value strings. This sounds a bit complicated, but in fact it's really | |
simple and straight forward. It's basically an unicode class on steroids. | |
Just create a new instance and define colon-based key-value strings in the | |
constructor. Each line should contain one key-value pair, for example: | |
``` |
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 absolute_import, unicode_literals | |
from django.views.generic import View | |
from django.http import HttpResponse | |
from .models import MyFirstModel, MySecondModel | |
class CustomUnicode(unicode): | |
pass | |
class TestView(View): |
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 absolute_import, unicode_literals | |
from django.db.models import TextField | |
class KeyValue(unicode): | |
pass | |
class KeyValueField(TextField): |