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
Problem in Deployment of hobby projects.

I’m currently building a simple hobby project which uses allauth with sendgrid integration. I’m still using sqlite3 since I can easily switch to other DB by changing settings.py

I want to deploy the project for free. I’ve tried PythonAnywhere so far, but the problem is it won’t allow for smtp requests. So I cannot send emails. Is there any fix for this?

Is there any other free deployment services for hobby projects that I can use!

/r/djangolearning
https://redd.it/iuge9w
What is the equivalent of home and clear in iPython?

Hi, I am using iPython through xterm on Mac. I tried to clear the screen and move the cursor on the top left using "home" but it does not work. What command can I use? Also, if I want to clear all the variables and values I created in iPython, what command should I use? Thank you

/r/IPython
https://redd.it/iunaf2
spark context times out

When in jupyter notebook, after some time my spark context times out and I have to reload my cells all over again. Is there a way to stop this from happening? Or to have it auto reload by itself without any manual intervention.

/r/JupyterNotebooks
https://redd.it/iuq72t
Flask-AWSCognito Client Question

I have a question if anyone here has used Flask-AWSCognito before. In the documentation page section for Client is very vague and I'm still very new at python web development so how would I get a client to remember the access token and present it to each request to the flask endpoints?

/r/flask
https://redd.it/iuu96b
Continuous graph when time resets

Hello! I'm trying to graph data, but when the time resets to 0, the graph goes back to the start and I get overlapping data in my graph. How can I make it such that the graph keeps going without overlapping? Example: let's say that time resets after 30 minutes, at which time the clock resets back to 0, but I want the graph to keep going forward instead of going back to the beginning and drawing over the old data.

I am using Matplotlib.pyplot in a jupyter notebook. Sorry for not saying that earlier.

/r/IPython
https://redd.it/iu5ghu
Django 3.0 and above on a Raspberry Pi. Is it possible?

I'm learning Django and my development server is a Raspberry Pi 4, has anyone got Django 3.0 or above installed and working on a Raspberry Pi?

Or am I going to have to ditch Raspberry Pi OS and install Ubuntu Server on my Pi?

EDIT: OK, so [onosendi](https://www.reddit.com/user/onosendi/) suggested pip3...

So I ran:

**pip3 install django==3.1.1**

And it appeared to install, but I am unable to confirm the version by running:

**django-admin --version**

But if I go into:

**Python3**

..and then:

**import django**

**print(django.get\_version())**

I get:

**3.1.1**

Result! :)

/r/django
https://redd.it/ius2to
Friday megathread: 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/iuveug
Open .ipynb files directly with terminal automatically (OS X)

Hey guys,

This post is for jupyter users in OSX. Sorry for Linux/Windows users.

I have been using Jupyter Notebooks for a while and I thought that opening the terminal, typing "jupyter notebook path_to_file.ipynb" was a pain, so I created an Apple script with automator that does this directly.

Do you think it's useful?
Are there any alternatives to do this more easily?

