Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Android app, PyFCM, Flask, MySql

Hello everyone! I go straight to the point: I use pythonanywhere.com and I'm developing an application for Android that interfaces with a Python server that uses Flask.

The application makes extensive use of json to get data from the database and I would a notification on the device when a row has been added to a table and a notification when a row already downloaded has been changed.

I imagine it is too expensive to do a service that checks every interval if the json on the server are the same as those already downloaded, so I came to the conclusion (at least for the first notification) to listen on the database and launch a notification from the server when an INSERT query was performed on a given table. If the user is interested then he will give the ok to download the new json.

My problem is that I did not understand how I can properly use the tools written in the title to do this, or at least what is the most effective way to get what I described and I would like to receive some advice from those more experienced than me .

Thanks in advance!

/r/flask
https://redd.it/8c3dd2
Interactive Graphs

I am building some regressions and machine learning networks. For visualization purposes, I wanted to show a graph of the true values versus the predicted values of different methods. Rather than just a scatter plot with 5 different lines, I was wondering if there are any guides out there to build a graph where you can click a button with the name of the method, and it overlays the line of the predicted values of that method.

Thanks!

/r/IPython
https://redd.it/8d0vdy
Is it possible to remove brainfuck from list of Languages in notebook?

Not the Kernel, i mean the list if languages used in the text editor for syntax highlighting. I suspect my employer would prefer that particular four-letter word not being in the list.

Thanks

/r/JupyterNotebooks
https://redd.it/8d53aq
What are the topics that are not currently relevant and what are other topics that needs to be added to this learning journey?[X-Post from r/learnmachinelearning]

I have tried looking at many learning resources including [Open Data science Masters](http://datasciencemasters.org/) among others. But i found [this](http://nirvacana.com/thoughts/wp-content/uploads/2018/01/RoadToDataScientist1.png) particular path where topics are represented as metro stops and all the journey as a metro map. This covers the list of topics which i felt were not very broadly classified and not narrow at the same time.

My query now is the [blog](http://nirvacana.com/thoughts/2013/07/08/becoming-a-data-scientist/) by author was written in 2013 which makes it 5 years old. What are the topics that got obsolete and what topics should be added to this map to make it more relevant to current time.?


/r/pystats
https://redd.it/8cyluq
Django, DRF, and React Native together?

Hi, currently using the above to work on a senior project and I'm trying to build on my understanding of there tools working together and just wanna see if anyone can clear up some questions.

Have a signup and login screens so far, I've created a user model and the views and urls and the fields all match on both ends. I have a react native front that i want to use fetch to get the django urls i have defined. I'm using a serializer of my models to return a json. When I manage.py runserver I can navigate into the URL i have defined and the json response will show up in my browser. Now when I put that api into the fetch in the react native side I get an error about the server not being able to connect to dev server. so like fetch(localhost/app/user)

I tried to follow a few tutorials which got me far on both ends but now i want to glue them together. I read documentations but there's not much that discusses these working together in a version as detailed as I'd hoped for.

Does anyone have experience with these working together?

Do I need to change the ports for the django and/or react native server when they're running simultaneously on my local machine(for development purposes)? After I can get them linked, I create a user model on my react front it matches the user model on my django, how do I check that its inserted into my sqlite DB? Do I have to do anything on the django side to set up the db?

I know its a lot to ask without seeing my entire code, but if anyone has any tips on how to get this tool stack working together I'd appreciate it.

Thanks.

/r/django
https://redd.it/8d7ypo
Is there a way to make radioField within for loop ? if possible how to set the values for them?



/r/flask
https://redd.it/8d81jw
Adding a CMS solution to existing Django.

Can someone help me locate a CMS solution/add on the an existing standard Django system?

It seems everything I'm finding is a purely stand alone CMS system built on Django. What I have is an existing website that I want to add a managed blog to with a nice WYSIWYG editor for our marketing people.

If you can help point me in the right direction I greatly appreciate your time.

/r/django
https://redd.it/8d9b5w
[Ask Flask] Context_processor usage brings up a TypeError?

Hi, so I'm working on a website which allows users to make and delete posts. The delete function should be accessible using a link below said post, much like posts on Reddit, so I wrote this line in my index.html file:

<p><a href={{ delete_posts(post_id=post.id) }}>Delete</a><p>

The delete_posts function is here:

@app.context_processor
def utility_processor():
def delete_posts(post_id):
post = Post.query.filter_by(id=post_id).first()
if post != None: # This statement was added after the error was found, but it has no effect
db.session.delete(post)
db.session.commit()

When I run this I get the following error:

> TypeError: 'NoneType' object is not iterable

I was using the example on the flask website, so I'm expecting it has something to do with the database being used?

Here is a link to the full html file, and a .txt file containing the error.

https://gist.github.com/ModoUnreal/031741e6a8fe6277a786f11e6261c7f5

/r/flask
https://redd.it/8c1fiy
[AF] SQLAlchemy: Converting a query object to raw SQL & parameters and then executing it

I hope that it is OK to post this question here, although it is not strictly related to Flask. I couldn't find a better place to post it.

Context: Flask, SQLAlchemy and MySQL

I am looking for a way to convert a query object to raw SQL and parameters and save this in a dictionary, in order to be able to pickle dump and load the dictionary before executing the query. How can I achieve converting the query and then executing the text and parameters with SQLAlcehmy?

I'd be eternally grateful if anyone could point me in the right direction.

/r/flask
https://redd.it/8dewj6