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
Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect. Works on macOS and Linux and Windows

​

https://i.redd.it/nv8qimciqxd61.gif

Hey!

I just wanted to share a neat little tool I made earlier this week. It allows you to get your WiFi password and if you want, you can generate a QR code so that your friends can scan the QR code to quickly connect to your WiFi.

GitHub: https://github.com/sdushantha/wifi-password

Let me know what you guys think about it :)

/r/Python
https://redd.it/l6dqvx
accidently removed all rows in db, any possibility to recover it?

Hi! I used ORM to remove duplicate rows but my code wasn't accurate for achieving that and it removed all my rows in a table. Is it possible to recover it? Thank you so much for your help!

/r/django
https://redd.it/l6bqgn
How to override admin's password change view logic?

I can't seem to make it work. Django docs says to use

path('accounts/', include('django.contrib.auth.urls')),

but I don't want it to have "accounts/" url instead I only want it to remain as "admin/". However I tried overriding it as seen in the image and code included, it doesn't seem to use the custom view that I've made. Any idea why and how to fix it?

Code: https://dpaste.org/PWbn

​

https://preview.redd.it/urz159ipbzd61.jpg?width=801&format=pjpg&auto=webp&s=26659379a5227abc725fd8cf9543d2ce728ea2af

/r/django
https://redd.it/l6kwef
Async tasks with celery and django on google cloud.

Hi everyone, hope you’re doing well. I have a project that gets infos from users by a form and makes some calculations then saves it to database. But those operations takes too much time for user and I want to skip that part for users. So I searched from internet and I installed celery, heroku redis to my project. Everything works fine at local dev. But my site has to be deployed on gcloud. I do the operations as follows: Firstly i run supervisor on my computer then i upload my project to gcloud. I use supervisor on my computer but when i close my laptop it closes too. But i cant hold my pc open all the time. I need a self-sufficient system for this setup. Briefly talking, i need to make celery run on deployed web-site 24/7 and i have to make it on gcloud. How can i do that? Thanks already for all answers.

/r/django
https://redd.it/l6bzno
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/l6ibdc
Glasgow Interface Explorer: First fully open source FPGA based digital interface tool, allows you to decode, probe, and reverse engineer nearly any digital interface from Python

I thought the Python community might be interested in this open source hardware and software project which is a bit different than the normal fare. I'm not affiliated with this project, just an excited future user waiting for the crowdfunding campaign for the hardware to finish so I can get my hands on one and start using it, and maybe contributing to the project.

GitHub: https://github.com/GlasgowEmbedded/glasgow
Crowd Supply Campaign: https://www.crowdsupply.com/1bitsquared/glasgow

The Glasgow Interface Explorer is a completely re-configurable interface for digital I/O, both input and output, including automatic voltage level sensing and independently controllable voltage levels for two different I/O banks. It uses an FPGA (field programmable gate array; essentially a re-configurable array of digital logic elements that you can use to form different high-speed digital circuits at run-time) and high-speed (480 Mb/s) USB to allow it to interface with a pretty wide variety of protocols, even unusual ones with tight timing requirements.

This is something that you would use if you're trying to interface to some obscure piece of hardware, or just generally if you're doing many kinds of digital hardware work and need an adapter to probe, test, inject messages, program an EEPROM or flash, or the like.

And one of the really

/r/Python
https://redd.it/l6f7i1
IN SEARCH OF Python-based coding community interested in vastly improving animal & plant production and water quality by improving visibility and efficacy through automation to ensure ethical procedures and farming practices.

As a lover of all animals, a public health advocate, master gardener in love with water conservation and natural filtration, compost queen, and a gardening maniac set on leveling the access to good food for all. 

I am looking to see if there are any other Python programmers (or already established organizations that I can join) for a like-minded community focused on similar goals.

I have quite a few ideas based on university research that I would love to share with anyone interested.

Kindest regards,

Nay

/r/Python
https://redd.it/l6ket2
A function that gets executed at a specific time of the month, say on 1st and 15th of every moth, ending of a quarter

I am developing an accounts application which requires certain journal entries to be passed at a specific date (say on 1st of every month) and emailing the quarterly reports automatically to the heads of the dept. I researched and found that celery and rabbit mq is a way, but after a day of trying to set up rabbit mq (it says like the port is used by another rabbitmq@desktop something stuff), is there any simple way to do it in django automatically?? If no, please guide me with celery and rabbit mq, till production in heroku. That would be a great help!! Thanks

