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
Django tutorial videos by Nigel George, author of "Mastering Django"
https://www.youtube.com/channel/UCiuZer2ELlG3dAhWCzwz9Og/videos

/r/django
https://redd.it/beih8j
Suitable tattoo

/r/Python
https://redd.it/beiazl
Python script + Azure ad sso

Hey everyone,


I browsed the sub, stackoverflow and whatever I saw related but with no luck, so its time for a post.

I'm trying to work on a webscrapper that gets some static data from a few URLS, however to access them you first need your microsoft authentication done which is shared for all the pages..


Overall its simple up un till you get to the authentication step... problem comes that the accounts that would use this have MFA attached which sends push notifications, doing it with a simple user+pass account seemed easy, but thats not what I need sadly... I looked over the azure documentation, adal library and all sorts of solutions but I could not find a way to even trigger the push notification on my phone..

Only way i've gotten it to work is to use selenium to simulate the user access, but thats not what I want generally speaking.. Anyone has any tips to share with me? :)

​

Thanks

/r/Python
https://redd.it/bejqy6
Python programmers, what's a regular day in your job like?

Like the title says: I'm not a python programmer myself, I'm a motion designer who learned (and learned to love) using python, and I'm considering a change of carrier. However I know that doing something you like as a job is much different than doing it as a hobby, hence my question: what's it like to be a python professional?

/r/Python
https://redd.it/belx64
[AF] Anyone know how to use WTForms MultipleFileField?

There's no documentation other than "it works like FielField but for multiple files". Does anyone have an example for how to access raw data from the multiple uploaded files?

/r/flask
https://redd.it/beagm2
Keeping track of what rating each User gave to each Movie, where Users and Movies can be added at any time?

What field will do this job? A onetoone field? Manytoone? Manytomany?

Basically, let's say I'm building a site where users rate movies. Each user gives each movie a rating (or lack thereof) and different users can have different rating for each movie. New users are joining all the time. New movies are also being added all the time.

The default rating for all his/her movies when a new user joins is "None". The default rating from all users when a new movie is added is also "None".

I also want to quickly look up what the average rating a particular movie has gotten across all users that rated it. And similarly, look up the average rating a user has given for all movies he/she rated.

(Ok, I'm actually not building a movie rating app but that's the closest example I can think of to describe this type of data structure that I have no idea what to call and hence cannot rely on Google for answers, hence that's why I'm asking here.)

/r/djangolearning
https://redd.it/begpts
Django Admin - Hide For Unauthorized People

Hi. I created a Django webserver which will go online soon. I want to raise a 404 on the admin page when the user is not logged in. I have my own login-service and only admins should be able to access the admin page.

I mean this:

**Normal User, Logged out:**

\-> 404

**Normal User, Logged in:**

\-> 404

**Admin User, Logged out:**

\-> 404

**Admin User, Logged in:**

\-> Access

​

Do you have any idea how to do this?

Thanks.

/r/django
https://redd.it/bepmlt
R processes left over after nbconvert

I have a notebook running some R code every night on a server using nbconvert. For some reason when the job is done there's still an R process running in the background. I end up just killing them all every other week or so after they've piled up.

Has anyone else experienced this before? Is there a way to make sure that these are ended when the nbconvert finishes?

/r/JupyterNotebooks
https://redd.it/ber4rb
Jupyter Notebook dot notation dropdown menu arrowkeys problem

Hi guys,

I didn’t know where else to turn, I couldn’t find anything online about this small problem I’m having with jupyter notebook.

When I tab and open the dropdown menu to see the options for the dot notation I can’t scroll through the options with my arrow keys like I see in vids. I can’t do this on my computer, but on my laptop I don’t have this issue. Is it some option I accidentally turned off or something? Thanks.

/r/JupyterNotebooks
https://redd.it/benrfl
Having some trouble with my production server and NGINX with Google Search Console

Hey /r/Django,

​

I have recently put my Django site on production and configured it with NGINX so that it redirects from port 80 to port 8000, so that the URL doens't have to contain the port number when accessing it. I recently was trying to set up the google search console to index my website, and the crawl worked perfectly fine when I put in the URL with port 8000 \[[http://example.com:8000/\]](http://website.com:8000/]), however I get a: `This page is not in the index, but not because of an error. See the details below to learn why it wasn't indexed. Learn More` error when I try to crawl the website default [http://](http://website.com/)[example](http://website.com:8000/])[.com/](http://website.com/). So in essence it isn't crawling when I use the url without the 8000 port even though I can access my site perfectly fine without the port 8000 now.

​

I have spent quite some time researching on this specific issue however I think there is something that I am missing that I might not know about and hope that somebody can point me in the right direction. This is very new to me, I can post relevant information if needed however I would appreciate any guidance in further assisting me with this

/r/django
https://redd.it/beub5v
Why Use Anaconda?

Hi, I'm pretty new to python and I was wondering why do you use Anaconda and should I use it, and also what are some downsides of it

/r/Python
https://redd.it/betkoj
reqparse parser.add_argument()

Hi everyone,

​

I am not sure I understand how to user parser correctly. My confusion is: when adding arguments to the parser, say:

parser.add_argument('username', help = 'This field cannot be blank', required = True)

how does flask know to only look for the required argument in a specific route (in this case /login) ?

I haven't really tested it, but if I have multiple required arguments for different routes, I wonder if the application knows which ones are required for that route.

I would appreciate some help understanding this :) Thank you and happy holiday!

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