Is it possible to have multiple post requests in one route() decorator?
Is it possible to have multiple post requests in one route() decorator?
What I'd like to achieve is to have one html page with multiple forms.
I tried something like this but doesn't seem to work.
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
do_a= request.form['do_a'];
do_b= request.form['do_b'];
else:
....
return render_template('base.html')
Thanks
/r/flask
https://redd.it/89nlgx
Is it possible to have multiple post requests in one route() decorator?
What I'd like to achieve is to have one html page with multiple forms.
I tried something like this but doesn't seem to work.
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
do_a= request.form['do_a'];
do_b= request.form['do_b'];
else:
....
return render_template('base.html')
Thanks
/r/flask
https://redd.it/89nlgx
reddit
Is it possible to have multiple post requests in one... • r/flask
Is it possible to have multiple post requests in one route() decorator? What I'd like to achieve is to have one html page with multiple forms. I...
ELI5 Why do I want to use a tuple instead of a list They seem basically the same other than mutable/immutable
I just don't see the value add. But I end up dealing with them a lot.
/r/Python
https://redd.it/89l4fi
I just don't see the value add. But I end up dealing with them a lot.
/r/Python
https://redd.it/89l4fi
reddit
ELI5 Why do I want to use a tuple instead of a list... • r/Python
I just don't see the value add. But I end up dealing with them a lot.
[Ask Flask] Is there reason to use db.Column, db.String etc in flask-sqlalchemy instead of sqlalchemy Column, String etc?
I came into Python from languages with very strong language servers and autocompletion due to static typing and I really like Python 3 types system, because it helps very much to develop and avoid most common errors especially for newcomers like me (correct methods, properties and types are suggested by language server/autocomplete)
But I discovered that db from flask_sqlalchemy does not have many members which are being used in clean sqlalchemy environment in a snap with suggestions from editor.
Is there any reason documentation has db.String instead of
from sqlalchemy import String, Column, ...
?
Thanks!
P.S. (link to flask-sqlalchemy doc: http://flask-sqlalchemy.pocoo.org/2.3/models/#simple-example )
/r/flask
https://redd.it/89n3jd
I came into Python from languages with very strong language servers and autocompletion due to static typing and I really like Python 3 types system, because it helps very much to develop and avoid most common errors especially for newcomers like me (correct methods, properties and types are suggested by language server/autocomplete)
But I discovered that db from flask_sqlalchemy does not have many members which are being used in clean sqlalchemy environment in a snap with suggestions from editor.
Is there any reason documentation has db.String instead of
from sqlalchemy import String, Column, ...
?
Thanks!
P.S. (link to flask-sqlalchemy doc: http://flask-sqlalchemy.pocoo.org/2.3/models/#simple-example )
/r/flask
https://redd.it/89n3jd
reddit
[Ask Flask] Is there reason to use db.Column, db.String... • r/flask
I came into Python from languages with very strong language servers and autocompletion due to static typing and I really like Python 3 types...
Data Science Interview Guide
https://medium.com/@sadatnazrul/data-science-interview-guide-4ee9f5dc778
/r/pystats
https://redd.it/89khc1
https://medium.com/@sadatnazrul/data-science-interview-guide-4ee9f5dc778
/r/pystats
https://redd.it/89khc1
Towards Data Science
Data Science Interview Guide
Data Science is quite a large and diverse field. As a result, it is really difficult to be a jack of all trades. Traditionally, Data…
[P]s The 2018 Stanford CS224n NLP course projects are now online. A lot of them are pretty impressive.
http://web.stanford.edu/class/cs224n/reports.html
/r/MachineLearning
https://redd.it/89i9h8
http://web.stanford.edu/class/cs224n/reports.html
/r/MachineLearning
https://redd.it/89i9h8
reddit
[P]s The 2018 Stanford CS224n NLP course... • r/MachineLearning
46 points and 8 comments so far on reddit
Best Free Online Courses for Learning Python, C++, Java & Android Development
https://medium.com/@naasifn/best-free-online-courses-for-learning-python-c-java-android-development-1a9a67afb850
/r/Python
https://redd.it/89o4h2
https://medium.com/@naasifn/best-free-online-courses-for-learning-python-c-java-android-development-1a9a67afb850
/r/Python
https://redd.it/89o4h2
Medium
Best Free Online Courses for Learning Python, C++, Java & Android Development
Here is a list of free online courses on udemy for learning Java, C++ and Python. Here I have added courses I found helpful for beginners…
Roadmap to becoming a Backend Developer in 2018
https://medium.com/tech-tajawal/modern-backend-developer-in-2018-6b3f7b5f8b9
/r/Python
https://redd.it/89p8us
https://medium.com/tech-tajawal/modern-backend-developer-in-2018-6b3f7b5f8b9
/r/Python
https://redd.it/89p8us
Medium
Learn to become a Backend Developer
Roadmap to becoming a Backend Developer in 2020
Authentication Methods with DRF + React
I'm looking into my options to authenticate users/serve data from a DRF api call and a front-end built in React. Are there any options other than using tokens (JWT)? Can I make the request/authenticate via the header information in React's fetch method?
/r/django
https://redd.it/89nqqg
I'm looking into my options to authenticate users/serve data from a DRF api call and a front-end built in React. Are there any options other than using tokens (JWT)? Can I make the request/authenticate via the header information in React's fetch method?
/r/django
https://redd.it/89nqqg
reddit
Authentication Methods with DRF + React • r/django
I'm looking into my options to authenticate users/serve data from a DRF api call and a front-end built in React. Are there any options other than...
[AF} Are mostly integration tests "acceptable"?
Most tests that I've seen rely on integration tests with very few, if any unit tests. I haven't seen any mocks. Is this normal practice for Flask (and/or Django) projects? I'm trying to learn the best practices but I can't figure that out. Right now, I'm writing integration tests for my routes (using sqllite db) with few unit tests.
/r/flask
https://redd.it/89f2nz
Most tests that I've seen rely on integration tests with very few, if any unit tests. I haven't seen any mocks. Is this normal practice for Flask (and/or Django) projects? I'm trying to learn the best practices but I can't figure that out. Right now, I'm writing integration tests for my routes (using sqllite db) with few unit tests.
/r/flask
https://redd.it/89f2nz
reddit
[AF} Are mostly integration tests "acceptable"? • r/flask
Most tests that I've seen rely on integration tests with very few, if any unit tests. I haven't seen any mocks. Is this normal practice for Flask...
Keyword Arguments in Python: How to Use Them
http://treyhunner.com/2018/04/keyword-arguments-in-python/
/r/Python
https://redd.it/89qwgb
http://treyhunner.com/2018/04/keyword-arguments-in-python/
/r/Python
https://redd.it/89qwgb
Treyhunner
Keyword (Named) Arguments in Python: How to Use Them
Keyword arguments are one of those Python features that often seems a little odd for folks moving to Python from many other programming languages. It …
Is there any recent app to keep track of transactions / account balances?
Hello there! Diggin' in Google i just found two:
The oscar's accounts app:
https://github.com/django-oscar/django-oscar-accounts
(This requires Oscar, which i don't need)
And this fork of the same project:
https://github.com/carver/django-account-balances
(Which is not updated, and doesn't work with recent Django versions)
I think i'll have to download the last one and try to upgrade it myself. I didn't want to make my own system off the ground mainly because of being afraid of transaction bugs, i would rather leave it to people that know better than me. Thank you very much!
/r/django
https://redd.it/89tbxn
Hello there! Diggin' in Google i just found two:
The oscar's accounts app:
https://github.com/django-oscar/django-oscar-accounts
(This requires Oscar, which i don't need)
And this fork of the same project:
https://github.com/carver/django-account-balances
(Which is not updated, and doesn't work with recent Django versions)
I think i'll have to download the last one and try to upgrade it myself. I didn't want to make my own system off the ground mainly because of being afraid of transaction bugs, i would rather leave it to people that know better than me. Thank you very much!
/r/django
https://redd.it/89tbxn
GitHub
GitHub - django-oscar/django-oscar-accounts: Managed accounts for Django (with or without django-oscar)
Managed accounts for Django (with or without django-oscar) - django-oscar/django-oscar-accounts
LDAP auth in view (not system)
Hey all,
I'm trying to manually authenticate LDAP users through a view. All search results seem to focus on using LDAP for Django users, which I don't want.
In essence, I want to receive a user/pass combination as POST parameters, and connect to the LDAP server in the view, send the data, and process the result. Is there a library for this?
/r/django
https://redd.it/89scxu
Hey all,
I'm trying to manually authenticate LDAP users through a view. All search results seem to focus on using LDAP for Django users, which I don't want.
In essence, I want to receive a user/pass combination as POST parameters, and connect to the LDAP server in the view, send the data, and process the result. Is there a library for this?
/r/django
https://redd.it/89scxu
reddit
LDAP auth in view (not system) • r/django
Hey all, I'm trying to manually authenticate LDAP users through a view. All search results seem to focus on using LDAP for Django users, which I...
What are the 'secrets' that should be kept secret?
Newbie here, I have read on guides and articles that when using version control and during deployment, there are stuff that should be kept secret.
1. Is this only necessary when the project involves multiple devs? Is it still required if it is a personal project and I keep the repo private?
2. The only secret variables that I know of are SECRET_KEY and DATABASES variables. Are there anything else that should be kept secret?
/r/django
https://redd.it/89rq18
Newbie here, I have read on guides and articles that when using version control and during deployment, there are stuff that should be kept secret.
1. Is this only necessary when the project involves multiple devs? Is it still required if it is a personal project and I keep the repo private?
2. The only secret variables that I know of are SECRET_KEY and DATABASES variables. Are there anything else that should be kept secret?
/r/django
https://redd.it/89rq18
reddit
What are the 'secrets' that should be kept secret? • r/django
Newbie here, I have read on guides and articles that when using version control and during deployment, there are stuff that should be kept secret....
Poetry (Dependency management for Python) 0.7.0 is out: Python 3.4 and 3.5 support, standalone installer and more
https://poetry.eustace.io/blog/poetry-0-7-0-is-out.html
/r/Python
https://redd.it/89sflx
https://poetry.eustace.io/blog/poetry-0-7-0-is-out.html
/r/Python
https://redd.it/89sflx
poetry.eustace.io
Poetry 0.7.0 is out | Blog | Poetry - Python dependency management and packaging made easy.
This version brings some improvements and a bunch of bugfixes.
[P] The Annotated Transformer: Line-by-Line PyTorch implementation of "Attention is All You Need"
http://nlp.seas.harvard.edu/2018/04/03/attention.html
/r/MachineLearning
https://redd.it/89uy75
http://nlp.seas.harvard.edu/2018/04/03/attention.html
/r/MachineLearning
https://redd.it/89uy75
reddit
[P] The Annotated Transformer: Line-by-Line... • r/MachineLearning
35 points and 1 comments so far on reddit
Creating animated map visualizations with Python
https://medium.com/udacity/creating-map-animations-with-python-97e24040f17b
/r/Python
https://redd.it/89vmrs
https://medium.com/udacity/creating-map-animations-with-python-97e24040f17b
/r/Python
https://redd.it/89vmrs
Medium
Creating Map Animations with Python
For last week’s Intersect 2018 conference, I created a map visualization that was shown during the keynote speech from Udacity’s CEO …
Python Libraries for ETL Data Validation?
I am looking for a python library to validate the output of etl jobs that use sql statement and an expected value. Then if the tests fail there are callbacks I can use, or possibly a dashboard that is updated with the failed tests. Anyone aware of anything that fits the bill?
/r/Python
https://redd.it/89vr6a
I am looking for a python library to validate the output of etl jobs that use sql statement and an expected value. Then if the tests fail there are callbacks I can use, or possibly a dashboard that is updated with the failed tests. Anyone aware of anything that fits the bill?
/r/Python
https://redd.it/89vr6a
reddit
Python Libraries for ETL Data Validation? • r/Python
I am looking for a python library to validate the output of etl jobs that use sql statement and an expected value. Then if the tests fail there...
JQery pretty much the only way to call Function without reloading page?
Still pretty new to Django but I've gotten to a point with my website where I want the user to press a button which calls a python function, return the values and then replace various bits of html needed WITHOUT reloading the entire page.
So far my searching has mostly come up with these kind of [solutions](https://stackoverflow.com/questions/17599035/django-how-can-i-call-a-view-function-from-template)... I assumed Django had a "Django Way" for doing this kind of thing.. maybe using jinja or something, but I can't seem to find it.. or atleast can't find what I assume I am looking for.
What is the proper way of doing what I am talking about?
/r/djangolearning
https://redd.it/89svb6
Still pretty new to Django but I've gotten to a point with my website where I want the user to press a button which calls a python function, return the values and then replace various bits of html needed WITHOUT reloading the entire page.
So far my searching has mostly come up with these kind of [solutions](https://stackoverflow.com/questions/17599035/django-how-can-i-call-a-view-function-from-template)... I assumed Django had a "Django Way" for doing this kind of thing.. maybe using jinja or something, but I can't seem to find it.. or atleast can't find what I assume I am looking for.
What is the proper way of doing what I am talking about?
/r/djangolearning
https://redd.it/89svb6
Stack Overflow
Django: How can I call a view function from template?
I have a question on how to call a view function from a template HTML button? Like an onclick function?
Here is the template:
<input id="submit" type="button" onclick="xxx" method="post" value="
Here is the template:
<input id="submit" type="button" onclick="xxx" method="post" value="