How to Build Chat into Django Applications with Twilio Programmable Chat
https://www.twilio.com/blog/2018/05/build-chat-python-django-applications-programmable-chat.html
/r/django
https://redd.it/8pcqr1
https://www.twilio.com/blog/2018/05/build-chat-python-django-applications-programmable-chat.html
/r/django
https://redd.it/8pcqr1
Twilio Blog
How to Build Chat into Django Applications with Twilio Programmable Chat
Learn how to integrate advanced chat features into your Python Django web application using Twilio Programmable Chat.
Jupyter temp files not being deleted question.
Hi Everyone,
On my work PC, I run Jupyter 5.4.0, usually through Anaconda Navigator. I have always had an issue where the temp files created during a session do not get deleted. These are located in my AppData\Local\temp folder. The size of each of the files is 0 bytes, but, if I let it go for a few days, I can get thousands of 0 bytes files. I believe it is related to Jupyter but I am not 100% certain. I know that if I run Python through any other IDE I don't see the same thing. Is there a way to tell if this is a result of Jupyter? More importantly, if it is, how do I configure it to stop this?
Thanks for the input!
/r/IPython
https://redd.it/8pelmg
Hi Everyone,
On my work PC, I run Jupyter 5.4.0, usually through Anaconda Navigator. I have always had an issue where the temp files created during a session do not get deleted. These are located in my AppData\Local\temp folder. The size of each of the files is 0 bytes, but, if I let it go for a few days, I can get thousands of 0 bytes files. I believe it is related to Jupyter but I am not 100% certain. I know that if I run Python through any other IDE I don't see the same thing. Is there a way to tell if this is a result of Jupyter? More importantly, if it is, how do I configure it to stop this?
Thanks for the input!
/r/IPython
https://redd.it/8pelmg
reddit
Jupyter temp files not being deleted question. • r/IPython
Hi Everyone, On my work PC, I run Jupyter 5.4.0, usually through Anaconda Navigator. I have always had an issue where the temp files created...
Override Flask Login to use Request Loader
So here's my situation, I have an app which I can't edit, but I can add code to it. At the moment it uses Flask Login for user management/authentication. I want to use Flask Login's Request Loader.
I want to use one of AWS"s new features where I can authenticate on an Application Load Balancer, which will pass the user information to my application via headers. I therefore want to inspect the headers and either create a session on the server for that user, or check the session and continue with the request if the user already has a session.
So my question is this, how would I go about overriding the current implementation of Flask Login? I know I can use decorators to do this, I just don't know which methods to override.
I basically know that this is possible, based on the docs, but I have no clue how to implement it.
/r/flask
https://redd.it/8p0tzn
So here's my situation, I have an app which I can't edit, but I can add code to it. At the moment it uses Flask Login for user management/authentication. I want to use Flask Login's Request Loader.
I want to use one of AWS"s new features where I can authenticate on an Application Load Balancer, which will pass the user information to my application via headers. I therefore want to inspect the headers and either create a session on the server for that user, or check the session and continue with the request if the user already has a session.
So my question is this, how would I go about overriding the current implementation of Flask Login? I know I can use decorators to do this, I just don't know which methods to override.
I basically know that this is possible, based on the docs, but I have no clue how to implement it.
/r/flask
https://redd.it/8p0tzn
reddit
r/flask - Override Flask Login to use Request Loader
1 votes and 0 so far on reddit
What does """ do?
Automate the Boring Stuff has a program that changes American dates to European dates. The first part of the code goes:
datePattern = re.compile(r"""\^(.\*?)
#one or two digits for the month
((0|1)?\\d)\-
#one or two dgits for the day
((0|1|2|3)?\\d)\-
#four digits for the year
((19|20)\\d\\d)
#all text after the date
(.\*?)$
""", re.VERBOSE)
I have a pretty vague idea of what everything does except for the r"""\^ part on the first line. what does """ do?
/r/Python
https://redd.it/8pghas
Automate the Boring Stuff has a program that changes American dates to European dates. The first part of the code goes:
datePattern = re.compile(r"""\^(.\*?)
#one or two digits for the month
((0|1)?\\d)\-
#one or two dgits for the day
((0|1|2|3)?\\d)\-
#four digits for the year
((19|20)\\d\\d)
#all text after the date
(.\*?)$
""", re.VERBOSE)
I have a pretty vague idea of what everything does except for the r"""\^ part on the first line. what does """ do?
/r/Python
https://redd.it/8pghas
reddit
r/Python - What does """ do?
3 votes and 1 so far on reddit
Building large application using Flask, Celery with https://github.com/gofynd/flask-full
Flask\-Full \([https://github.com/gofynd/flask\-full](https://github.com/gofynd/flask-full)\) is a boilerplate framework on top of flask for developing large applications using flask. It has in built support for shell commands, celery, websocket, eventlet, signals, mongoengine orm and rst docs. One can also have separate staging, production config.
/r/flask
https://redd.it/8ng29z
Flask\-Full \([https://github.com/gofynd/flask\-full](https://github.com/gofynd/flask-full)\) is a boilerplate framework on top of flask for developing large applications using flask. It has in built support for shell commands, celery, websocket, eventlet, signals, mongoengine orm and rst docs. One can also have separate staging, production config.
/r/flask
https://redd.it/8ng29z
GitHub
GitHub - gofynd/flask-full: starter/boilerplate flask application with celery, mongoengine, signals, shell commands, swagger api…
starter/boilerplate flask application with celery, mongoengine, signals, shell commands, swagger api docs and sphinx docs integration - gofynd/flask-full
Want to learn to populate Django objects with JSON data
I've got a web scraper that returns some basic JSON data, and I've got a Django site that has models roughly corresponding to that data.
I've googled all over for tutorials on how to do populate my Django model with JSON data, and there's lots of people with partial explanations, but nobody with a full tutorial.
I know django-dynamic-scraper exists, but its documentation is not clear enough to get it working. I've been struggling with this for a few weeks now. Anybody have experience with this? Any chance there's a good tutorial I missed somewhere?
/r/djangolearning
https://redd.it/8pcz6y
I've got a web scraper that returns some basic JSON data, and I've got a Django site that has models roughly corresponding to that data.
I've googled all over for tutorials on how to do populate my Django model with JSON data, and there's lots of people with partial explanations, but nobody with a full tutorial.
I know django-dynamic-scraper exists, but its documentation is not clear enough to get it working. I've been struggling with this for a few weeks now. Anybody have experience with this? Any chance there's a good tutorial I missed somewhere?
/r/djangolearning
https://redd.it/8pcz6y
reddit
r/djangolearning - Want to learn to populate Django objects with JSON data
3 votes and 2 so far on reddit
How to use Pygments Syntax Highlighter
https://overiq.com/blog/1527072795/pygments-tutorial/
/r/django
https://redd.it/8pgmg0
https://overiq.com/blog/1527072795/pygments-tutorial/
/r/django
https://redd.it/8pgmg0
[P] Playing card detection with YOLOv3 trained on generated dataset
https://youtu.be/pnntrewH0xg
/r/MachineLearning
https://redd.it/8p9car
https://youtu.be/pnntrewH0xg
/r/MachineLearning
https://redd.it/8p9car
YouTube
Playing card detection with YOLO
Detection of playing cards with Darknet-YOLO (version 3) trained on a generated dataset
The code for generating the dataset is available here : https://github.com/geaxgx/playing-card-detection
Darknet/YOLO from : https://github.com/AlexeyAB/darknet
Image…
The code for generating the dataset is available here : https://github.com/geaxgx/playing-card-detection
Darknet/YOLO from : https://github.com/AlexeyAB/darknet
Image…
diskover - file system crawler, disk space usage, storage analytics
https://shirosaidev.github.io/diskover
/r/Python
https://redd.it/8pgy3n
https://shirosaidev.github.io/diskover
/r/Python
https://redd.it/8pgy3n
diskover
File system crawler, file search engine and data management and analytics software powered by Elasticsearch to help visualize and manage your data.
Return Image as API response.
What is the best way to return image from flask API to fetch in mobile/web app? I was thinking to develop a react app which will call api and get a response with filename and it will return image from file system? Is this how its done, i don't have much idea about react just starting personal project.
/r/flask
https://redd.it/8pj0bg
What is the best way to return image from flask API to fetch in mobile/web app? I was thinking to develop a react app which will call api and get a response with filename and it will return image from file system? Is this how its done, i don't have much idea about react just starting personal project.
/r/flask
https://redd.it/8pj0bg
reddit
r/flask - Return Image as API response.
2 votes and 6 so far on reddit
REST framework based on Flask. Easy to use and well organized.
https://github.com/laith43d/juju
/r/flask
https://redd.it/8nl79t
https://github.com/laith43d/juju
/r/flask
https://redd.it/8nl79t
GitHub
laith43d/juju
REST application framework based on Flask. Contribute to laith43d/juju development by creating an account on GitHub.
Controlling A Cruise Ship’s Massive Video Display with Python
https://www.twilio.com/blog/2018/02/control-nec-display-array-python.html?src=reddit
/r/Python
https://redd.it/8pjxgq
https://www.twilio.com/blog/2018/02/control-nec-display-array-python.html?src=reddit
/r/Python
https://redd.it/8pjxgq
Wpengine
Controlling A Cruise Ship’s Massive Video Display with Python – Twilio Cloud Communications Blog
Sasa Buklijas built a 34-screen virtual waterfall out of an array of NEC displays, and used Python to control it all. We cover the Python code behind the installation, some of the lessons learned, and include video and images for you to use in your own install.
[AF] Trouble with Flask and using ajax to dynamically refresh
I'm very new to this so I'm really unsure why this doesn't work as I was following the answer to [this question](https://stackoverflow.com/questions/15721679/update-and-render-a-value-from-flask-periodically/). I'm trying to post a form to flask where I process it as needed. This part works fine but when I'm trying to return it back to my html file I notice the $.getJSON part simply doesn't run. Any help or advice is appreciated.
The form part in my index.html:
<!-- POST Form -->
<form action='/endpoint' name="entry" id="entry" method="POST" target="_blank">
<textarea placeholder="Enter Cipher..." id="input" type="text" name="entry" class="inputbox">{{original_text}}</textarea>
<br />
<br />
<input type="submit" class="form__button" value="DECRYPT" onclick="decrypt_click()" />
<br />
<br />
</form>
<textarea id="output" type="text" name="output" class="inputbox" readonly>{{deciphered_text}}</textarea>
Javascript in my html file:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
function update_values() {
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
$.getJSON(
$SCRIPT_ROOT+"/endpoint",
function(data) {
$("textarea#output").val(data.deciphered_text)
$("textarea#entry").val(data.deciphered_text)
}
);
setTimeout(update_values, 1000);
}
update_values()
</script>
My ____init____.py:
from flask import Flask, render_template, request, jsonify, redirect, url_for
import sys
app = Flask(__name__)
from FlaskApp.autocrack import crack_vigenere, crack_caesar, crack_substitution, crack_beaufort, crack_2x2hill, crack_3x3hill, crack_bifid
import re
@app.route('/')
def homepage():
return render_template('index.html',deciphered_text="",original_text="",checkbox_status="1")
@app.route('/endpoint', methods=['GET','POST'])
def entry():
if request.method == 'POST':
text_orig = request.form['entry']
text = removeFormatting(text_orig)
cipher = request.form.get('cipher_selection_menu')
cipher = request.form['selection']
if text != "":
processed_text = text.upper()
if cipher == "1":
deciphered_text = crack_caesar(processed_text)
elif cipher == "2":
deciphered_text = crack_vigenere(processed_text)
elif cipher == "3":
timeout = request.form['timeout_slider']
deciphered_text = crack_substitution(processed_text,timeout)
elif cipher == "4":
deciphered_text = crack_beaufort(processed_text)
elif cipher == "5":
type = request.form['selector']
if type == "2":
deciphered_text = crack_2x2hill(processed_text)
elif type == "3":
deciphered_text = crack_3x3hill(processed_text)
elif cipher == "6":
deciphered_text = crack_bifid(processed_text)
return jsonify(deciphered_text=deciphered_text,original_text=text_orig)
return redirect(url_for('homepage'))
def removeFormatting(stringf):
return re.sub("[^a-zA-Z]+", "", stringf)
if __name__ == "__main__":
#app.run()
app.run(threaded=True)
/r/flask
https://redd.it/8pn4uu
I'm very new to this so I'm really unsure why this doesn't work as I was following the answer to [this question](https://stackoverflow.com/questions/15721679/update-and-render-a-value-from-flask-periodically/). I'm trying to post a form to flask where I process it as needed. This part works fine but when I'm trying to return it back to my html file I notice the $.getJSON part simply doesn't run. Any help or advice is appreciated.
The form part in my index.html:
<!-- POST Form -->
<form action='/endpoint' name="entry" id="entry" method="POST" target="_blank">
<textarea placeholder="Enter Cipher..." id="input" type="text" name="entry" class="inputbox">{{original_text}}</textarea>
<br />
<br />
<input type="submit" class="form__button" value="DECRYPT" onclick="decrypt_click()" />
<br />
<br />
</form>
<textarea id="output" type="text" name="output" class="inputbox" readonly>{{deciphered_text}}</textarea>
Javascript in my html file:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
function update_values() {
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
$.getJSON(
$SCRIPT_ROOT+"/endpoint",
function(data) {
$("textarea#output").val(data.deciphered_text)
$("textarea#entry").val(data.deciphered_text)
}
);
setTimeout(update_values, 1000);
}
update_values()
</script>
My ____init____.py:
from flask import Flask, render_template, request, jsonify, redirect, url_for
import sys
app = Flask(__name__)
from FlaskApp.autocrack import crack_vigenere, crack_caesar, crack_substitution, crack_beaufort, crack_2x2hill, crack_3x3hill, crack_bifid
import re
@app.route('/')
def homepage():
return render_template('index.html',deciphered_text="",original_text="",checkbox_status="1")
@app.route('/endpoint', methods=['GET','POST'])
def entry():
if request.method == 'POST':
text_orig = request.form['entry']
text = removeFormatting(text_orig)
cipher = request.form.get('cipher_selection_menu')
cipher = request.form['selection']
if text != "":
processed_text = text.upper()
if cipher == "1":
deciphered_text = crack_caesar(processed_text)
elif cipher == "2":
deciphered_text = crack_vigenere(processed_text)
elif cipher == "3":
timeout = request.form['timeout_slider']
deciphered_text = crack_substitution(processed_text,timeout)
elif cipher == "4":
deciphered_text = crack_beaufort(processed_text)
elif cipher == "5":
type = request.form['selector']
if type == "2":
deciphered_text = crack_2x2hill(processed_text)
elif type == "3":
deciphered_text = crack_3x3hill(processed_text)
elif cipher == "6":
deciphered_text = crack_bifid(processed_text)
return jsonify(deciphered_text=deciphered_text,original_text=text_orig)
return redirect(url_for('homepage'))
def removeFormatting(stringf):
return re.sub("[^a-zA-Z]+", "", stringf)
if __name__ == "__main__":
#app.run()
app.run(threaded=True)
/r/flask
https://redd.it/8pn4uu
Stack Overflow
Update and render a value from Flask periodically
I want to display my CPU usage dynamically. I don't want to reload the page to see a new value. I know how to get the CPU usage in Python. Right now I render a template with the value. How can I
[AF] Ext to show flask cli commands as a web app?
I don't know if I was dreaming or just making things up.
But I believe there is somewhere a flask ext that gives you a kind of a menu as a web app to enter parameters and then execute the flask.cli function?
Any thoughts or opinions?
/r/flask
https://redd.it/8pmwyu
I don't know if I was dreaming or just making things up.
But I believe there is somewhere a flask ext that gives you a kind of a menu as a web app to enter parameters and then execute the flask.cli function?
Any thoughts or opinions?
/r/flask
https://redd.it/8pmwyu
reddit
r/flask - [AF] Ext to show flask cli commands as a web app?
2 votes and 1 so far on reddit
Import and Run an Application Package?
I am extremely new to Flask and would be very grateful for any help and relevant docs. I was not able to track down any doc about this exact case with a Google search.
I am familiar with importing a package to use various methods, etc, but what of the case where we want to sort of plug a package in as the application that Flask will run?
Example: Say I have a simple web app created a with Flask, which was then configured and published as a package on pypi. From there if someone else wants to import my package and run the app, how would they go about doing so? Are there any examples of this on github?
Looking mostly for doc and resources, no expectation of anyone sitting here to type out an entire tutorial. :\)
/r/flask
https://redd.it/8necpm
I am extremely new to Flask and would be very grateful for any help and relevant docs. I was not able to track down any doc about this exact case with a Google search.
I am familiar with importing a package to use various methods, etc, but what of the case where we want to sort of plug a package in as the application that Flask will run?
Example: Say I have a simple web app created a with Flask, which was then configured and published as a package on pypi. From there if someone else wants to import my package and run the app, how would they go about doing so? Are there any examples of this on github?
Looking mostly for doc and resources, no expectation of anyone sitting here to type out an entire tutorial. :\)
/r/flask
https://redd.it/8necpm
reddit
r/flask - Import and Run an Application Package?
2 votes and 1 so far on reddit
[N] DeepMind: First major AI patent filings revealed
http://ipkitten.blogspot.com/2018/06/deepmind-first-major-ai-patent-filings.html
/r/MachineLearning
https://redd.it/8pm1zq
http://ipkitten.blogspot.com/2018/06/deepmind-first-major-ai-patent-filings.html
/r/MachineLearning
https://redd.it/8pm1zq
The IPKat
DeepMind: First major AI patent filings revealed
The IPKat blog reports on copyright, patent, trade mark, info-tech and privacy/confidentiality issues from a mainly UK and European perspective.
How to write this queryset has me stumped!
Hi
Would really appreciate some help with writing this queryset.
[https://stackoverflow.com/questions/50740061/how\-do\-i\-write\-a\-django\-query\-to\-join\-on\-a\-field\-and\-a\-condition](https://stackoverflow.com/questions/50740061/how-do-i-write-a-django-query-to-join-on-a-field-and-a-condition)
Thanks!
/r/djangolearning
https://redd.it/8padu3
Hi
Would really appreciate some help with writing this queryset.
[https://stackoverflow.com/questions/50740061/how\-do\-i\-write\-a\-django\-query\-to\-join\-on\-a\-field\-and\-a\-condition](https://stackoverflow.com/questions/50740061/how-do-i-write-a-django-query-to-join-on-a-field-and-a-condition)
Thanks!
/r/djangolearning
https://redd.it/8padu3
To Python Developers: If someone could make any one thing that would make coding in python easier for developers, what would it be?
/r/Python
https://redd.it/8ppvaf
/r/Python
https://redd.it/8ppvaf
reddit
r/Python - To Python Developers: If someone could make any one thing that would make coding in python easier for developers, what…
34 votes and 58 so far on reddit
GitHub: Check out this new open source library that helps you decide how long to wait for stuff :)
https://github.com/ryu577/survival
/r/Python
https://redd.it/8pp45h
https://github.com/ryu577/survival
/r/Python
https://redd.it/8pp45h
GitHub
ryu577/survival
All kinds of survival analysis distributions and methods to optimize how long to wait for them.
Recommended Flask video tutorials?
Are there any good and updated flask video tutorials? I can find many books and blog posts, but I learn better from videos. Are there any recommendations?
/r/flask
https://redd.it/8pra0x
Are there any good and updated flask video tutorials? I can find many books and blog posts, but I learn better from videos. Are there any recommendations?
/r/flask
https://redd.it/8pra0x
reddit
r/flask - Recommended Flask video tutorials?
1 votes and 5 so far on reddit