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
Rpy2 cannot find R.dll

I am trying to import the rpy2 library into a Jupyter Notebook but I cannot get past this error.

The PATH 'C:\\Program Files\\R\\R-4.0.2\\bin\\x64' has been added

This is the only version of R installed on my computer. I have completely uninstalled and reinstalled r/Rstudio/Anaconda with no luck.

Here is the full error along with the code that precedes it:

from rpy2.robjects import r, pandas2ri

`OSError: cannot load library 'C:\Program Files\R\R-4.0.2\bin\x64\R.dll': error 0x7e`

/r/JupyterNotebooks
https://redd.it/irkdpz
Can someone explain this on session based authentication

I understand how it work generally. The first time a user signs up, the server creates a session for that user and stores some user data in it, then it sends back (in a cookie or else) the session id. Then on subsequent request it reads the cookie and finds the claimed user. Say I set the cookie to expire in 15 minutes for security measures, how can we refresh the session before it ends so that we don't log the user out every 15 minutes (it would be annoying) . Ideally I would like us to keep the user logged in until he choose to logout.

P.S the question is also applicable to jwt auth, although the refresh token lasts much longer but eventually when it dies how do they "refresh" the refresh token without logging the use out?

/r/django
https://redd.it/iruh7r
What do you guys call your main app (blank path) in your django sites?

Just kinda curious what everyone calls their main django app that the site root goes to.

/r/django
https://redd.it/irjtf1
Help for upcoming Django challenge for a hiring process

I finally got an interview for a company I really like working on Django. I worked with it for about 2 or 3 years in a small company and then moved to other technology about 2 years ago.

The company is going to send a code challenge I need to solve in a specific amount of time, so is there something I should practice that's a common thing to do in Django? Some advice for the challenge?

/r/django
https://redd.it/is6b5z
[D] Simple Questions Thread September 13, 2020

Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/is6qzn
Published my first Python package to PyPI

