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
# 3
# 4
# 5
# 6
# 7
# 8
# 9
# 10
Online Text Multiplayer RPG engine?

What would you use if you wanted to making something like Kingdom of Loathing , a browser-based rpg with light multiplayer interactions ?

/r/Python
https://redd.it/7fdkux
Push notifications in django

I want to use Firebase to send push notifications, and I see fcm django, but I dont find how to associate device with user.
Thanks.

/r/django
https://redd.it/7fgugj
[AF] Posted Indicator

So I have coded my own forum for my Python Flask site. Problem is I can't figure out how to do it so that I can have an indicator next to posts if the user has already posted in that post. I have a separate table for the thread (main post) and then the replies.

SELECT tid, fid, subject, prefix, forums_topics.username, datetime, lastpost, lastposter,
replies, closed, sticky, avatar FROM forums_topics,users WHERE
users.username=lastposter AND forums_topics.fid = ? ORDER BY sticky DESC,lastpost DESC

That is my currently SQLite statement to get the list of threads for the forum page.

Anyone know how I could modify the SQLite statement to solve the issue.

/r/flask
https://redd.it/7ffz41
Does anyone know of an open source DRF project which implements user registration really well? I'm struggling to find one that's more production hardened...



/r/django
https://redd.it/7fhsfr
Graphs/Charts on webpage

Hey is there a way to display graphs or charts on a webpage? I have dug around a little and the libraries I found seemed like the cost to use for production. I was wondering if I could use seaborne or something for them.

I’m trying to display metrics of my objects so like total counts and how maybe are stock and deployed. I would like my homepage be a dashboard.

/r/django
https://redd.it/7fk0x0
[AF]How to work with an API and routes

I'm trying to develop a REST API using Flask. I chose this framework since I like python to do common tasks, also Flask seems easier than Django.

The goal of developing a REST API is to later consume it from a webpage and from an android/iOS app (as you may see is a big personal project).

I'm having a hard time thinking of how the consumption of the api should be since I don't know anything about front nor backend.

Here goes my question:

Suppose I have this route - mydomain.com/api/1.0/tasks. This route is made to return a json with all the tasks. I was thinking of defining an html page with a button and when the button is pressed, the action of that button equals a route of the shape mydomain.com/tasks...this route internally calls the api, the api returns a json to the function inside that route. then that json is passed as an argument to a render_template('tasks.html',json) and finally that render_template is returned. Is that correct? Or maybe a frontend framework like angular/react is capable of handling and presenting a json?

I need a bit of guidance in how to desing the api to work with views.

If any of you need any further details dont hesitate to ask, I really need to work this out.

/r/flask
https://redd.it/7anx2j