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
Thoughts on using Django as a backend for a React/React Native location based app?

**Background**

I am more proficient in Django, and have begun looking into React in the past week. It looks like an exciting way to create a rich UI/UX + the ability to easily port to a native mobile experience with React Native. The tradeoff appears to be the added complexity that React brings to front end development (at least initially - I'd love some thoughts on this).

​

**My app**

* Will have a web interface
* However 95% of the usage will be from native mobile apps that would make requests back to the server
* 99% of my data will be geo spatial in nature - points & routes - so I was thinking of leveraging GeoDjango
* The app will be using location data intensively (pinging user location like every 5 minutes for hours).

​

**My question**

Does it make sense to use Django + Postgres for the backend/db to ultimately a mainly react/mobile experience? Or should I look more towards a full JS option? I have no idea what JS server framework I'd use, I am just raising the question to make sure I'm not missing a better solution to my problem.

​

Thanks in advance for your thoughts -

/r/django
https://redd.it/apgky8
Here we go

/r/Python
https://redd.it/apndyq
Using Alembic to migrate money stored in Dollars as Floats to Money stored in Cents as BigInt?

I think the title says it all, but I really don't want to mess with this stuff without some sort of verdict.

I need to transfer some pricing data, currently stored as Floats, into BigInts using alembic.

I know HOW to do the migration, in the sense that I know how to change the floats to bigints - but what about the users who have their data stored as Floats currently - what's going to happen?

Is it possible to use alembic to transform those floats by some simple Python script (say like, int(old_value*100)) in my Alembic upgrade?

Thanks!

/r/flask
https://redd.it/apnjvs
Image won't render with copy-pasted code unless I go to Edit > Insert Image

Hello everyone, I was trying to render an image by copying the code

![1.png](attachment:1.png)

and pasting it to my cell however nothing happens. It's only when I manually do Edit > Insert Image that it works... Is there a way to make images load through code?

Also can I make it like `![](attachment:1.png)` instead?

Thanks!

/r/IPython
https://redd.it/appegh
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/aptowq
We're not that bad

/r/Python
https://redd.it/apt413
Question : Exactly how much of the tasks should be done in templates

I am a beginner and still learning flask. So this might come off as a stupid question.

Jinja supports s bit of python-like code to be added to the html files. Depending on the coding style of the user, he/she can use multiple for loops and if-else blocks in templates.

In what kind of cases should the code be in jinja templates vs in route handlers.

Are there some best practices to be followed as to where to do what tasks(in templates vs route handlers)

​

Sorry for my poor English. Thank You :)

/r/flask
https://redd.it/apump6
Python joke in How to Kill the Dragon with 9 Programming Languages

I'm sure developers have seen [this](https://blog.toggl.com/kill-dragon-comic/) comic strip, they also have the GIT princess comic.

I don't understand the part about Python, is the underlying joke about importing libraries for a specific task?

/r/Python
https://redd.it/apw2b0