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 Knox Auth with social logins

Hello,

I built an application using the Django Rest Framework that uses the Django Knox package for authentication. Now I would like to enable additional authentication options like social logins with Google or Facebook. Is it possible to combine these with Django Knox?

I have been looking for answers to this question for a while but all I come across is Django AllAuth. Now I don't really understand whether Knox and AllAuth are mutually exclusive.

Any tips are appreciated!

/r/django
https://redd.it/l78t5s
I'm working on a web app that will send users emails sometimes. Any related packages you recommend for this?



/r/flask
https://redd.it/l74tgf
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/l7d6e7
Flask Library to make uploading files to your db & server quick and simple

​

Flask File Upload

Hi guys,

If you require a library to make uploading files with Flask super easy then please take a look at flask-file-upload

https://github.com/joegasewicz/flask-file-upload

This library is active & new feature requests are more than welcome, as is your feedback!

thanks for looking

Joe

/r/flask
https://redd.it/l7dho5
How to show a number labels for a notebook?

Sorry if this is too simple but I've been trying to look for an answer for this and I just cannot find it anywhere.

I'm gonna give a simple tutorial for some scipy stuff on jupyter notebook and I want my students to know which cell of the notebook I'm at. The input/output number of the cell doesn't help since it changes according to the number of cells you've run before.

Thank you for your answers.

/r/JupyterNotebooks
https://redd.it/l7g354
Iterate throught all objects

how can I iterate through all django objects and change a value for them?

/r/django
https://redd.it/l7nlrv
Starting celery, celery beat in google app engine?

We want to host a Django app using Google App Engine, using celery with redis task broker. Celery, and celery beat can be started locally using scripts/commands, but how do we start the same on the app engine?
The documentation handles python 2.7, so we are a bit in the dark, so things are a bit in the dark. Can someone help me out?

/r/django
https://redd.it/l7s6xd
Just launched Buzzbomb, my B2B platform built with Django (took 3 months to code!!)

Hey guys,

🎉 I just launched https://buzzbomb.com/ on Product Hunt, you can see it here! https://www.producthunt.com/posts/influencers-by-buzzbomb

So happy to have finally launched after coding for 3 months (although I guess there's more to come). I will be posting about the journey on my YouTube channel (including all the revenue metrics) if you want to follow along.

I'm trying to build 12 Startups in 12 Months for 2021 so yeah - will be an interesting year 😅. Next month I will be doing a daily video on my YouTube channel on the coding progress (sort of like a personal standup diary), but which also be showing the code I write etc. if you're interested!

I built this with Django + Vue.js, Django has my heart and will be using it for all the projects I build!

/r/django
https://redd.it/l7vc04
This post has:


Hello! I made a little Program
which gets statistics about this post!
It should be update every 20 seconds.

This post has 654 Upvotes!
-----
It has 81 Downvotes
-----
and 117 comments!
-----

The 3 top comments are from:

1. u/BimphyRedixler

|_Upvotes: 129

|_First word: I

|_Last word: account

2. u/Exodus111

|_Upvotes: 36

|_First word: EditingThisToSeeIfICangeTheFirstWordSetting.

|_Last word: AlsoChangingThisLOL!😂

3. u/CaminoFr

|_Upvotes: 19

|_First word: ",

|_Last word: None

Note: Sometimes theres a Person with lesser upvotes on place 1, If people are disliking comments, the reddit api does weird things!

Second note: The Up/Downvotes and comments are NOT accurate!



Last update: 2021-01-29 18:29:47 CET

total updates: 540


Latest comment by: u/Valtsu0
-----
First word: too
-----
Last word: long
-----

This idea was inspired by u/Krukerfluk
Krukerfluk's post: https://www.reddit.com/r/Python/comments/hoolsm/this_post_has/

My code on Github: https://github.com/Jonathan357611/Reddit-comment-statistics

This program is hosted on a Raspberry pi zero!

/r/Python
https://redd.it/l7u2m3
Made the snake game for the Windows console

It only works in windows because it uses os.system('cls') and a library for getting user keyboard input called msvcrt.

Code

​

https://preview.redd.it/kmzbnq9w87e61.png?width=730&format=png&auto=webp&s=33dfbab4c69bf3466edf36e2eaa8d4254f98dba8

/r/Python
https://redd.it/l7j86b
How to apply not required on model field?

I have a post model that I'm trying to apply not required on image field. Basically, what I'm trying to do is when a user creates a new post, he or she does not need to upload an image. Right now the way it is set up, if image is not uploaded it gives error: "The 'post_image' attribute has no file associated with it" . I tried with blank=True, null=True, but it does not work. What am I missing here? Is there something that I need to do on ModelForm? Any help will be greatly appreciated. Thank you. Here is the code snippet at Pastebin .

/r/django
https://redd.it/l87vr5
How to Deploy Django-React App on Digital Ocean/ AWS?

This will be my first time deployment of django react app.

Facing lots of issue while doing it.

Can some experience hand help me here or atleast point me to the right direction?

Thanks

/r/django
https://redd.it/l8e111
Saturday Daily Thread: Share your resources!

Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?

Use this thread to chat about and share Python resources!

/r/Python
https://redd.it/l88hac
In this tutorial we will automate (with Python) financial analysis and create an Excel sheet from Python. We will use Python to get 10 years of financial statements and use Revenue, Earnings Per Share (EPS) and Free Cash Flow (FCF) to create the Excel sheet to analyze the company.
https://youtu.be/TaF8aPahj1g

/r/Python
https://redd.it/l8f8qo
Contribution For Beginners.

I started Django project, and I am looking to beginners like me to help each other, so check the repo:

link: https://github.com/osamamhd/ivyTasks

/r/django
https://redd.it/l7tqb5
Looking for a good naming convention for user-uploaded media files?

When uploading a media file, for example, an image inside ImageField, you can customize the filename by passing a function to the "upload\_to" argument.

Simplified example:

def rename_image(instance, filename):
return "new_name.jpg"

class Profile(Model):
picture = ImageField(upload_to=rename_image)

​

Assuming that you don't care about the original filename, I can see there are a few options to rename the file:

1. Don't rename it and leave the name as the original file -> "cool pic i took on the seawalk.jpg"
2. Use the ID of the instance you are creating (in this case Profile ID) -> "1.jpg"
3. Use a random unique hash -> "h3gdy652gshj372gs72t7.jpg"
4. Use another related field (for example the username) -> "peter\_steve.jpg"

Not sure if there are other options.

* Option 1 could have name collisions or a huge discrepancy between filenames.
* Option 2 is not possible in many cases since Django doesn't allow to get the ID of an instance that doesn't exist yet.
* Option 4 if the user decides to change his username, the image will now have a different username in the filename (not a big deal but what's

/r/django
https://redd.it/l8iafj