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
[D] Machine Learning - WAYR (What Are You Reading) - Week 138

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|101-110|111-120|121-130|131-140|
|----|-----|-----|-----|-----|-----|-----|-----|-----|------|-------|-------|-------|-------|
|[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 101](https://reddit.com/k81ywb)|[Week 111](https://reddit.com/myg8sm)|[Week 121](https://reddit.com/pmzx3g)|[Week 131](https://reddit.com/srsu2n)||||||||||||
|[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 102](https://reddit.com/kh27nx)|[Week 112](https://reddit.com/n8m6ds)|[Week 122](https://reddit.com/pw14z5)|[Week 132](https://reddit.com/t2xpfe)||
|[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 103](https://reddit.com/kpsxtc)|[Week 113](https://reddit.com/njfsc6)|[Week 123](https://reddit.com/q5fi12)|[Week 133](https://reddit.com/tdf2gt)||
|[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 104](https://reddit.com/kzevku)|[Week 114](https://reddit.com/ntu6lq)|[Week 124](https://reddit.com/qjxfu9)|[Week 134](https://reddit.com/tpruqj)||
|[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 95](https://reddit.com/is5hj9)|[Week 105](https://reddit.com/l9lvgs)|[Week 115](https://reddit.com/o4dph1)|[Week 125](https://reddit.com/qtzbu1)|[Week 135](https://reddit.com/u0pnhf)||
|[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 96](https://reddit.com/j0xr24)|[Week 106](https://reddit.com/ljx92n)|[Week 116](https://reddit.com/odrudt)|[Week 126](https://reddit.com/r4e8he)|[Week 136](https://reddit.com/ub2xlz)||
|[Week
Why Does the VS Code Jupyter Extension Keep Timing-out Trying to Find a Kernel That Exists?

I need to set up virtual environments for each language that I use. To do this, I'm running the Ubuntu 20.04 LTS Windows Subsystem for Linux (WSL) on Windows 10. Within WSL, I'm using Anaconda, installed in
/usr/local/Anaconda
, to create conda virtual environments for each language (i.e. one environment contains all my Python stuff, another contains my R stuff, etc.).

Since WSL doesn't come with a GUI, I'm using Visual Studio Code's (VSCode) Jupyter Notebook Extension to run Jupyter Notebooks to see plots/graphics. So far, I managed to easily create conda environments for Python (with ipython and ipykernel) and R (with IRkernel) and run their code in a notebook via the extension. Each time I set up an environment, the extension is easily able to find the kernel, connect to it and run the code.

However, I've not been able to set up an environment for Julia. I followed the documentation on the Julia website for installing the kernel, which is successfully found by the extension. But, when I try running a cell, the extension says it is trying to connect to the kernel, only for it to timeout and fail.

Here are the steps I have taken so far:

1. Create

/r/JupyterNotebooks
https://redd.it/uupwd4
How to remove double links

/r/flask
https://redd.it/uw28fy
Is Django-Celery appropriate here?

I come from a mainly MS background working with data (ETL) and I've recently migrated a lot of our companies processes to use a Django front end for simple configurations. Nice simple CRUD stuff for tables that feed into the ETL processes.

I also wrote a simple task processing package in Python. Tasks are all written as Python functions and include things like; run SQL procedure, download data from SQL into excel, FTP files to a third party etc. At present the tasks are requested by inserting a row into a table, the processor picks it up and saves away results; we have full visibility on when the task was requested, completed, and the 'results'/download of the task.

I also want it to handle more tasks, such as pushing new meta data to a production environment

Is this use case appropriate for Celery? Or do we need something like Apache Airflow? (I don't really understand the difference but was hoping for some input before I deep dive on one over the other!)

/r/django
https://redd.it/uw2sk3
Tuesday Daily Thread: 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 Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.

/r/Python
https://redd.it/uwdxeu
Need help understanding how JWT keep the api endpoint secure and how refresh tokens are recommended

I was reading jwt extended document

And in document it was mentioned that if your front end is not web and is mobile or api then it is recommended to use Refresh token

I know that jwt work by having a json payload and having a signature via your secret key

But how exactly does this make your api end point secure? And how will refresh token help?

Can you give me a simple example to help me understand

/r/flask
https://redd.it/uwmjk3
Updating login timestamp in database

Hey guys!

Im having an 'issue' with my web app. So I have a Login function which works as intendet and what I am trying to do is to update the login timestamps in my database. I got it working so that everytime a user logs in, it appends a new row with the user_id, a new timestamp and an id. My problem is that I just want to update the user specific row and not append a new one. Anybody knows how to solve this? thanks in advance!

/r/flask
https://redd.it/uwrgnf
Wednesday Daily Thread: Beginner questions

New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.

/r/Python
https://redd.it/ux4liu
Django - PostHog analytics

Hi guys, I'm adding PostHog to my site I'm wondering what's better, installing PostHog to the Django server or installing it to the JS.

I think the same question would be if I were using Google Analitycs instead of PostHog.

Thanks!

/r/djangolearning
https://redd.it/uy7awd
Is there anyone who is graduated from Pybites "PDM program"? Is it worth it?

Is there anyone who is graduated from Pybites "PDM program"? Is it worth it?

Can you please share your experience with this program?

Anyone takes "PyBites Challenges"? What's your comment about their platform?

/r/django
https://redd.it/uycqvh
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/uzzd07
Can someone explain how to share models between apps?

So I'm new to django, and this is confusing as hell to me...

​

\- So I create my django project, and it automatically creates the database file.

\- I create an app, and in that app I make some models in my models.py

\- I make migrations, and django adds the models as tables to the database.

\- I create a second app, and I need that app to access the data in those tables.

​

How does the second app access the tables? Python won't let me import models.py without giving me a 'ModuleNotFound' error.

I know I can add a statement to settings.py to add the directory to sys.path, which will get it to work, but that feels hacky to me, and I'm concerned that there's just better ways of doing things with django that I'm not aware of.

If anyone can clear this up for me, I would appreciate it. Thank you!

​

EDIT: SOLVED!

​

thank you to u/timlwhite!

Turns out I had added my apps to INSTALLED_APPS incorrectly - I had just added 'my_app' instead of 'my_app.apps.MyAppConfig'

/r/django
https://redd.it/uzww8l
Stress Test / Limits of Web App

I have pushed to production on PythonAnywhere a web app that is essentially a glorified url shortener. Users can register, save a dozen of links and select one of them as their redirect page hosted at user_uuid/action . The app has been working well so far, but I plan to add about 500 users in the next 6 months. How can I roughly estimate the number of requests that the web app is able to bear? Is there a way to stress test?

/r/flask
https://redd.it/v0z21r
Django + Celery + AWS SQS setup on Elastic Beanstalk

Hi,

I am having a lot of trouble with the deployment to AWS Elastic Beanstalk of a Django app that uses Celery.

I want to deploy an app that runs a simple task every minute and prints something to the console. (I have the code attached below)

Locally, it works flawlessly

I start the beat: celery -A dcf\_env beat -l INFO
I start the worker: celery -A dcf_env worker -l INFO -P solo

I made an SQS queue named 'my-queue' which receives messages from my beat. And my worker successfully consumes the messages from the queue and prints something to the console.

I can't understand how to start the beat and the worker in AWS Elastic Beanstalk. Are they even supposed to run in Elastic Beanstalk, or do I need to use some other service like a separate EC2 instance?

What do my .config files need to look like in .ebextensions folder? Is my project structure even correct? (Project Structure photo attached below)

I have deployed the application without Celery before, but now I want to integrate the project with Celery running this simple_task.

Can anyone point me to the right tutorial on how to set this up, or any up to date documentation? Any help would be

/r/django
https://redd.it/v0uael
Tuesday Daily Thread: 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 Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.

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