Today I uploaded my first package to [PyPI](https://pypi.org/project/HelloFlask/). It's small a package called HelloFlask!

All this package does, is automate the following tasks:

* sets up a python virtual environment for the user.
* installs Flask, and python-dotenv.
* installs other third party libraries needed by the user.
* Creates a barebones Flask project, by copying some code snippets.

Github Repo: [https://github.com/ElMehdi19/HelloFlask](https://github.com/ElMehdi19/HelloFlask)

[Usage output](https://preview.redd.it/eu2avegoyym51.png?width=979&format=png&auto=webp&s=51cefc60f6f6e9469ed2ea02805f77b2cc6408b5)

/r/flask
https://redd.it/is5cpv
[D] Machine Learning - WAYR (What Are You Reading) - Week 95

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|
|----|-----|-----|-----|-----|-----|-----|-----|-----|------|
|[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 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 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 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 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 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 7](https://www.reddit.com/52t6mo)|[Week 17](https://www.reddit.com/5ob7dx)|[Week 27](https://www.reddit.com/6gngwc)|[Week 37](https://www.reddit.com/7hcc2c)|[Week 47](https://reddit.com/910jmh)|[Week 57](https://reddit.com/auci7c)|[Week 67](https://reddit.com/cj0kyc)|[Week 77](https://reddit.com/eb4lxk)|[Week 87](https://reddit.com/gcx3uf)||
|[Week 8](https://www.reddit.com/53heol)|[Week 18](https://www.reddit.com/5r14yd)|[Week 28](https://www.reddit.com/6jgdva)|[Week 38](https://www.reddit.com/7kgcqr)|[Week 48](https://reddit.com/94up0g)|[Week 58](https://reddit.com/azjoht)|[Week 68](https://reddit.com/cp1jex)|[Week 78](https://reddit.com/ehbfst)|[Week 88](https://reddit.com/glm6sv)||
|[Week 9](https://www.reddit.com/54kvsu)|[Week 19](https://www.reddit.com/5tt9cz)|[Week 29](https://www.reddit.com/6m9l1v)|[Week 39](https://www.reddit.com/7nayri)|[Week 49](https://reddit.com/98n2rt)|[Week 59](https://reddit.com/b50r5y)|[Week 69](https://reddit.com/cvde5a)|[Week 79](https://reddit.com/entcxy)|[Week 89](https://reddit.com/gu5t0d)||
|[Week
Flask Deployment on IIS

Hi Guys, I'm trying to deploy the Flask app using IIS web server. but, I'm facing the below error. How to fix this? i have only one file [app.py](https://app.py) ,app.log in my project [folder. to](https://folder.to) fix this issue i have re-installed the library , verified the path etc..


Error occurred while reading WSGI handler: Traceback (most recent call last): File "c:\python37\lib\site-packages\wfastcgi.py", line 791, in main env, handler = read_wsgi_handler(response.physical_path) File "c:\python37\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler handler = get_wsgi_handler(os.getenv("WSGI_HANDLER")) File "c:\python37\lib\site-packages\wfastcgi.py", line 616, in get_wsgi_handler raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb)) ValueError: "my_app.app" could not be imported: Traceback (most recent call last): File "c:\python37\lib\site-packages\wfastcgi.py", line 600, in get_wsgi_handler handler = __import__(module_name, fromlist=[name_list[0][0]]) File ".\my_app.py", line 1, in <module> from flask import Flask File "c:\python37\lib\site-packages\flask\__init__.py", line 14, in <module> from jinja2 import escape ModuleNotFoundError: No module named 'jinja2' StdOut: StdErr:

/r/flask
https://redd.it/ishvbk
404 Not Found Error

Here is what I have and I keep getting:

Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

&#x200B;

&#x200B;

https://preview.redd.it/3dzx4wgbm4n51.png?width=466&format=png&auto=webp&s=ee7af3c43c6d77e1ed4883c4fb204c574256f6c1

&#x200B;

&#x200B;

https://preview.redd.it/5httatjol4n51.png?width=264&format=png&auto=webp&s=a669e7b4fdb33768c8ac0b3d3589b405fbb2b4ee

I'm following along with a tutorial and have ensured everything is exactly the same. Any ideas? I've tried stack overflow and YouTube and haven't had any luck. I appreciate the help.

/r/flask
https://redd.it/ismbwj
How to build a simple Hacker News clone using Django 3 - Video

Hi everyone, just released a new video tutorial :-)

Hacker News is a very cool community. It's where all the coolest new things are being shared. Have you ever thought about building your own version of the site?

In this Django tutorial I will show you how to build a simple Hacker News clone using Django 3. I will begin by setting up a virtual environment to work in and then build the project piece by piece.

I hope this sounds like an exciting project to build. You should be able to follow along this video, even if you're a beginner. I try to explain everything I do, but if you have a question or you're stuck, feel free to leave a comment below :-)

YouTube link:
[https://www.youtube.com/watch?v=292GB6snFYo](https://www.youtube.com/watch?v=292GB6snFYo)

Todo list for this video:
\-Create and setup a virtual environment and install Django.
\-Create a new django project and create folders for the base structure
\-Create a django app for the core views and base template for the whole application
\-Make it possible to sign up, login and log out
\-Create a django app for the stories (submissions)
\-Make it possible to submit a story
\-Show the best

/r/djangolearning
https://redd.it/ise5bd
Monday megathread: Project ideas!

Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code!

/r/Python
https://redd.it/is9t2a
[JupyterLab] Bootstrapping work before the spawner starts - change default working directory of terminal

Hello everyone,

We are trying to change the default working directory of users when they start their terminals on JupyterLab. Host machine is a Linux. It looks like this is the option:

#c.Spawner.pre_spawn_hook = None

from subprocess import check_call
def my_hook(spawner):
username = spawner.user.name
check_call(['./examples/bootstrap-script/bootstrap.sh', username])

c.Spawner.pre_spawn_hook = my_hook


Is there any way to append the following line to user's */home/user/.bash_profile* file:

cd /Users/path/toyourstartfolder/

I assume this option can do the trick. Is there any other way to accomplish that?
Thanks.

/r/IPython
https://redd.it/isk5m7
File storage with a Flask REST Api

Hi Everyone,

I've recently been working on a Flask REST API for a project and I've come to a road block. I'm wondering how I might handle if I wanted to serve files to the user, in this case pdf format. What is a common way to do such a thing, initially I though for example in my SQL table to store the filename extension and then somehow serve the file that way but I was wondering what solutions you would consider best practice? Thanks

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