/r/django
https://redd.it/l6qi5q
How to deploy local python flask REST server for flutter app backend

I want to release an Android app with a Flutter frontend and a Python backend which fetch its data from a local postgres database. The two parts communicate via a Flask REST-Api. I now search for a way to deploy it on android. The fact, that the Flask needs to run on the local device, makes it a difficult task. My research came to no meaningful conclusion.

For now, I have the flask server running on my computer. The frontend can accesses it in the Android Virtual Device, so backend and frontend are separated. While researching, I thought about using Docker, but i have no idea how to do it and if it is the right choice.

/r/flask
https://redd.it/l6tkk7
How to make a blog in my flask/jinja template site?

The site Im working on will have articles posted on. The person who writes the articles is not tech savvy. I need to find a way in which the person can type the article (eg. Title, header, body) and upload the images that will go with them and I could save these in my database.
And finally, I'd like my page to display these new articles automatically on the front end when the article is submitted.

But how can I style the article the way the writer wants it to? For example in Wordpress there are ways to type your blog and format it and add photos etc. But that seems too time-consuming to implement. Is there another way? Perhaps asking them to upload a preformatted document? (but how do I read it and translate it to html, css etc).

Or is there an external service I could use for the person to write and style the article and then just pull the formated html somehow to my own site? Any ideas are much appreciated.

/r/flask
https://redd.it/l6rr47
Saleor, is it a good option or there are better options available?

We are building a web app (and potentially a mobile/tablet app in the future) for a large publishing house. They do print books as well as eBooks, and Audio Books. 

The web app will not only serve as the e-commerce module that allows for purchasing of Books and subscriptions but it will also serve as the platform where the user consumes the digital content (embedded pdf/html/ ePub reader and AudioBooks). 

We are considering Saleor but a couple of things have us concerned:

1. No native support for bundling of products (how hard will it be for us to custom build this?)
2. No native support for digital products (we don't intend to 'ship'/send the purchased eBooks to the customer via email but rather grant them access/permission to consume the eBooks and AudioBooks on the website itself
3. Potential difficulty in building the in-app eBooks reader and Audio Book?

​

Could you address some of the concerns mentioned above?

Also, would you recommend Saleor for such a project? or there is another opensource option available?

/r/django
https://redd.it/l6sj01
R Why is it so hard to get ML code to work!? I am doing so poorly as an undergrad research assistant it is stressing me out.

I volunteered to help out with a machine learning group at school and was assigned to assist a PhD student. I was asked to implement some baseline knowledge graph completion models since mid Sept but I still can't figure out how to get them to work! I spent 3 months to finally get a few models on github to work properly, but only after spending countless hours hunting out the problems in the preprocessing and evaluation code.


Now, I was asked to add another layer on top of the baselines. The PhD student directed me to another github repo from a paper that implements similar things. I just plugged my existing code into the it and somehow the model went to shit again! I went through every steps but just can't figure out what's wrong.

I can't do it anymore... Every week's meeting with the PhD student is just filled with dread knowing I have no progress to report again. I know I am not a bad coder when it comes to projects in other fields so what is wrong? Is this the nature of ML code? Is there something wrong with my brain? How do you guys debug? How can I

/r/MachineLearning
https://redd.it/l6bncg
Django + React : Best authentication method

I want to add a login functionality to my application, and I am wondering which method is the best for an application where Django handles the backend, and react the frontend.

Most people seem to be using JWT authentication. However, I read that this solution isn't 100% secure. Therefore, I am a bit hesitant to use this solution. Is there also a way to just use django's default authentication system?

/r/django
https://redd.it/l6tmfx
Help with a table

Hello! I am completely new to Jupyter Notebook/Python. I have created a table and need to format it, but am unsure how to do so. Below is what I have:

​

print('One\\t Two\\t Three')

print('-----------------------')

for i in range(0,10):

print(one[i\], '\\t', two[i\], '\\t',

three[i\])

​

I need to align the data in the columns to the right and I also need to have a certain character count for each column -- in order, the character count per column should be 6, 8, and 10. I appreciate any help.

/r/JupyterNotebooks
https://redd.it/l5tnvx
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