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
Video sharing platform in Flask

For the last month, I've been working on a Video Sharing Platform, a bit like YouTube.

Uses can upload videos and flag videos uploaded by other users. There's a dashboard page where they can see their view count and few settings to change password and delete account.

Upvotes and downvotes will be added soon.

Administrators can delete users and flagged videos if necessary.

I would be grateful if you could look at it and provide me with any feedback on how to make it better or more efficient.

P.S. - The video uploading is synchronous at the moment. Can't seem to get it work asynchronously.

[Github Link](https://github.com/sharadbhat/Video-Sharing-Platform)

/r/flask
https://redd.it/7m9ca1
Run python script daily?

Hello!

I created a python script to check whether or not there are any new albums released by the artists in my public playlists on Spotify using the spotipy api (https://github.com/plamere/spotipy).

However I need to run the script daily in order for it to check if there are any new albums available and email me if so. What would be the easiest and cheapest way to run this program daily? The program works by saving the current days dictionary which has the artist as the key and the number of albums as the value to a csv file. It then reads in the previous days csv file and compares them.

Basically what is the easiest way to run this program once a day where I can store and load csv files as well? I have been trying to find something to what I need but I cannot. Any tutorial links or advice would be appreciated.

Thank you in advance!

/r/Python
https://redd.it/7mc15g
After trying to learn from multiple tutorials I’m so frustrated. I’ll pay someone to tutor me.

Pm me your rates. Must speak English. I have hosting and already know python.

/r/djangolearning
https://redd.it/7lpzcy
django-admin.py or django-admin without .py?

When I first started using Django, I picked up the habit of writing

django-admin.py startproject my_project .

Now I'm seeing this written without the .py:

django-admin startproject my_project .

I noticed this changed in the tutorial starting with Django 1.8, but keeping the .py works on my system in 2.0.

Is there a clear recommendation to use the `django-admin` command without the .py?

/r/django
https://redd.it/7mg8q7
Best Python setup for young programmer

We got my young (13 y/o) sibling (who has a strong math interest) a computer, so naturally I bought the [Python for Kids](https://www.nostarch.com/pythonforkids) book (as well as [Doing Math With Python](https://www.nostarch.com/doingmathwithpython)).

The problem now is the python setup. I initially installed Anaconda and PyCharm, but realized that it was a bit more complicated (for a 13 year old) that I anticipated (virtual environments and what-not).

Whats the recommended python setup for kids (on windows 10). Im assuming IDLE? But what about installing modules? Is there any super user friendly IDE (or the like) software that they can use?

Edit: the issue isn't editing code, Notepad++, atom, sublime, or any of non-IDE text editors should do fine. The issue is easily (think push-button) running the code. I learned C/C++ on Bloodshead C++ IDE if that gives a better picture of what I'm thinking.

/r/Python
https://redd.it/7mhs16
Webapp with DRF: ending up with too many view-specific serializers?

As stated in the title, my webapp is built on DRF, and though I **love** how easy serializers are to use, I feel like I'm almost creating specialized serializers for the data each view needs. The alternative seems to be to have one serializer that returns an overkill amount of data and have the front end deal with sorting out what it needs vs doesnt need.

for example: I have a Client (C) model and it has a related OnboardingStatus (OS) model and a AccountStatistics (AS) model. I can either make 3 serializers to send C alone/C+OS/C+AS
**OR** I can make 1 serializer that sends C+OS+AS all the time. (I simplified here, my data is bigger and a bit more nested)

How do the fine redditors of /r/django deal with this issue? Is there a smarter way that I'm not seeing?

/r/django
https://redd.it/7me9f8
Matplot lib - how to replicate Exzel ability to display (x,y) when you mouse over a data point?

Is this even a possibility? Thanks.

/r/Python
https://redd.it/7mjv0j
Can fields have attributes?

A quick introduction for my question:

Creating a financial app. Main model is Company, with a child called Balancesheet. In the balancesheet I have fields like "cash", "goodwill" and other accounting stuff.

Items in the balancesheet can be classified into financial and operating assets. Cash is a financial asset. I want a way to give cash that attribute. And other fields might have the attribute of an operating asset.

Do I really have to create a child model for every item on the balancesheet just to give them this attribute?

/r/django
https://redd.it/7mkk35
Creating a .exe file from a .py file keeps failing

I'm about to lose my mind here. I've become quite proficient in Python over the past few months but for the life me I cannot create a .exe file from my Python files. I have tried watching dozens of YouTube tutorials, looked at 100s of examples, websites and forums and absolutely nothing works. I tried using setup.py examples from the internet, pyinstaller, cx_Freeze, pyBuilder, py2exe and pynsist.

Pynsist is the only one that never gave me errors but it did not create a .exe file for my application. All the other applications either give me blank folders, IndexError: tuple out of range errors, or no commands supplied errors. I tried the command: python setup.py build and the exe it created just produces a ModuleNotFoundError message.

What could I be doing wrong or where can I go to get this done properly. Because right now I'm beginning to think this impossible to do. Is there a tool that can be used to do this that ACTUALLY works and actually explains how to do this? What can I do?

I am running Python 3.6, and the ".exe" files these modules create only seem to work on my computer, not on anyone elses', even if they have Python on them. At best it opens Code Writer on other computers I have tested my .exes on.

/r/Python
https://redd.it/7mliro
ELI5: What are the benefits of Redis, and how do you use it with RDBMS?

Let's say I have a PostGIS database with a lot related models. Would I have to basically aggregate that data into NoSQL type models to store them in redis? At what point do you move the data from models to Redis?

Note that I am a redis nooblet, so my understanding may be wrong... Just trying to figure out if it even makes sense for me to learn and implement redis. Thanks.

Ninja edit: Also, I guess geographical searches should still be handled by Django's GIS rather than me rewriting it all in Redis, if I go ahead and use that. How do you guys manage it?

/r/django
https://redd.it/7mm71s