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
QQ - global-scope variable in views.py?

Long story short, I've got a list of <whatever> I want to randomize and pass in to my template in a few different views.

I obviously don't want to repeat this list in every view. I understand that in this scope if I'm calling \`list.shuffle()\` and throwing it into templates, I'm playing with fire. I know that should be fine, but its probably a bad practice.


I thought of making it a "constant", and then just making sure I do a deep copy before calling shuffle on it and passing it to the templates, but I'm not sure that's ideal either.


What's the cleanest way to do this? The context data is style/css related, so I don't want it with the model.

/r/django
https://redd.it/gt8s7d
This media is not supported in your browser
VIEW IN TELEGRAM
To everyone who is learning python right now, with enough practice you too can create a masterpiece like this.

/r/Python
https://redd.it/gsxzjq
This media is not supported in your browser
VIEW IN TELEGRAM
[R] AutoSweep: Recovering 3D Editable Objects from a Single Photograph

/r/MachineLearning
https://redd.it/gtaq94
Retrieving data from html forms without rendering templates

So we have this homework where we have to retrieve data from an html form, after sending the file as 'send_static_file'. However, we are not supposed to use flask templates at all. Is there any way to do this?

/r/flask
https://redd.it/gt9wmf
Can I use a file server without any software like NGINX?

We have a server that we plan to serve our static files. I want to ask what's the point of using a web server software like NGINX?

Why it is recommended if it is not necesarry?

/r/django
https://redd.it/gtbpn1
Django REST Framework got hacked

DRF's website got hacked with a page displaying a page of African American people got killed by police "I presume". Does anyone know when it will be back?

&#x200B;

&#x200B;

https://preview.redd.it/s631vkjxlx151.png?width=704&format=png&auto=webp&s=e7cad0638da27fc076ca450c38ba9990897ac411

/r/django
https://redd.it/gthakw
Python performance comparison in my project's unittest (via Gitlab CI/CD)

/r/Python
https://redd.it/gtgsot
This media is not supported in your browser
VIEW IN TELEGRAM
Deploy as many Django websites as you want with one simple command

/r/django
https://redd.it/gtguph
Where is the "default project template"?

The Django [docs](https://docs.djangoproject.com/en/3.0/ref/contrib/admin/) for the admin site say

> The admin is enabled in the default project template used by `startproject`.
>
If you’re not using the default project template, here are the requirements: [...]


This "default project template" is not defined. What is the default project template named, and where is it located? Web search and Docs search are turning up nothing.

/r/djangolearning
https://redd.it/gtdvgh
This media is not supported in your browser
VIEW IN TELEGRAM
A Hangman AI that tries to solve words given by the user!

/r/Python
https://redd.it/gtie5f
[D] Zero-Shot Learning for Text Classification

Hi everyone,

With GPT-3 released, there has been a renewed interest in zero-shot learning in the NLP community. I've written a summary of one of the earlier papers that proposed zero-shot text classification. Please check it out and share your feedback.

Article: https://amitness.com/2020/05/zero-shot-text-classification/

/r/MachineLearning
https://redd.it/gtij5d
What to use for front end development to make it easy and clean? Do nice html/css templates exist? Easy frameworks that work well with django?

I am a software developer that primarily develops applications. I am new to web apps so it might be no surprise to you I have 0 experience with front end development. Ideally, I would like to make the process as easy as possible. I like "minimalist" web app design which could also mean simpler front end code.

I have seen some suggestions online to use React with django? I have heard of people using bootstrap as well? I quite honestly don't know anything more about these 2 frameworks than what you can learn in a google search. I'm genuinely curious if the django community has a consensus on what to use if you are a backend developer looking to make front ends quickly and easily...

Thank you :)

/r/django
https://redd.it/gtpnsx
Two forms csrf token non-unique id chrome warning

Hi,

When using two flask forms on one page chrome is giving warning about non-unique ids of csrf id field. Is there any way to change the id of csrf field.

Or do I just ignore the error ?

/r/flask
https://redd.it/gtjwbt
Need Help! Jupyter Notebook shutting down immediately after opening.

So here is the detailed problem
I have installed anaconda package.
As soon as I click on the jupyter/anaconda, a little window pops up and exits immediately within a second.

Please help if you know the solution

/r/JupyterNotebooks
https://redd.it/gtv5mz
Any up to date tutorial on web scraping?

A lot of the tutorials I have found thus far are either out of date or confused me due to the websites they used being updated

/r/Python
https://redd.it/gttql2
This media is not supported in your browser
VIEW IN TELEGRAM
I created the first cross-platform Python library to create native context menus!

/r/Python
https://redd.it/gtzk7v
What is the best way to create Django + React project?

I wonder how to create django and react website, I know there is way when you create django app called frontend and put all react stuff there, but I'm not sure if it's the most convenient way.

/r/django
https://redd.it/gtwwyr
This media is not supported in your browser
VIEW IN TELEGRAM
[Update] Shooting pose analysis and basketball shot detection web App and API with Flask [GitHub repo in comment]

/r/flask
https://redd.it/gu055f
I configured my terminal to teach me a new word everyday! Every time I open a new terminal window, I have a python script that scrapes dictionary.com and gives me the word of the day. On top of that, I have a motivational quote displayed as well :)

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