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
Web Development in Python with Django. 15 Videos ~ 4hours
https://www.youtube.com/playlist?list=PLhTjy8cBISEpXc-yjjSW90NgNyPYe7c9_

/r/Python
https://redd.it/axn7rv
User login system in MongoDB using Flask?

The Flask Mega Tutorial that uses SQLite, MySQL or PostgreSQL (via Flask-SQLAlchemy) as backend, and Flask-Login as user management system.

I want to mimic this, but with MongoDB as backend, but all I'm finding is a huge rabbit hole with more options than I could ever dream of. I tried a few things here and there, but it's pretty hard to get the basic functionality working. A few questions:

* Does it still make sense to use Flask-login and create classes for User and Post? If yes, what do I inherit from aside from UserMixin?
* I've also looked into JSON Web Tokens combined with jsonschema, but I'm not sure how to translate Flask-login's classes to this. Is there any way to say this is "better" (e.g. more secure, ) than Flask-Login?
* Do Flask-PyMongo and Flask-MongoEngine have the same functionality?
* Just thinking outside the box: is it a good idea to have the login system in an RDBMS and another part of the data in a NoSQL DMS?

/r/flask
https://redd.it/axwypa
[AF] Using flask_jwt, how can I redirect after successful authentication?

I hope this isn't too silly of a question. So if a user goes to /auth, and they successfully authenticate, I want to redirect them to another resource so I can log their IP address. So I'm thinking I need to redirect after /auth to something else like /ip and log their IP at that resource.

Does anyone have any insight they could offer? Thanks!

/r/flask
https://redd.it/axuuqi
PERL or PYTHON, or something else you can recommend for this ...?

I've got a text file that I need to parse and break up.

​

I'm already familiar with PERL but that has no windows interface I think, just command line. PERL is great at parsing and breaking down lines of text.

Is Python equally as good? I am thinking of Python because I want the user to use windows file explorer to search for a file to parse.

Or can you recommend something else other than Perl or Python for this simple task ?

​

/r/Python
https://redd.it/ay349t
#djangotip make orm long lines beautiful

/r/django
https://redd.it/ay1k09
How to set up your Python project for success with tests, CI, and code coverage

Just published a step-by-step guide to set up your Python package with pytest, TravisCI, Coveralls and PyUp. Hope you find it helpful!

[https://towardsdatascience.com/10-steps-to-set-up-your-python-project-for-success-14ff88b5d13?source=friends\_link&sk=df8634c99b3e5c6d9fa96b51aba1a4cd](https://towardsdatascience.com/10-steps-to-set-up-your-python-project-for-success-14ff88b5d13?source=friends_link&sk=df8634c99b3e5c6d9fa96b51aba1a4cd)

Feedback appreciated :)

​

​

/r/Python
https://redd.it/ay69qr
Python script to Jupyter notebook

Just published a Python package on PyPI called **p2j**. Run

`pip install p2j`

and

`p2j script.py`

to get a Jupyter notebook script.ipynb. Example shown below:

​

PyPI: [https://pypi.org/project/p2j/](https://pypi.org/project/p2j/)

GitHub: [https://github.com/raibosome/python2jupyter](https://github.com/raibosome/python2jupyter)

​

PRs and feedback are greatly appreciated!

[Converting Python script to Jupyter notebook using a Python package](https://i.redd.it/3nmbjeo2omk21.jpg)

/r/JupyterNotebooks
https://redd.it/ay8rxd
How to create toggle buttons for input cells in html output?

Using rmarkdown, one can create html output like this [example](https://murray-cecile.github.io/labor-market-trends/). I've seen some hacky ways to do this some months ago with jupyter notebooks. Is there an easy way to do this now?

/r/JupyterNotebooks
https://redd.it/aybj4e