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
Published my first Python package to PyPI

Today I uploaded my first package to [PyPI](https://pypi.org/project/HelloFlask/). It's small a package called HelloFlask!

All this package does, is automate the following tasks:

* sets up a python virtual environment for the user.
* installs Flask, and python-dotenv.
* installs other third party libraries needed by the user.
* Creates a barebones Flask project, by copying some code snippets.

Github Repo: [https://github.com/ElMehdi19/HelloFlask](https://github.com/ElMehdi19/HelloFlask)

[Usage output](https://preview.redd.it/eu2avegoyym51.png?width=979&format=png&auto=webp&s=51cefc60f6f6e9469ed2ea02805f77b2cc6408b5)

/r/flask
https://redd.it/is5cpv
[D] Machine Learning - WAYR (What Are You Reading) - Week 95

This is a place to share machine learning research papers, journals, and articles that you're reading this week. If it relates to what you're researching, by all means elaborate and give us your insight, otherwise it could just be an interesting paper you've read.

Please try to provide some insight from your understanding and please don't post things which are present in wiki.

Preferably you should link the arxiv page (not the PDF, you can easily access the PDF from the summary page but not the other way around) or any other pertinent links.

Previous weeks :

|1-10|11-20|21-30|31-40|41-50|51-60|61-70|71-80|81-90|91-100|
|----|-----|-----|-----|-----|-----|-----|-----|-----|------|
|[Week 1](https://www.reddit.com/4qyjiq)|[Week 11](https://www.reddit.com/57xw56)|[Week 21](https://www.reddit.com/60ildf)|[Week 31](https://www.reddit.com/6s0k1u)|[Week 41](https://www.reddit.com/7tn2ax)|[Week 51](https://reddit.com/9s9el5)|[Week 61](https://reddit.com/bfsx4z)|[Week 71](https://reddit.com/d7vno3)|[Week 81](https://reddit.com/f1f0iq)|[Week 91](https://reddit.com/hlt38o)||||||||
|[Week 2](https://www.reddit.com/4s2xqm)|[Week 12](https://www.reddit.com/5acb1t)|[Week 22](https://www.reddit.com/64jwde)|[Week 32](https://www.reddit.com/72ab5y)|[Week 42](https://www.reddit.com/7wvjfk)|[Week 52](https://reddit.com/a4opot)|[Week 62](https://reddit.com/bl29ov)|[Week 72](https://reddit.com/de8h48)|[Week 82](https://reddit.com/f8fs6z)|[Week 92](https://reddit.com/hu6zq9)||
|[Week 3](https://www.reddit.com/4t7mqm)|[Week 13](https://www.reddit.com/5cwfb6)|[Week 23](https://www.reddit.com/674331)|[Week 33](https://www.reddit.com/75405d)|[Week 43](https://www.reddit.com/807ex4)|[Week 53](https://reddit.com/a8yaro)|[Week 63](https://reddit.com/bqlb3v)|[Week 73](https://reddit.com/dkox1s)|[Week 83](https://reddit.com/ffi41b)|[Week 93](https://reddit.com/iaz892)||
|[Week 4](https://www.reddit.com/4ub2kw)|[Week 14](https://www.reddit.com/5fc5mh)|[Week 24](https://www.reddit.com/68hhhb)|[Week 34](https://www.reddit.com/782js9)|[Week 44](https://reddit.com/8aluhs)|[Week 54](https://reddit.com/ad9ssz)|[Week 64](https://reddit.com/bw1jm7)|[Week 74](https://reddit.com/dr6nca)|[Week 84](https://reddit.com/fn62r1)|[Week 94](https://reddit.com/ijjcep)||
|[Week 5](https://www.reddit.com/4xomf7)|[Week 15](https://www.reddit.com/5hy4ur)|[Week 25](https://www.reddit.com/69teiz)|[Week 35](https://www.reddit.com/7b0av0)|[Week 45](https://reddit.com/8tnnez)|[Week 55](https://reddit.com/ai29gi)|[Week 65](https://reddit.com/c7itkk)|[Week 75](https://reddit.com/dxshkg)|[Week 85](https://reddit.com/fvk7j6)||
|[Week 6](https://www.reddit.com/4zcyvk)|[Week 16](https://www.reddit.com/5kd6vd)|[Week 26](https://www.reddit.com/6d7nb1)|[Week 36](https://www.reddit.com/7e3fx6)|[Week 46](https://reddit.com/8x48oj)|[Week 56](https://reddit.com/ap8ctk)|[Week 66](https://reddit.com/cd7gko)|[Week 76](https://reddit.com/e4nmyk)|[Week 86](https://reddit.com/g4eavg)||
|[Week 7](https://www.reddit.com/52t6mo)|[Week 17](https://www.reddit.com/5ob7dx)|[Week 27](https://www.reddit.com/6gngwc)|[Week 37](https://www.reddit.com/7hcc2c)|[Week 47](https://reddit.com/910jmh)|[Week 57](https://reddit.com/auci7c)|[Week 67](https://reddit.com/cj0kyc)|[Week 77](https://reddit.com/eb4lxk)|[Week 87](https://reddit.com/gcx3uf)||
|[Week 8](https://www.reddit.com/53heol)|[Week 18](https://www.reddit.com/5r14yd)|[Week 28](https://www.reddit.com/6jgdva)|[Week 38](https://www.reddit.com/7kgcqr)|[Week 48](https://reddit.com/94up0g)|[Week 58](https://reddit.com/azjoht)|[Week 68](https://reddit.com/cp1jex)|[Week 78](https://reddit.com/ehbfst)|[Week 88](https://reddit.com/glm6sv)||
|[Week 9](https://www.reddit.com/54kvsu)|[Week 19](https://www.reddit.com/5tt9cz)|[Week 29](https://www.reddit.com/6m9l1v)|[Week 39](https://www.reddit.com/7nayri)|[Week 49](https://reddit.com/98n2rt)|[Week 59](https://reddit.com/b50r5y)|[Week 69](https://reddit.com/cvde5a)|[Week 79](https://reddit.com/entcxy)|[Week 89](https://reddit.com/gu5t0d)||
|[Week
Flask Deployment on IIS

Hi Guys, I'm trying to deploy the Flask app using IIS web server. but, I'm facing the below error. How to fix this? i have only one file [app.py](https://app.py) ,app.log in my project [folder. to](https://folder.to) fix this issue i have re-installed the library , verified the path etc..


Error occurred while reading WSGI handler: Traceback (most recent call last): File "c:\python37\lib\site-packages\wfastcgi.py", line 791, in main env, handler = read_wsgi_handler(response.physical_path) File "c:\python37\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler handler = get_wsgi_handler(os.getenv("WSGI_HANDLER")) File "c:\python37\lib\site-packages\wfastcgi.py", line 616, in get_wsgi_handler raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb)) ValueError: "my_app.app" could not be imported: Traceback (most recent call last): File "c:\python37\lib\site-packages\wfastcgi.py", line 600, in get_wsgi_handler handler = __import__(module_name, fromlist=[name_list[0][0]]) File ".\my_app.py", line 1, in <module> from flask import Flask File "c:\python37\lib\site-packages\flask\__init__.py", line 14, in <module> from jinja2 import escape ModuleNotFoundError: No module named 'jinja2' StdOut: StdErr:

/r/flask
https://redd.it/ishvbk
404 Not Found Error

Here is what I have and I keep getting:

Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

&#x200B;

&#x200B;

https://preview.redd.it/3dzx4wgbm4n51.png?width=466&format=png&auto=webp&s=ee7af3c43c6d77e1ed4883c4fb204c574256f6c1

&#x200B;

&#x200B;

https://preview.redd.it/5httatjol4n51.png?width=264&format=png&auto=webp&s=a669e7b4fdb33768c8ac0b3d3589b405fbb2b4ee

I'm following along with a tutorial and have ensured everything is exactly the same. Any ideas? I've tried stack overflow and YouTube and haven't had any luck. I appreciate the help.

/r/flask
https://redd.it/ismbwj
How to build a simple Hacker News clone using Django 3 - Video

Hi everyone, just released a new video tutorial :-)

Hacker News is a very cool community. It's where all the coolest new things are being shared. Have you ever thought about building your own version of the site?

In this Django tutorial I will show you how to build a simple Hacker News clone using Django 3. I will begin by setting up a virtual environment to work in and then build the project piece by piece.

I hope this sounds like an exciting project to build. You should be able to follow along this video, even if you're a beginner. I try to explain everything I do, but if you have a question or you're stuck, feel free to leave a comment below :-)

YouTube link:
[https://www.youtube.com/watch?v=292GB6snFYo](https://www.youtube.com/watch?v=292GB6snFYo)

Todo list for this video:
\-Create and setup a virtual environment and install Django.
\-Create a new django project and create folders for the base structure
\-Create a django app for the core views and base template for the whole application
\-Make it possible to sign up, login and log out
\-Create a django app for the stories (submissions)
\-Make it possible to submit a story
\-Show the best

/r/djangolearning
https://redd.it/ise5bd
Monday megathread: Project ideas!

Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code!

/r/Python
https://redd.it/is9t2a
[JupyterLab] Bootstrapping work before the spawner starts - change default working directory of terminal

Hello everyone,

We are trying to change the default working directory of users when they start their terminals on JupyterLab. Host machine is a Linux. It looks like this is the option:

#c.Spawner.pre_spawn_hook = None

from subprocess import check_call
def my_hook(spawner):
username = spawner.user.name
check_call(['./examples/bootstrap-script/bootstrap.sh', username])

c.Spawner.pre_spawn_hook = my_hook


Is there any way to append the following line to user's */home/user/.bash_profile* file:

cd /Users/path/toyourstartfolder/

I assume this option can do the trick. Is there any other way to accomplish that?
Thanks.

/r/IPython
https://redd.it/isk5m7
File storage with a Flask REST Api

Hi Everyone,

I've recently been working on a Flask REST API for a project and I've come to a road block. I'm wondering how I might handle if I wanted to serve files to the user, in this case pdf format. What is a common way to do such a thing, initially I though for example in my SQL table to store the filename extension and then somehow serve the file that way but I was wondering what solutions you would consider best practice? Thanks

/r/flask
https://redd.it/isp719
[D] RTX 3090, RTX 3080, RTX 3070 Deep Learning Workstation Guide

[Lambda's RTX 3090, 3080, and 3070 Deep Learning Workstation Guide](https://lambdalabs.com/blog/deep-learning-hardware-deep-dive-rtx-30xx/)

**Blower GPU versions are stuck in R & D with thermal issues**

* Lambda is working closely with OEMs, but RTX 3090 and 3080 blowers may not be possible.
* RTX 3070s blowers will likely launch in 1-3 months.

**4x GPUs workstations:**

* *4x RTX 3090/3080* is not practical. Typical home/office circuits will be overloaded. Moreover, there aren't any PSUs that can support this power draw at standard home/office voltages.
* *4x RTX 3070* may require the currently unavailable blower edition.

**3x GPU workstations:**

* *3x RTX 3090:* Will require liquid cooling or PCIe extenders to fit/achieve proper thermals.
* *3x RTX 3080:* Will require liquid cooling or PCIe extenders to achieve proper thermals. A two-slot blower edition may enable a 3x air-cooled workstation without extenders, but it's currently stuck in R & D with overheating problems.
* *3x RTX 3070s:* Will likely work out of the gate, even without blowers -- but leave a PCIe slot empty between cards.

**1x/2x workstations**

* Cooling should be relatively straightforward if you leave proper space between GPUs.

**RTX 30XX performance vs. the RTX 2080 Ti:**

* *RTX 3090 (24 GB):* 1.57x faster for convnets and 1.5x faster for transformers.\*
* *RTX 3080 (10 GB):* 1.4x faster for

/r/MachineLearning
https://redd.it/isq8x0
I am excited to share my 8th published book, Python 101, geared for beginners and intermediate level readers

/r/Python
https://redd.it/isbjm4
I am Looking for an example app using Django-filter, django-tables, and django-crispy-forms.

Can someone point me to example apps with source code using all three of these together?

Django-filter, django-tables, django-crispy-forms.

&#x200B;

[https://github.com/carltongibson/django-filter](https://github.com/carltongibson/django-filter)

[https://github.com/jieter/django-tables2](https://github.com/jieter/django-tables2)

[https://github.com/django-crispy-forms/django-crispy-forms/](https://github.com/django-crispy-forms/django-crispy-forms/)

/r/django
https://redd.it/isua9y
Tuesday megathread: Advanced questions

Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.

**If your question is a beginner question we hold a beginner megathread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.**

/r/Python
https://redd.it/isxcbx
Does Beautiful Soup web scraping refresh the page?

I’m web scraping a website that has a live tracking ticker (count of subscribers).

I read somewhere that web scraping refreshes the page which makes the web developers “unhappy”. However, since I’m simply monitoring a css label.... is it still messing up something on the user side? Possibly giving him too much traffic?

/r/Python
https://redd.it/it53iw
[R] New ML algorithms developed by Facebook, Linkedin, Google Maps, Twitter, Amazon, and Pinterest

Found some interesting research presentations that showcase new machine learning models developed and applied by these internet companies to tackle real-world problems.

* [TIES: Temporal Interaction Embeddings For Enhancing Social Media Integrity At Facebook](https://crossminds.ai/video/5f3369780576dd25aef288cf/) (ML model for preventing the spread of misinformation, fake account detection, and reducing ads payment risks at **Facebook**)
* [BusTr: predicting bus travel times from real-time traffic](https://crossminds.ai/video/5f3369790576dd25aef288db/) (ML model for translating traffic forecasts into predictions of bus delays in **Google Maps** for areas without official real-time bus tracking)
* [Ads Allocation in Feed via Constrained Optimization](https://crossminds.ai/video/5f33697a0576dd25aef288ea/) (Evaluating a set of algorithms for **LinkedIn** newsfeed ads serving for an optimal balance of revenue and user engagement)
* [SimClusters: Community-Based Representations for Heterogeneous Recommendations at Twitter](https://crossminds.ai/video/5f3369790576dd25aef288d5/) (A more accurate & faster algorithm for community discovery and personalized recommendations at **Twitter**)
* [Shop The Look: Building a Large Scale Visual Shopping System at Pinterest](https://crossminds.ai/video/5f3369790576dd25aef288d7/) (AI system behind **Pinterest**'s online visual shopping discovery service)
* [AutoKnow: Self-Driving Knowledge Collection for Products of Thousands of Types](https://crossminds.ai/video/5f3369730576dd25aef288a6/) (An automatic, scalable, and integrative knowledge graph for massive product knowledge collection at **Amazon**)

p.s. You can find paper URLs in the video notes.

/r/MachineLearning
https://redd.it/it44ix
Trying to get username for a query in a form.

Hi,

I have the following form which I've made after reading stackoverflow questions.

class PayForm(forms.Form):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop('user',None)
super(PayForm, self).__init__(*args, **kwargs)

print(self.user)

date = forms.DateField()
total = forms.IntegerField()
#company = forms.ModelMultipleChoiceField(Company.objects.filter(employees=self.user))

my issue is I get a name error for self when I uncomment company, the init seems to work but it appears to be called after the variables are set. anyone have a clue what's up with this?

basically what i'm trying to do is this:

I have a model for companies, in that model I have a manytoomany field which can be populated by several usernames, in my form I only want that user to be be able to select companies that contain this user.

/r/djangolearning
https://redd.it/it9c5m