ro
dynamic-33012) by user smschavan143@gmail.com
2018-04-10T08:41:50.953604+00:00 app[api]: Release v3 created by user smschavan1
43@gmail.com
2018-04-10T08:41:51.193509+00:00 app[api]: Deploy 76360db4 by user smschavan143@
gmail.com
2018-04-10T08:41:51.193509+00:00 app[api]: Release v4 created by user smschavan1
43@gmail.com
2018-04-10T08:41:23.000000+00:00 app[api]: Build succeeded
2018-04-10T08:51:00.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T08:51:00.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-10T08:52:35.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T08:53:00.830250+00:00 app[api]: Deploy 3885895d by user smschavan143@
gmail.com
2018-04-10T08:53:00.830250+00:00 app[api]: Release v5 created by user smschavan1
43@gmail.com
2018-04-10T08:52:35.000000+00:00 app[api]: Build succeeded
2018-04-10T08:59:46.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T09:00:10.571878+00:00 app[api]: Release v6 created by user smschavan1
43@gmail.com
2018-04-10T09:00:10.571878+00:00 app[api]: Deploy bbae6e49 by user smschavan143@
gmail.com
2018-04-10T08:59:46.000000+00:00 app[api]: Build succeeded
2018-04-10T09:00:48.993535+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=c3052a19-a59a-4cef-8265-4703bd1557ea fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:00:52.766072+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=19bda5bc-fcc4-4bb8-9f14-2f4d52a2b0e0 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:08:35.655039+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=5e69f860-dc72-4af3-9040-b1f0ae8af8e4 fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:08:39.157957+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=2b372932-2ce2-4d45-9cdd-4f59b4422d76 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:09:45.451328+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=d4de5c0a-c590-4b14-adc0-739cbe859feb fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:09:52.145707+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=1392d710-b0b4-4a77-a01e-735041d98433 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:10:00.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T09:10:26.434601+00:00 app[api]: Deploy 9d697adf by user smschavan143@
gmail.com
2018-04-10T09:10:26.434601+00:00 app[api]: Release v7 created by user smschavan1
43@gmail.com
2018-04-10T09:10:00.000000+00:00 app[api]: Build succeeded
2018-04-10T09:10:47.723358+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=b0f6be6e-393e-4416-b4d3-edb759292fa6 fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:10:51.163961+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=cf906ebf-a5b9-42d3-98d7-0df7229e3d1e fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:10:56.992860+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=ce6d8b95-7508-
dynamic-33012) by user smschavan143@gmail.com
2018-04-10T08:41:50.953604+00:00 app[api]: Release v3 created by user smschavan1
43@gmail.com
2018-04-10T08:41:51.193509+00:00 app[api]: Deploy 76360db4 by user smschavan143@
gmail.com
2018-04-10T08:41:51.193509+00:00 app[api]: Release v4 created by user smschavan1
43@gmail.com
2018-04-10T08:41:23.000000+00:00 app[api]: Build succeeded
2018-04-10T08:51:00.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T08:51:00.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-10T08:52:35.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T08:53:00.830250+00:00 app[api]: Deploy 3885895d by user smschavan143@
gmail.com
2018-04-10T08:53:00.830250+00:00 app[api]: Release v5 created by user smschavan1
43@gmail.com
2018-04-10T08:52:35.000000+00:00 app[api]: Build succeeded
2018-04-10T08:59:46.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T09:00:10.571878+00:00 app[api]: Release v6 created by user smschavan1
43@gmail.com
2018-04-10T09:00:10.571878+00:00 app[api]: Deploy bbae6e49 by user smschavan143@
gmail.com
2018-04-10T08:59:46.000000+00:00 app[api]: Build succeeded
2018-04-10T09:00:48.993535+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=c3052a19-a59a-4cef-8265-4703bd1557ea fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:00:52.766072+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=19bda5bc-fcc4-4bb8-9f14-2f4d52a2b0e0 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:08:35.655039+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=5e69f860-dc72-4af3-9040-b1f0ae8af8e4 fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:08:39.157957+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=2b372932-2ce2-4d45-9cdd-4f59b4422d76 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:09:45.451328+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=d4de5c0a-c590-4b14-adc0-739cbe859feb fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:09:52.145707+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=1392d710-b0b4-4a77-a01e-735041d98433 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:10:00.000000+00:00 app[api]: Build started by user smschavan143@gm
ail.com
2018-04-10T09:10:26.434601+00:00 app[api]: Deploy 9d697adf by user smschavan143@
gmail.com
2018-04-10T09:10:26.434601+00:00 app[api]: Release v7 created by user smschavan1
43@gmail.com
2018-04-10T09:10:00.000000+00:00 app[api]: Build succeeded
2018-04-10T09:10:47.723358+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=b0f6be6e-393e-4416-b4d3-edb759292fa6 fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:10:51.163961+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=cf906ebf-a5b9-42d3-98d7-0df7229e3d1e fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
2018-04-10T09:10:56.992860+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/" host=kiran-portfolio.herokuapp.com reques
t_id=ce6d8b95-7508-
4e1e-8610-684369b3e0cd fwd="45.117.31.196" dyno= connect= ser
vice= status=503 bytes= protocol=https
2018-04-10T09:10:58.488848+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=9e1727a7-806d-490d-94ee-8a779beb21a8 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
Thanks,
/r/django
https://redd.it/8b6bvh
vice= status=503 bytes= protocol=https
2018-04-10T09:10:58.488848+00:00 heroku[router]: at=error code=H14 desc="No web
processes running" method=GET path="/favicon.ico" host=kiran-portfolio.herokuapp
.com request_id=9e1727a7-806d-490d-94ee-8a779beb21a8 fwd="45.117.31.196" dyno= c
onnect= service= status=503 bytes= protocol=https
Thanks,
/r/django
https://redd.it/8b6bvh
reddit
Heroku Django application error! • r/django
Hey guys i have created my first django website! and i want to upload it through Heroku, So i followed everything they said to me and i am still...
Stream BTC prices over WebSockets with Python and Lomond
https://www.willmcgugan.com/blog/tech/post/stream-btc-prices-over-websockets-with-python-and-lomond/
/r/Python
https://redd.it/8b6pig
https://www.willmcgugan.com/blog/tech/post/stream-btc-prices-over-websockets-with-python-and-lomond/
/r/Python
https://redd.it/8b6pig
Will McGugan Tech
Stream BTC prices over WebSockets with Python and Lomond
<p>Monitor your ₿ with Python</p>
What are some simple django-based blog projects which developers starting in webdev can use?
I am looking to start a django-based blog and would like to see if people have any recommendations for "ready-made" projects. Something like this as an example: https://github.com/miguelgfierro/sciblog.
My objective is to get the blog up and running as soon as possible and customize it with time. My theoretical webdev knowledge is good although I have zero practical experience and I want to take this opportunity to learn.
What are some simple django-based blog projects which developers new to webdev can start with?
/r/django
https://redd.it/8b7jt8
I am looking to start a django-based blog and would like to see if people have any recommendations for "ready-made" projects. Something like this as an example: https://github.com/miguelgfierro/sciblog.
My objective is to get the blog up and running as soon as possible and customize it with time. My theoretical webdev knowledge is good although I have zero practical experience and I want to take this opportunity to learn.
What are some simple django-based blog projects which developers new to webdev can start with?
/r/django
https://redd.it/8b7jt8
GitHub
GitHub - miguelgfierro/sciblog: A blog made with django designed like a scientific paper written in LaTeX.
A blog made with django designed like a scientific paper written in LaTeX. - miguelgfierro/sciblog
Anyone use Okta? Is it as easy as Flask-Login?
I'm just starting out with Flask, have found using Flask-Login really easy and pretty cool. But I'm worried about data protection, and thought using Okta might reduce liability. Anyone doing the same? Can it integrate with Flask-Login? The workflow for Okta looks pretty heavy - any opinions?
/r/flask
https://redd.it/8b7ik6
I'm just starting out with Flask, have found using Flask-Login really easy and pretty cool. But I'm worried about data protection, and thought using Okta might reduce liability. Anyone doing the same? Can it integrate with Flask-Login? The workflow for Okta looks pretty heavy - any opinions?
/r/flask
https://redd.it/8b7ik6
reddit
Anyone use Okta? Is it as easy as Flask-Login? • r/flask
I'm just starting out with Flask, have found using Flask-Login really easy and pretty cool. But I'm worried about data protection, and thought...
Best library for creating charts
Hi, I'm doing the final touches of a website (a 3-buildings warehouse) and I tought it would be cool to generate charts for a quick visualization of some of the information. I did a bit of googling to search what's the best library for Django and I found a lot of them, mainly Highcharts, Dash/Plotly, D3JS, Charts.js and many more.
What's the best (and easy to implement) library to create charts in a Django website you've ever used?
/r/django
https://redd.it/8b8nxq
Hi, I'm doing the final touches of a website (a 3-buildings warehouse) and I tought it would be cool to generate charts for a quick visualization of some of the information. I did a bit of googling to search what's the best library for Django and I found a lot of them, mainly Highcharts, Dash/Plotly, D3JS, Charts.js and many more.
What's the best (and easy to implement) library to create charts in a Django website you've ever used?
/r/django
https://redd.it/8b8nxq
reddit
Best library for creating charts • r/django
Hi, I'm doing the final touches of a website (a 3-buildings warehouse) and I tought it would be cool to generate charts for a quick visualization...
What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/8b7uc8
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/8b7uc8
reddit
What's everyone working on this week? • r/Python
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your...
Heroku Procfile automatically turns to .txt file
Hey guys i have been changing the Procfile name on Heroku with no extension through the cmd but every time i do a "git push heroku master" automatically the Procfile turns to Procfile.txt! What could have caused the problem?
/r/djangolearning
https://redd.it/8b7nz7
Hey guys i have been changing the Procfile name on Heroku with no extension through the cmd but every time i do a "git push heroku master" automatically the Procfile turns to Procfile.txt! What could have caused the problem?
/r/djangolearning
https://redd.it/8b7nz7
reddit
Heroku Procfile automatically turns to .txt file • r/djangolearning
Hey guys i have been changing the Procfile name on Heroku with no extension through the cmd but every time i do a "git push heroku master"...
Red Hat Confirms RHEL 8 Will Drop Python 2
https://www.phoronix.com/scan.php?page=news_item&px=RHEL-8-No-Python-2
/r/Python
https://redd.it/8bb6oq
https://www.phoronix.com/scan.php?page=news_item&px=RHEL-8-No-Python-2
/r/Python
https://redd.it/8bb6oq
Phoronix
Red Hat Confirms RHEL 8 Will Drop Python 2 - Phoronix
Phoronix is the leading technology website for Linux hardware reviews, open-source news, Linux benchmarks, open-source benchmarks, and computer hardware tests.
How do I configure Jupyter Notebooks to open in a browser?
When I open a Jupyter Notebook, I want it to open in a new tab of an existing Firefox window. In my ~/.jupyter/jupyter_notebook_config.py file, I try
c.NotebookApp.browser = '/usr/bin/firefox'
With this, I get a popup error from Firefox to the effect that "Firefox is already running", which isn't unexpected. You need to use command line flags to affect an already existing instance of Firefox, so I try
c.NotebookApp.browser = '/usr/bin/firefox -P default -new-tab'
When I do this, the terminal output from Jupyter gives the error
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/firefox -P default -new-tab': '/usr/bin/firefox -P default -new-tab'
How do I tell Jupyter to open Firefox with command-line options?
/r/JupyterNotebooks
https://redd.it/8b8mtq
When I open a Jupyter Notebook, I want it to open in a new tab of an existing Firefox window. In my ~/.jupyter/jupyter_notebook_config.py file, I try
c.NotebookApp.browser = '/usr/bin/firefox'
With this, I get a popup error from Firefox to the effect that "Firefox is already running", which isn't unexpected. You need to use command line flags to affect an already existing instance of Firefox, so I try
c.NotebookApp.browser = '/usr/bin/firefox -P default -new-tab'
When I do this, the terminal output from Jupyter gives the error
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/firefox -P default -new-tab': '/usr/bin/firefox -P default -new-tab'
How do I tell Jupyter to open Firefox with command-line options?
/r/JupyterNotebooks
https://redd.it/8b8mtq
reddit
How do I configure Jupyter Notebooks to open... • r/JupyterNotebooks
When I open a Jupyter Notebook, I want it to open in a new tab of an existing Firefox window. In my ~/.jupyter/jupyter_notebook_config.py file, I...
Best way to handle file uploads?
Im trying to setup image uploads in a local Flask app with Flask-uploads. I think Im almost there but not able to finish it.
This is my form (using flask_wtf):
class AddBookForm(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
author = StringField('Author', validators=[DataRequired()])
category = StringField('Category', validators=[DataRequired()])
image = FileField('Image', validators=[FileRequired()])
this is my template:
<form action="/upload" method="post" enctype="multipart/form-data" >
<span class="btn btn-default btn-file">
Browse <input type="file" name="image">
</span>
<input type="submit" value="Upload your image" class="btn btn-primary">
</form>
and then finally these are the important bits from views.py:
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES, UploadNotAllowed
photos = UploadSet('photos', IMAGES, default_dest=lambda app: os.path.basename('uploads'))
configure_uploads(app, (photos,))
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'POST' and 'image' in request.files:
filename = photos.save(request.files['image'])
rec = Photo(filename=filename, user=g.user.id)
rec.store()
flash("Photo saved.")
return redirect(url_for('show', id=rec.id))
return render_template('upload.html')
@app.route('/photo/<id>')
def show(id):
photo = Photo.load(id)
if photo is None:
abort(404)
url = photos.url(photo.filename)
return render_template('show.html', url=url, photo=photo)
As it stands right now when I go to /upload and fill in the form with an image the file does actually get uploaded to my 'uploads' directory in my app but this error is shown in the console:
File "/Users/david/Documents/projects/flask_store/storeapp/views.py", line 236, in upload
rec = Photo(filename=filename, user=g.user.id)
NameError: name 'Photo' is not defined
there is no object named 'Photo' but if I changed the fields in my from from 'image' to 'photo' then try and upload an image again I get no errors that time but the image doesn't get uploaded to the local 'uploads' directory.
What am I missing here?
thanks
/r/flask
https://redd.it/8b8l7l
Im trying to setup image uploads in a local Flask app with Flask-uploads. I think Im almost there but not able to finish it.
This is my form (using flask_wtf):
class AddBookForm(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
author = StringField('Author', validators=[DataRequired()])
category = StringField('Category', validators=[DataRequired()])
image = FileField('Image', validators=[FileRequired()])
this is my template:
<form action="/upload" method="post" enctype="multipart/form-data" >
<span class="btn btn-default btn-file">
Browse <input type="file" name="image">
</span>
<input type="submit" value="Upload your image" class="btn btn-primary">
</form>
and then finally these are the important bits from views.py:
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES, UploadNotAllowed
photos = UploadSet('photos', IMAGES, default_dest=lambda app: os.path.basename('uploads'))
configure_uploads(app, (photos,))
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'POST' and 'image' in request.files:
filename = photos.save(request.files['image'])
rec = Photo(filename=filename, user=g.user.id)
rec.store()
flash("Photo saved.")
return redirect(url_for('show', id=rec.id))
return render_template('upload.html')
@app.route('/photo/<id>')
def show(id):
photo = Photo.load(id)
if photo is None:
abort(404)
url = photos.url(photo.filename)
return render_template('show.html', url=url, photo=photo)
As it stands right now when I go to /upload and fill in the form with an image the file does actually get uploaded to my 'uploads' directory in my app but this error is shown in the console:
File "/Users/david/Documents/projects/flask_store/storeapp/views.py", line 236, in upload
rec = Photo(filename=filename, user=g.user.id)
NameError: name 'Photo' is not defined
there is no object named 'Photo' but if I changed the fields in my from from 'image' to 'photo' then try and upload an image again I get no errors that time but the image doesn't get uploaded to the local 'uploads' directory.
What am I missing here?
thanks
/r/flask
https://redd.it/8b8l7l
reddit
Best way to handle file uploads? • r/flask
Im trying to setup image uploads in a local Flask app with Flask-uploads. I think Im almost there but not able to finish it. This is my form...
Flask and nodejs
Ok i have been reading online and i see that a lot of people and alot of companies are switching to nodejs im not a professional web developer but i like to build for personal use and for learning.
Is flask or django dying and what are the benefits of nodejs over flask (which is what i use)
/r/flask
https://redd.it/8b0pc9
Ok i have been reading online and i see that a lot of people and alot of companies are switching to nodejs im not a professional web developer but i like to build for personal use and for learning.
Is flask or django dying and what are the benefits of nodejs over flask (which is what i use)
/r/flask
https://redd.it/8b0pc9
reddit
Flask and nodejs • r/flask
Ok i have been reading online and i see that a lot of people and alot of companies are switching to nodejs im not a professional web developer but...
Improving SyntaxError in PyPy
https://morepypy.blogspot.com.au/2018/04/improving-syntaxerror-in-pypy.html
/r/Python
https://redd.it/8bar30
https://morepypy.blogspot.com.au/2018/04/improving-syntaxerror-in-pypy.html
/r/Python
https://redd.it/8bar30
morepypy.blogspot.co.uk
Improving SyntaxError in PyPy
For the last year, my halftime job has been to teach non-CS uni students to program in Python. While doing that, I have been trying to see ...
RedHat 7.5 release notes warn Python 3 will replace Python 2 in next major release
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.5_release_notes/chap-red_hat_enterprise_linux-7.5_release_notes-architectures
/r/Python
https://redd.it/8bbbt6
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.5_release_notes/chap-red_hat_enterprise_linux-7.5_release_notes-architectures
/r/Python
https://redd.it/8bbbt6
Red Hat Customer Portal
Chapter 2. Architectures Red Hat Enterprise Linux 7 | Red Hat Customer Portal
The Red Hat Customer Portal delivers the knowledge, expertise, and guidance available through your Red Hat subscription.
How do you figure out whether the duck needs to quack?
I have been using Python for a while and am loving it. However, as I begin to use old code or other people's code, I have found that it is getting really difficult to determine the interface people use since they rarely explicitly state it.
In Java the interface is made explicit and you can easily look-up what methods and types you need to define in order to expand or use another piece of code. But in Python, I have been spending a painful amount of time tracing through every part of a program to try and find out what methods I need for the object I am passing to some function. And if I miss a method I may not realize it till down the road when some obscure piece of code gets hit at run-time and I find out my object didn't have all that it needed.
Am I missing something here? Is there some proper way to Python so that the object interface is obvious? Are other people just not writing good Python code?
I feel like 'duck' typing is one of the biggest assets of Python, as it lets you work with objects based on how they function, but it seems exceedingly difficult to actually figure out whether the duck is supposed to quack or not.
Note: PyCharm is okay for some of this, but really doesn't hack it for anything but the simplest programs. And should it really be left to the IDE for something so important?
/r/Python
https://redd.it/8bebmr
I have been using Python for a while and am loving it. However, as I begin to use old code or other people's code, I have found that it is getting really difficult to determine the interface people use since they rarely explicitly state it.
In Java the interface is made explicit and you can easily look-up what methods and types you need to define in order to expand or use another piece of code. But in Python, I have been spending a painful amount of time tracing through every part of a program to try and find out what methods I need for the object I am passing to some function. And if I miss a method I may not realize it till down the road when some obscure piece of code gets hit at run-time and I find out my object didn't have all that it needed.
Am I missing something here? Is there some proper way to Python so that the object interface is obvious? Are other people just not writing good Python code?
I feel like 'duck' typing is one of the biggest assets of Python, as it lets you work with objects based on how they function, but it seems exceedingly difficult to actually figure out whether the duck is supposed to quack or not.
Note: PyCharm is okay for some of this, but really doesn't hack it for anything but the simplest programs. And should it really be left to the IDE for something so important?
/r/Python
https://redd.it/8bebmr
reddit
How do you figure out whether the duck needs to quack? • r/Python
I have been using Python for a while and am loving it. However, as I begin to use old code or other people's code, I have found that it is getting...
[AF] SQLite Database Singleton
I've been cobbling together a Flask App which uses SQLite. I was wondering if someone would be prepared to weigh in on my current method of accessing the database - using a singleton?
Basically I am creating a Database singleton in *before_first_request* which connects to the database calling *sqlite3.connect()*.
I've noticed that in the Flask docs they provide an [SQLite example](http://flask.pocoo.org/docs/0.12/patterns/sqlite3/) which stores the database against the *flask.g* object.
My main concern with my approach would be with regard to thread safety, which I presume will depend heavily on the server I intend to use in production?
This flask docs article seems to be focused on connecting to the db on demand - but if requests to my app will always need to access the database, then I would assume its better to connect only once?
/r/flask
https://redd.it/89f1be
I've been cobbling together a Flask App which uses SQLite. I was wondering if someone would be prepared to weigh in on my current method of accessing the database - using a singleton?
Basically I am creating a Database singleton in *before_first_request* which connects to the database calling *sqlite3.connect()*.
I've noticed that in the Flask docs they provide an [SQLite example](http://flask.pocoo.org/docs/0.12/patterns/sqlite3/) which stores the database against the *flask.g* object.
My main concern with my approach would be with regard to thread safety, which I presume will depend heavily on the server I intend to use in production?
This flask docs article seems to be focused on connecting to the db on demand - but if requests to my app will always need to access the database, then I would assume its better to connect only once?
/r/flask
https://redd.it/89f1be
asyncio/aiohttp question
Hello, I am new to django and python in general. My django back-end calls amazon api and returns parsed response to front-end. Now I have to make it asynchronous.
My view looks something like this (very simplified):
class AmazonSearchAPI(viewsets.ViewSet):
def get_products(self, request):
response = requests.get(request_params)
return Response(response, status=HTTP_200_OK)
Question is, do I need aiohttp? Can I just add asyncio and write "async def get_products(self, request)"?
/r/django
https://redd.it/8bfgp8
Hello, I am new to django and python in general. My django back-end calls amazon api and returns parsed response to front-end. Now I have to make it asynchronous.
My view looks something like this (very simplified):
class AmazonSearchAPI(viewsets.ViewSet):
def get_products(self, request):
response = requests.get(request_params)
return Response(response, status=HTTP_200_OK)
Question is, do I need aiohttp? Can I just add asyncio and write "async def get_products(self, request)"?
/r/django
https://redd.it/8bfgp8
reddit
asyncio/aiohttp question • r/django
Hello, I am new to django and python in general. My django back-end calls amazon api and returns parsed response to front-end. Now I have to make...
[P] Deep reinforcement Learning course: Q-learning article and DQN with Doom notebook are published
Hello, I'm currently writing a series of free articles about Deep Reinforcement Learning, where we'll learn the main algorithms (from Q* learning to PPO), and how to implement them in Tensorflow.
The second article is published, it's about Q-learning and we'll learn to **implement a Q-learning algorithm with Numpy and OpenAI Gym.**
**Q-learning article**: https://medium.freecodecamp.org/diving-deeper-into-reinforcement-learning-with-q-learning-c18d0db58efe
Moreover, the third article (Deep Q Learning with Doom) will be published **this week**, but the implementation of a Doom playing agent with Tensorflow **is already published.**
**Doom Deep Q agent**: https://github.com/simoninithomas/Deep_reinforcement_learning_Course/blob/master/DQN%20Doom/Deep%20Q%20learning%20with%20Doom.ipynb
Let me know what you think! What architectures you want and any feedback.
**The Syllabus**: https://simoninithomas.github.io/Deep_reinforcement_learning_Course/
**Introduction to Reinforcement Learning**: https://medium.freecodecamp.org/an-introduction-to-reinforcement-learning-4339519de419
Thanks!
/r/MachineLearning
https://redd.it/8beohl
Hello, I'm currently writing a series of free articles about Deep Reinforcement Learning, where we'll learn the main algorithms (from Q* learning to PPO), and how to implement them in Tensorflow.
The second article is published, it's about Q-learning and we'll learn to **implement a Q-learning algorithm with Numpy and OpenAI Gym.**
**Q-learning article**: https://medium.freecodecamp.org/diving-deeper-into-reinforcement-learning-with-q-learning-c18d0db58efe
Moreover, the third article (Deep Q Learning with Doom) will be published **this week**, but the implementation of a Doom playing agent with Tensorflow **is already published.**
**Doom Deep Q agent**: https://github.com/simoninithomas/Deep_reinforcement_learning_Course/blob/master/DQN%20Doom/Deep%20Q%20learning%20with%20Doom.ipynb
Let me know what you think! What architectures you want and any feedback.
**The Syllabus**: https://simoninithomas.github.io/Deep_reinforcement_learning_Course/
**Introduction to Reinforcement Learning**: https://medium.freecodecamp.org/an-introduction-to-reinforcement-learning-4339519de419
Thanks!
/r/MachineLearning
https://redd.it/8beohl
freeCodeCamp.org
Diving deeper into Reinforcement Learning with Q-Learning
by Thomas Simonini Diving deeper into Reinforcement Learning with Q-Learning > This article is part of Deep Reinforcement Learning Course with Tensorflow ?️. Check the syllabus here. [https://simoninithomas.github.io/Deep_reinforcement_learning_Course/] Today…
Documenting a Django Rest Framework API
I'm using DRF for the first time to create a read-only API. It all works fine, but I'm trying to work out how to automatically generate some documentation for it.
I've got a Swagger UI page up and running using [django-rest-swagger](https://marcgibbons.com/django-rest-swagger/), which is OK... but some of my API endpoints have optional GET arguments and I can't see any way to document those in a nice way. I can mention them in comments on my DRF Views, but I thought there'd be a way to format them nicely, maybe have them appear as fields in the Swagger UI, like `lookup_url_kwarg`s do.
I'm going round in circles, reading the DRF [Documenting your API documentation](http://www.django-rest-framework.org/topics/documenting-your-api/), all the third-party tools they mention there, laborious workarounds like [this](https://github.com/m-haziq/django-rest-swagger-docs#advance-usage)...
Does anyone have a good, thorough example of how to nicely document a DRF API?
/r/django
https://redd.it/8b9kjo
I'm using DRF for the first time to create a read-only API. It all works fine, but I'm trying to work out how to automatically generate some documentation for it.
I've got a Swagger UI page up and running using [django-rest-swagger](https://marcgibbons.com/django-rest-swagger/), which is OK... but some of my API endpoints have optional GET arguments and I can't see any way to document those in a nice way. I can mention them in comments on my DRF Views, but I thought there'd be a way to format them nicely, maybe have them appear as fields in the Swagger UI, like `lookup_url_kwarg`s do.
I'm going round in circles, reading the DRF [Documenting your API documentation](http://www.django-rest-framework.org/topics/documenting-your-api/), all the third-party tools they mention there, laborious workarounds like [this](https://github.com/m-haziq/django-rest-swagger-docs#advance-usage)...
Does anyone have a good, thorough example of how to nicely document a DRF API?
/r/django
https://redd.it/8b9kjo
Marcgibbons
Django REST Swagger
Swagger UI / OpenAPI Documentation for Django REST Framework