Here is the [link](https://github.com/alexisgaziello/JupyterNotebookTerminalOpen) to the repo.

Please feel free to install it and let me know if it's useful/useless.

Cheers

/r/JupyterNotebooks
https://redd.it/iu3cnj
Flask app requires restart to display new database records on the page

I'm a bit new to flask and have run into an issue that I haven't been able to remedy.I've got a form in one my templates that allows the user to enter a URL and an accompanying label. Submitting this adds a record to my database for the new link. I have a for loop in my template that loops through the records in the database and displays them on the page. Everything is working correctly, but when I submit the link it does not display on my page even after reloading the page. Instead, I have to close my flask app an re-run it in order to see the newly added links on my page. The same goes for editing or deleting these links, which I also have actions for.

In summary, database changes are not seen on my page until I reload my flask app.

If my sql app/templates/static files are needed in order to help let me know. Thanks!

App code -

***https://www.ppaste.org/JOTQf88vj***

/r/flask
https://redd.it/iuv3zx
Paint with Machine Learning: a Semantic Image Synthesis Demo

[Paint with Machine Learning](http://paintwith.spell.ml/) is a semantic image synthesis (or image-to-image translation) demo application I built as a consulting project. Hand-drawn semantic segmentation maps go in, [GauGAN](https://arxiv.org/abs/1903.07291) generated images ([NVLab/SPADE](https://github.com/NVlabs/SPADE)) come out.

I trained the model on [ADE20K](https://www.kaggle.com/residentmario/ade20k-outdoors) and fine-tuned it on [a dataset of Bob Ross paintings I hand-labelled](https://www.kaggle.com/residentmario/segmented-bob-ross-images). The model generates [some nice-looking results](https://i.imgur.com/wGwNAh6.png), considering I had just 250 paintings to work with, albeit at a very low resolution, just 256 by 256 pixels.

The application and model code is in [a public GH repo](https://github.com/spellml/paint-with-ml).

/r/Python
https://redd.it/iumcxq
App with 2 ports. One port needs to be private, how to accomplish?

An application has a costumer side which is publicly available, in development is running on port 5000. Now we want an admin panel that is online but not accessible to the general public only admin staff as with this panel you can modify directly the database and make big changes. It's running on port 5001

Im exploring 3 possibilities.

\+ One involves making a username and password plus using MFA like the guy in this [video](https://www.youtube.com/watch?v=kMTXL5FUHGM&ab_channel=MiguelGrinberg). to access the admin panel.

\+ The second is adding admins via invitation, which is somewhat similar like the above and my question is how to add the first admin user to send invitations. (same question applies to the first option).

\+ The third one someone at work mention SSH tunnelling, Im yet to look into this one deeply but wonder if anyone here has any opinion about it and it's ease of implementation.

If anyone has any tips or better potential solutions I'd love to hear about it.

(Bonus question) The admin panel is running in port5001 so we have [app.py](https://app.py) and [app2.py](https://app2.py) in one project. But in order to run it in parallel I used threading and that disabled

/r/flask
https://redd.it/iv0pl2
Is there a program to help you document Python functions?

I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that will scan your code for functions that don't have a doc-string and then interactively ask you to:

* describe the function
* document each parameter
* document the return value

It would then create a doc-string for you that you could simply copy/paste into your code.

Thanks.

/r/Python
https://redd.it/iuoxt0
Django, Django + ajax, Django +r react, which is best for creating like and unlike or follow or unfollow button functionality?

I m learning Django and try to create a web app with like unlike button and follow unfollow button functionality. when I search about this function many options came. some tutorials did it with Django some did it with django+ajax and some did it with django+react. if it's done only with Django then why ajax and react is important. right now I don't want to learn ajax or react that's why I m asking this question. is it ok to create those functions with just Django n python? is it possible?

/r/django
https://redd.it/iv2kla
GitHub Codespaces with Django.

Hi this is my first try at making a YouTube video. I was really nervous and reluctant to make one.

But I anyhow needed up making this one about GitHub Codespaces.

Please watch the video and give me feedback! I know (I have a very bad microphone.😅)

https://youtu.be/O9NASwWInQY

/r/djangolearning
https://redd.it/iuzrf2
Access PC notebook from mobile

I have a Jupyter notebook running on my PC. Is it possible to access the notebook from a mobile browser? Both the PC and the mobile device are in the same WiFi network.

/r/IPython
https://redd.it/iuzo1c
JoCrypt. Easy low level encryption framework.

So i made this project for school purposes, but i built on it in my free time, added sql compatibilty and all.
I aimed to make a complete basic algorithmic encryption tool, but ended up adding hashes and steganography.

https://github.com/JodisKripe/JoCrypt

This is the github link...
Also i made a repl so you can try it out. Some features are limited tho..

www.jocrypt.sidjo.repl.run

It has websocket issues sometimes but should run okay.

Please let me know about any suggestions.

Cheers,
JodisKripe.

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