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
Thinking of switching from PythonAnywhere to Digital Ocean

I've been using PythonAnywhere for my sites, and I am really happy with it's performance and ease of use. However, I think I want to have a little more control (Celery, free PostgreSQL database, understanding what's going on) and scalability for future apps. I saw that DigitalOcean looks like a perfect option for this. Does anyone recommend the switch. What should I know if I am doing this and anyone have experience or tips with the switch? Obviously there is a lot more you have to setup in the beginning, but I think this might be a necessary switch if I want to take it to the next level and have more advanced features.

/r/django
https://redd.it/krsqeh
Thursday Daily Thread: Python careers!

Discussion of using Python in a professional environment, getting jobs in Python and more!

This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.

/r/Python
https://redd.it/ks0oqk
"Automate the Boring Stuff with Python" online course is free to sign up for the next few days with code JAN2021FREE

https://inventwithpython.com/automateudemy (This link will automatically redirect you to the latest discount code.)

You can also click this link or manually enter the code: JAN2021FREE

https://www.udemy.com/course/automate/?couponCode=JAN2021FREE

This promo code works until the 4th (I can't extend it past that). Sometimes it takes an hour or so for the code to become active just after I create it, so if it doesn't work, go ahead and try again a while later. I'll change it to JAN2021FREE2 in three days.

Udemy has changed their coupon policies, and I'm now only allowed to make 3 coupon codes each month with several restrictions. Hence why each code only lasts 3 days. I won't be able to make codes after this period, but I will be making free codes next month. Meanwhile, the first 15 of the course's 50 videos are free on YouTube.

You can also purchase the course at a discount using my code JAN2021CODE or clicking https://inventwithpython.com/automateudemy to redirect to the latest discount code. I have to manually renew this each month (until I get that automation script done). And the cheapest I can offer the course is about $16 to $18. (Meanwhile, this lets Udemy undercut my discount by offering it for $12, and I don't get

/r/Python
https://redd.it/krs96a
Did something change about Jupyter's startup scripts in 3.0?

I use Jupyter with many environments which have various packages I would like to just have imported by a startup script, but since there is no guarantee that any/all of them are in any particular environment, so my startup script looks like this:

import importlib

from IPython.core.getipython import get_ipython
from IPython.utils.importstring import import_item

importable_modules = filter(
lambda m: importlib.util.find_spec(m[0]),
(
("toolz",) * 2,
("more_itertools",) * 2,
("numpy", "np"),
("pandas", "pd"),
("sqlalchemy", "sa"),
("holoviews", "hv"),
("traitlets",) * 2,
("ipywidgets",

/r/IPython
https://redd.it/krtxvk
I made a script that creates a video with the latest cryptocurrency news and upload to YouTube every 6 hours

As my first serious project in Python, I just released a new YouTube channel powered by a script which grab the latest news in the cryptocurrency space, renders a video with Moviepy, generates a thumbnail with Pillow and upload itself to YouTube every six hours.
I would like to share with you guys and ask for your feedbacks and thoughts, since Reddit's community means a lot to me in terms of learning!

Check it out!

/r/Python
https://redd.it/ks09ey
D What is the best practice regarding hyperparameter tuning for baseline models?

Hey guys, I've developed a topic model that is a PGM so it doesn't have that many hyperparameters, (think something like LDA) so of course I've tuned them but not extensively, just trying different values to get it to converge, no grid search or anything (it works well for a range of hyperparameters anyways). Also I'm using just one set of hyperparameters for all 5 datasets.

I guess the question is how much hyperparameter tuning do I have to perform for the baseline models for a fair comparison? Right now all the baseline models work well after minor adjustments or even with default values, once again same set of hyperparameters for all 5 datasets, all except for the 'neural' topic models (like ProdLDA). In fact ProdLDA performs poorly on all 5 of the datasets I'm testing on (with the hyperparameters from their code), even though it performs well on the dataset that they use in their paper. So I do have a suspicion that the model may have been tuned specifically for that dataset.

How am I supposed to deal with this? Like I suppose I shouldn't give the neural topic models special treatment, but at the same time, do I have

/r/MachineLearning
https://redd.it/ks8ily
How to use machine learning in your django app?

Hi , I am intermediate in django and I mostly use django rest framework.I just wanted to ask how can I use machine learning in my django backend?I mean something like a recommendation system?

/r/django
https://redd.it/ksbigz
What do I gain with Heroku VS legacy VPS like Linode, AWS ec2 or DO ?

Hi guys,

I'm not by any mean a Linux administrator but I run archlinux as my main OS and know a little bit of bash scripting as well. I've deployed my 2 last projects over Linode and AWS ec2 without too much difficulties.

I've also tested Heroku free tier just to test how it works, it's indeed surprisingly fast to deploy on it using django-heroku but apart from the easy first deployment I wonder what do I really gain by using it ? Maybe I'm not aware of some problems that are hard to manually manage when your have lots of users and really go live.

Thanks in advance !

/r/django
https://redd.it/ksljbg
Friday Daily Thread: Free chat Friday!

Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!

/r/Python
https://redd.it/ksqcxt
Today is my first day learning coding and I am awestruck.

Okay, so I'm a freshman in uni who was just vibing at home during winter break in quarantine with absolutely nothing to do. I'm scrolling on Youtube and I come across this 4 hour long video from freeCodeCamp.org about Python, and on a whim, I decide to just see what the computer science hype is all about. And-

BRO

BRO

I don't know what I expected coding to be, but this is fricking awesome. It just makes me baffled how I can just make stuff on my computer that has never existed in the history of the computer!

Like, I just learned about inputs, and I wrote this whole funny conversation with my computer about how horrible my high school was (btw she was very sassy, and yes, I do have many unrepressed feelings about that place LOL). Anyways, I don't know if this is the right place to showcase my immense exuberance, but I guess I now do understand what all the hype is about.

/r/Python
https://redd.it/ks94qq
Could not import models from the same folder in Django

I cannot import my models in my api/views.py of my products app. Every folders and subfolders are shown in the image here.

​

[Products app folder](https://preview.redd.it/5xwg6ybst1a61.png?width=390&format=png&auto=webp&s=2dc5b795bfa8f0409725fc25132684331a4edb65)

​



My api\\views.py is

from products.models import *

class CategoryAPIView(ListAPIView):
queryset = Category (cant import Category)

/r/djangolearning
https://redd.it/kswin3
What DRF offers more than DJango itself?

Hello,
I am using Django Rest and now that I came to bottleneck because of lot of data I will have to use normal serializer instead of ModelSerializer.

So I am wondering what DRF offers that Django alone doesn't offer? Is there any reasons I should use DRF instead of simply returning JSON with Django alone?

/r/django
https://redd.it/ksl5lt
My list of resources for building a full to-do list app with Flask

Here are some of my early resources for learning Flask. With theses and the foundation of python, html and css, you should be well on your way to create your own fully functional todo list application. This is no small thing. A todo list, being a database driven application, is the foundation for a lot of popular use cases such as social networking apps, project management apps, blogs, etc.

The Official Flask tutorial. Good but constricting boilerplate:
https://flask.palletsprojects.com/en/1.1.x/tutorial/

A more informal CRUD tutorial but with an easy-to-follow workflow:
https://www.digitalocean.com/community/tutorials/build-a-crud-web-app-with-python-and-flask-part-one
https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-two
https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-three

A tutorial for getting a quick Flask App online with python anywhere:
https://blog.pythonanywhere.com/121/https://blog.pythonanywhere.com/158/

The Mega Tutorial. A bit wordy for me but lot's of best practices are there:
https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

/r/flask
https://redd.it/kstdo0
D Confused about doing a PhD during these times

I get that many people have asked whether it's worth it of doing a PhD in ML, but today I'm heavily conflicted in whether I should go for it or not.

Long story short, I've graduated in september with the french equivalent of an MS in mechanical engineering.
After having a few discussions about ML with one the professors of my uni during the past few months, he told me that he might have a PhD subject concerning applied ML for predictive maintenance/reliability engineering coming up. (Yes it's different here than the US, you apply to a PhD offer which usually have the subject properly defined)
And to add to this, it is what we call a CIFRE in France, which is basically a PhD with a partnership between the lab and a company. (The most notable difference is that you typically are considered an employee of the said company, and have more or less the same pay than a regular engineer)

The field of ML applied to the industry is really something I want to work in, but I don't want to do the dumb mistake of rushing for a PhD because the job market sucks and that finding a job

/r/MachineLearning
https://redd.it/ksyn9h
How can I make Admin page be rendered only for one specific user?

Hi there!

I am trying to learn Flask and I am currently stuck on making the Admin page be rendered only if userid == 1. However, it seems like this line: admin = Admin(app) makes my admin be rendered no matter what condition I add. I added :

if 'loggedin' in session and session['id'\] == 1:
return render_template('home.html', username=session['username'\])

However, it seems to ignore the condition. Can anyone help me out a little bit? Thank you so much in advance!

/r/flask
https://redd.it/kt4na5