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
~8 years ago (I was ~14) I started this beautiful riddle and tonight i finally finished it!

/r/Python
https://redd.it/arv2qj
Got this book at pycaribbean yesterday!

/r/Python
https://redd.it/arvtmf
I need to learn Flask in 5 days for Hackathon. How do I go about this? All help is appreciated!

I have been incorporated into a hackathon team due to the untimely unavailability of a member. I have to learn flask in 5 days and implement our project in it. How can I effectively do this?

Edit: I have no prior web dev experience

/r/flask
https://redd.it/arvoyy
[AF] Best practices for multi-page forms?

Hi all,

As the complexity of my application grows, I'm noticing that I need to create forms that span multiple pages.

A simple use case I'm experiencing is when I have a form that requires a foreign key to another object (we'll call it Foo). However, my database has over 10,000 Foo records. What I would like to do is have a new screen which allows a user to search for a Foo record and return this information back to the original form screen without losing previously entered form data.

How do you all handle similar scenarios?

/r/flask
https://redd.it/ary049
[AF] Have no idea how to deal with this error: 'KeyError: <flask.cli.ScriptInfo object at [...]>'

Python 3.7.1
Flask==1.0.2

I've been using Miguel Grinberg's wonderful 'FLASK WEB DEVELOPMENT' as a reference guide when building a Social Media clone project.

I built some of it not completely following the flow of the book, so had some things he talks about later in the book set up already, but got to the point where it was time to re-structure my project as it had become quite large.

In the book, he talks about using an 'application factory' with a config.py file, and then calling from that when creating the app instance so you can use different configuration set-ups. Here is the config.py file, copied straight from the book:


import os
basedir = os.path.abspath(os.path.dirname(__file__))

class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'mysecretkey'
MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.googlemail.com')
MAIL_PORT = os.environ.get('MAIL_PORT', '587')
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'true').lower() in \
['true', 'on', '1']
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')


/r/flask
https://redd.it/arzfgt
Jump Out of the Jupyter Notebook with nbconvert

Easily Convert Notebooks to Python Scripts and Sharable Files. I wrote a little guide to using nbconvert from the command line. Feedback welcome!

[https://towardsdatascience.com/jump-out-of-the-jupyter-notebook-with-nbconvert-7d4748960702](https://towardsdatascience.com/jump-out-of-the-jupyter-notebook-with-nbconvert-7d4748960702)

/r/IPython
https://redd.it/as0mal
Celery beat without separate dyno on Heroku

Currently have Django + RabbitMQ + Celery hosted on heroku for my production servers. My procfile is as follows:


web: gunicorn uw_api_project.wsgi --log-file -
worker1: celery -A uw_api_project worker -Q uw -l info --without-gossip --without-mingle --without-heartbeat
beat: celery -A uw_api_project worker -B

Is it not possible to run celery beat in the same dyno as worker1 on production? I've read in several places that `-B` or `--beat` flags are available only for development, however, I've tried running `--beat` as well as `-B` on the same worker as suggested in this [article](https://drdaeman.github.io/heroku-djcelery-example/) to no avail. Do I really need to pay for a another dyno on Heroku to manage celery beat?


/r/django
https://redd.it/as142s
A database of notebooks for scientists and students
https://www.gited.io

/r/JupyterNotebooks
https://redd.it/aruwuf
Announcing the 1.1.0 release of my completely free and open source python project, Social Amnesia! This tool lets you wipe out old reddit and twitter items, automatically and on a schedule, with configuration tools to save the items you care about. Now with support for 2FA!

&#x200B;

https://i.redd.it/w2jiz1gqkdh21.png

[https://github.com/Nick-Gottschlich/Social-Amnesia](https://github.com/Nick-Gottschlich/Social-Amnesia)

Direct link to release with downloadables: [https://github.com/Nick-Gottschlich/Social-Amnesia/releases/tag/v1.1.0](https://github.com/Nick-Gottschlich/Social-Amnesia/releases/tag/v1.1.0)

# What's new?

\- Social Amnesia now works fully with reddit and twitter 2FA/MFA (2 Factor Authorization/Multi Factor Authorization). If you have MFA set up you will be taken to a sign on page for reddit to allow Social Amnesia to work properly without having to send a new token every hour. Twitter will have the same login process whether you have MFA set up or not.

\- I've added information text to the login page of the app so that people will know what the limitations of the API are for reddit and twitter.

# What is this?

I’m excited to release 1.0.0 of my side project, Social Amnesia! This completely free and open source software allows you to wipe out old reddit and twitter posts, comments, tweets, and favorites, automatically and on a schedule. It also allows you to configure certain items to be saved based on configuration options like number of upvotes, favorites, or retweets, whether an item has been gilded, how old an item is, or by specifically whitelisting items you would like to have saved.

# Who is this for?

You may be wary of what you post on reddit, twitter, facebook (if you even

/r/Python
https://redd.it/as0pro
How do you create a login pop up that shows on the current page, and not in a new page ? How do you process the form, via JS ?



/r/flask
https://redd.it/as2q9z
Decouple User object from django monolith

I have a project, where I have to migrate user to a different service altogether. So, what should be done? I wanted to write a custom auth backend, but in django documentation it says the get_user function in my custom backend should accept an user_id, which should be the the username, database ID, or any other primary key, but i don't have user now in my django app. So if someone could guide me through this, it would help me a lot. Thanks!

/r/django
https://redd.it/as7srj
Suggestion on where to host a commercial Django website?

I'm building a commercial Django site (backed by Postgresql database) that will expect a moderate amount of visitors (perhaps a few thousands a day).

I am currently with Namecheap using Cpanel. Trying to set up Django on Cpanel hasn't been easy due to lack of quality tutorial (feel free to link one!)

I've heard things about PaaS like Heroku that supposedly works easily with Django. What's the difference between PaaS and just good old Cpanel? Is it worth checking out? I don't want to get trapped into paying more money over a long run though. Any thoughts on where to host a Django site for cheap?

/r/django
https://redd.it/as8bua
Any known inventory management systems based on Django?

Hi all,

We're looking for a Django based inventory management system with warehouse capabilities to build off of.

Are there any known ones on the market? Commercial / Enterprise grade solutions are also a consideration.

Or even Python in general.

/r/django
https://redd.it/as8nrs
How do I deploy my postgresql database to Linux web hosting server?

I got my Django app with Postgresql backend running locally, and now I am ready to deploy it to the Linux hosting server. I have seen tutorials on how to do it, but none of them mentioned what to do with the Postgresql database. Can anyone link a tutorial or enlighten me on what to do with my database? Thanks!

/r/django
https://redd.it/as9vci
A Complete Machine Learning Project Walk-Through in Python

[http://on.morioh.net/537a78ef4d](http://on.morioh.net/537a78ef4d)

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