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/im59pd
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/im59pd
reddit
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!
Symple Data - data the symple way
Hi there,
[this](https://www.symple-data.com/) is a new platform/website for user specific data. We've found that, unlike well known datasets (e.g. weather, population,...), this type of data is not easy to find and/or not free. Help us grow if you agree with us as the value of [this](https://www.symple-data.com/) site grows with its userbase. Visit r/symple_data to post your thoughts or comment below!
/r/flask
https://redd.it/ilz8ws
Hi there,
[this](https://www.symple-data.com/) is a new platform/website for user specific data. We've found that, unlike well known datasets (e.g. weather, population,...), this type of data is not easy to find and/or not free. Help us grow if you agree with us as the value of [this](https://www.symple-data.com/) site grows with its userbase. Visit r/symple_data to post your thoughts or comment below!
/r/flask
https://redd.it/ilz8ws
Symple-Data
Symple Data
a platform to view, get and create user specific data the most simple way.
AutoScraper: A Smart, Automatic, Fast and Lightweight Web Scraper for Python
In the last few years, web scraping has been one of my day to day and frequently needed tasks. I was wondering if I can make it smart and automatic to save lots of time. So I made AutoScraper!
The project code is available on Github: [github.com/alirezamika/autoscraper](https://github.com/alirezamika/autoscraper/)
This project is made for automatic web scraping to make scraping easy. It gets a url or the html content of a web page and a list of sample data which we want to scrape from that page. **This data can be text, url or any html tag value of that page**. It learns the scraping rules and returns the similar elements. Then you can use this learned object with new urls to get similar content or the exact same element of those new pages.
I hope this project is useful for you and saves your time, too.I look forward to hear any feedback or suggestion.
/r/Python
https://redd.it/im6u4b
In the last few years, web scraping has been one of my day to day and frequently needed tasks. I was wondering if I can make it smart and automatic to save lots of time. So I made AutoScraper!
The project code is available on Github: [github.com/alirezamika/autoscraper](https://github.com/alirezamika/autoscraper/)
This project is made for automatic web scraping to make scraping easy. It gets a url or the html content of a web page and a list of sample data which we want to scrape from that page. **This data can be text, url or any html tag value of that page**. It learns the scraping rules and returns the similar elements. Then you can use this learned object with new urls to get similar content or the exact same element of those new pages.
I hope this project is useful for you and saves your time, too.I look forward to hear any feedback or suggestion.
/r/Python
https://redd.it/im6u4b
GitHub
GitHub - alirezamika/autoscraper: A Smart, Automatic, Fast and Lightweight Web Scraper for Python
A Smart, Automatic, Fast and Lightweight Web Scraper for Python - alirezamika/autoscraper
html syntax in flask
Hiii
I am new to this, I am trying to read an html file with render\_template in my python file(I put it in the right folder), but when I run it and go to the local host I see that the html file hasn't been translated, am I missing something ?
thanks in advance
https://preview.redd.it/u2pgfhz4btk51.png?width=1296&format=png&auto=webp&s=d84be80cedf538dbbc981cae1df1a37ec70fd882
/r/flask
https://redd.it/ilh2tc
Hiii
I am new to this, I am trying to read an html file with render\_template in my python file(I put it in the right folder), but when I run it and go to the local host I see that the html file hasn't been translated, am I missing something ?
thanks in advance
https://preview.redd.it/u2pgfhz4btk51.png?width=1296&format=png&auto=webp&s=d84be80cedf538dbbc981cae1df1a37ec70fd882
/r/flask
https://redd.it/ilh2tc
How to delete 4 spaces at once?
Sometimes IPython autoindents with extra 4 spaces which I don't want. For deleting the extra indent, I have to press backspace 4 times. Is there any better way to do that?
/r/IPython
https://redd.it/imc2it
Sometimes IPython autoindents with extra 4 spaces which I don't want. For deleting the extra indent, I have to press backspace 4 times. Is there any better way to do that?
/r/IPython
https://redd.it/imc2it
reddit
How to delete 4 spaces at once?
Sometimes IPython autoindents with extra 4 spaces which I don't want. For deleting the extra indent, I have to press backspace 4 times. Is there...
Facial Detection with python in just 2 mims [tutorial]
https://youtu.be/LdMFdGo6O1E
/r/Python
https://redd.it/ilp6py
https://youtu.be/LdMFdGo6O1E
/r/Python
https://redd.it/ilp6py
YouTube
FACIAL DETECTION in 2 minutes using opencv and python
in this quick video ill show you how we can detect faces using python and opencv in just 2 minutes.
we will use CascadeClassifier of open cv with haarcascade file to detect faces.
This is a mini python project for beginners how want get started with computer…
we will use CascadeClassifier of open cv with haarcascade file to detect faces.
This is a mini python project for beginners how want get started with computer…
Learn how to build a simple Twitter clone using Django and Vue.js (3 hours+)
I love to create tutorials where I can help more people get into programming. The newest video tutorial I have created is called "Learn how to build a simple Twitter clone using Django and Vue.js" and it is around 3 hours long. It thought about doing a series like I have done earlier, but wanted to make one long video instead this time.
​
During this video, you will learn how to build a simple twitter clone / a simple social network. Some of the cool functionality I can mention is following users, direct messages, notifications and feed. You will learn a lot of Django in this video, but I have also used Vue.js to talk to the backend, for validation etc.
​
Here is a list of "tasks" I will go through during this video:
\-Setup and create project
\-Create folders for structure and similar
\-Create app for core views, oinks, userprofiles, notifications
\-Create base html files
\-Create front page with some information
\-Create login and signup page
\-Create page for "my feed"
\-Make it possible to sign out
\-Make it possible to write an oink (Vue.js - Submit and append to list)
\-Make
/r/django
https://redd.it/im9h8n
I love to create tutorials where I can help more people get into programming. The newest video tutorial I have created is called "Learn how to build a simple Twitter clone using Django and Vue.js" and it is around 3 hours long. It thought about doing a series like I have done earlier, but wanted to make one long video instead this time.
​
During this video, you will learn how to build a simple twitter clone / a simple social network. Some of the cool functionality I can mention is following users, direct messages, notifications and feed. You will learn a lot of Django in this video, but I have also used Vue.js to talk to the backend, for validation etc.
​
Here is a list of "tasks" I will go through during this video:
\-Setup and create project
\-Create folders for structure and similar
\-Create app for core views, oinks, userprofiles, notifications
\-Create base html files
\-Create front page with some information
\-Create login and signup page
\-Create page for "my feed"
\-Make it possible to sign out
\-Make it possible to write an oink (Vue.js - Submit and append to list)
\-Make
/r/django
https://redd.it/im9h8n
reddit
Learn how to build a simple Twitter clone using Django and Vue.js...
I love to create tutorials where I can help more people get into programming. The newest video tutorial I have created is called "Learn how to...
Implementing JWT Authentication
A DRF beginner here. I'm building a RESTful API using DRF and [`dj-rest-auth`](https://github.com/jazzband/dj-rest-auth). The [docs](https://dj-rest-auth.readthedocs.io/en/latest/installation.html#json-web-token-jwt-support-optional) provides a brief guideline on how to use JWT authentication. It seems like dj-rest-auth is implementing JWT authentication through another package, [`django-rest-framework-simplejwt`](https://github.com/SimpleJWT/django-rest-framework-simplejwt).
The confusing part of this is that SimpleJWT has its own [docs](https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation) which explains how one might go about setting up a basic JWT authentication.
The question boils down to this: should I use `"dj_rest_auth.jwt_auth.JWTCookieAuthentication"` or `"rest_framework_simplejwt.authentication.JWTAuthentication"` for my authentication backend? I've tried both, and it seems like they both return the same response, *i.e.* a pair of access and refresh tokens.
I've looked at the [source code](https://github.com/jazzband/dj-rest-auth/blob/master/dj_rest_auth/jwt_auth.py) for dj-rest-auth's JWT authentication backend and have verified that its JWT backend inherits from SimpleJWT's own authentication backend. dj-rest-auth's backend seems to add something related to CSRF. As the team is planning to build a completely decoupled frontend and backend living in subdomains (*e.g.* api.domain.com and www.domain.com), I'm not sure what mode of authentication would be the most optimal.
Thanks in advance for the help and advice!
/r/django
https://redd.it/imda8k
A DRF beginner here. I'm building a RESTful API using DRF and [`dj-rest-auth`](https://github.com/jazzband/dj-rest-auth). The [docs](https://dj-rest-auth.readthedocs.io/en/latest/installation.html#json-web-token-jwt-support-optional) provides a brief guideline on how to use JWT authentication. It seems like dj-rest-auth is implementing JWT authentication through another package, [`django-rest-framework-simplejwt`](https://github.com/SimpleJWT/django-rest-framework-simplejwt).
The confusing part of this is that SimpleJWT has its own [docs](https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation) which explains how one might go about setting up a basic JWT authentication.
The question boils down to this: should I use `"dj_rest_auth.jwt_auth.JWTCookieAuthentication"` or `"rest_framework_simplejwt.authentication.JWTAuthentication"` for my authentication backend? I've tried both, and it seems like they both return the same response, *i.e.* a pair of access and refresh tokens.
I've looked at the [source code](https://github.com/jazzband/dj-rest-auth/blob/master/dj_rest_auth/jwt_auth.py) for dj-rest-auth's JWT authentication backend and have verified that its JWT backend inherits from SimpleJWT's own authentication backend. dj-rest-auth's backend seems to add something related to CSRF. As the team is planning to build a completely decoupled frontend and backend living in subdomains (*e.g.* api.domain.com and www.domain.com), I'm not sure what mode of authentication would be the most optimal.
Thanks in advance for the help and advice!
/r/django
https://redd.it/imda8k
GitHub
GitHub - iMerica/dj-rest-auth: Authentication for Django Rest Framework
Authentication for Django Rest Framework. Contribute to iMerica/dj-rest-auth development by creating an account on GitHub.
Learn how to build a simple Twitter clone using Django and Vue.js (3 hours+)
I love to create tutorials where I can help more people get into programming. The newest video tutorial I have created is called "Learn how to build a simple Twitter clone using Django and Vue.js" and it is around 3 hours long. It thought about doing a series like I have done earlier, but wanted to make one long video instead this time.
During this video, you will learn how to build a simple twitter clone / a simple social network. Some of the cool functionality I can mention is following users, direct messages, notifications and feed. You will learn a lot of Django in this video, but I have also used Vue.js to talk to the backend, for validation etc.
Here is a list of "tasks" I will go through during this video:
\-Setup and create project
\-Create folders for structure and similar
\-Create app for core views, oinks, userprofiles, notifications
\-Create base html files
\-Create front page with some information
\-Create login and signup page
\-Create page for "my feed"
\-Make it possible to sign out
\-Make it possible to write an oink (Vue.js - Submit and append to list)
\-Make it
/r/djangolearning
https://redd.it/im9hyx
I love to create tutorials where I can help more people get into programming. The newest video tutorial I have created is called "Learn how to build a simple Twitter clone using Django and Vue.js" and it is around 3 hours long. It thought about doing a series like I have done earlier, but wanted to make one long video instead this time.
During this video, you will learn how to build a simple twitter clone / a simple social network. Some of the cool functionality I can mention is following users, direct messages, notifications and feed. You will learn a lot of Django in this video, but I have also used Vue.js to talk to the backend, for validation etc.
Here is a list of "tasks" I will go through during this video:
\-Setup and create project
\-Create folders for structure and similar
\-Create app for core views, oinks, userprofiles, notifications
\-Create base html files
\-Create front page with some information
\-Create login and signup page
\-Create page for "my feed"
\-Make it possible to sign out
\-Make it possible to write an oink (Vue.js - Submit and append to list)
\-Make it
/r/djangolearning
https://redd.it/im9hyx
reddit
Learn how to build a simple Twitter clone using Django and Vue.js...
I love to create tutorials where I can help more people get into programming. The newest video tutorial I have created is called "Learn how to...
Best Deployment Options for 5 Domains?
I've got three sites ready to deploy, with two more that will be ready in a few months.
What is the cheapest options for doing this without the obvious Heroku, Github, etc?
/r/django
https://redd.it/imjaxr
I've got three sites ready to deploy, with two more that will be ready in a few months.
What is the cheapest options for doing this without the obvious Heroku, Github, etc?
/r/django
https://redd.it/imjaxr
reddit
Best Deployment Options for 5 Domains?
I've got three sites ready to deploy, with two more that will be ready in a few months. What is the cheapest options for doing this without the...
What's the best way to save files?
I decided to make a website in which certain users can upload files and others users can download them. I saw a video by pretty printed in which he converted the file to bytes and save them to a database but I ended up not doing it that way. I made a folder for the files and saved them there with the `os` module by following [this](https://flask.palletsprojects.com/en/1.1.x/patterns/fileuploads/). Now I'm thinking of making another website that involves saving images, so how should I save images?
Sorry if my English was bad.
/r/flask
https://redd.it/imh5wn
I decided to make a website in which certain users can upload files and others users can download them. I saw a video by pretty printed in which he converted the file to bytes and save them to a database but I ended up not doing it that way. I made a folder for the files and saved them there with the `os` module by following [this](https://flask.palletsprojects.com/en/1.1.x/patterns/fileuploads/). Now I'm thinking of making another website that involves saving images, so how should I save images?
Sorry if my English was bad.
/r/flask
https://redd.it/imh5wn
reddit
What's the best way to save files?
I decided to make a website in which certain users can upload files and others users can download them. I saw a video by pretty printed in which...
Saturday megathread: Share your resources!
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/imr8h6
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/imr8h6
reddit
Saturday megathread: Share your resources!
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic? Use this thread to chat about and...
Discrepancy in logging output between IDLE and Terminal
import flask
app = flask.Flask(__name__)
@app.route("/")
def about():
return hello
if __name__ == "__main__":
app.run(debug=True)
When the code is executed and I visit [http://localhost:5000/](http://localhost:5000/) , I get a NameError exception page from the debugger, which is expected. However, the stderr output in the shell differs:
IDLE
================= RESTART: /Users/eExamSystem/Documents/app.py =================
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
IDLE Without Debugger (For comparison)
================= RESTART: /Users/eExamSystem/Documents/test.py =================
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2020-09-05 17:57:38,774] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
/r/flask
https://redd.it/imylhc
import flask
app = flask.Flask(__name__)
@app.route("/")
def about():
return hello
if __name__ == "__main__":
app.run(debug=True)
When the code is executed and I visit [http://localhost:5000/](http://localhost:5000/) , I get a NameError exception page from the debugger, which is expected. However, the stderr output in the shell differs:
IDLE
================= RESTART: /Users/eExamSystem/Documents/app.py =================
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
IDLE Without Debugger (For comparison)
================= RESTART: /Users/eExamSystem/Documents/test.py =================
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2020-09-05 17:57:38,774] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
/r/flask
https://redd.it/imylhc
reddit
Discrepancy in logging output between IDLE and Terminal
import flask app = flask.Flask(__name__) @app.route("/") def about(): return hello if __name__ ==...
I made a Spotify ad stopper because I was too poor for Premium. It automatically detects when an ad plays and then restarts Spotify in the background. It's my first project after escaping tutorial hell and I'd love any feedback you guys have!
It detects when an advertisement plays by monitoring the type of what track is currently playing, using the Spotipy api. It then closes and opens Spotify by the os module and plays it via pynput.
There have been a few programs in this subreddit which offer a similar functionality but mute spotify, and play another locally-stored song. I preferred not using that method and hence did this.
The code is present below, and is also present in my github repo [here](https://github.com/SakDev/SpotiByeBye).
Once again, I truly would appreciate any constructive feedback!
**Edit**: Thank you so much for your positive response!!!! I've added a readme file to help anyone understand the gist of setting up the Spotify API to get your Client ID and secret.
And to all the people who claim this is stealing, I just wanted to say that while it does test ethical bounds, this program merely restarts Spotify using legally-obtained data from Spotify. Chill dude.
​
https://preview.redd.it/prkuja5q6cl51.png?width=4560&format=png&auto=webp&s=36f824adc24665e71d497aeb7e8afde5b1f2e9f7
/r/Python
https://redd.it/in1pyu
It detects when an advertisement plays by monitoring the type of what track is currently playing, using the Spotipy api. It then closes and opens Spotify by the os module and plays it via pynput.
There have been a few programs in this subreddit which offer a similar functionality but mute spotify, and play another locally-stored song. I preferred not using that method and hence did this.
The code is present below, and is also present in my github repo [here](https://github.com/SakDev/SpotiByeBye).
Once again, I truly would appreciate any constructive feedback!
**Edit**: Thank you so much for your positive response!!!! I've added a readme file to help anyone understand the gist of setting up the Spotify API to get your Client ID and secret.
And to all the people who claim this is stealing, I just wanted to say that while it does test ethical bounds, this program merely restarts Spotify using legally-obtained data from Spotify. Chill dude.
​
https://preview.redd.it/prkuja5q6cl51.png?width=4560&format=png&auto=webp&s=36f824adc24665e71d497aeb7e8afde5b1f2e9f7
/r/Python
https://redd.it/in1pyu
GitHub
GitHub - SakDev/SpotiByeBye
Contribute to SakDev/SpotiByeBye development by creating an account on GitHub.
What are the uses of vue.js and react with django ? How they are useful in django ?
Right now i am learning django. I know basics about python. I see many tutorials about django+react and django+vue.js for making webapps but I want know when to use vue.js or react with django.
/r/django
https://redd.it/in3jvb
Right now i am learning django. I know basics about python. I see many tutorials about django+react and django+vue.js for making webapps but I want know when to use vue.js or react with django.
/r/django
https://redd.it/in3jvb
reddit
What are the uses of vue.js and react with django ? How they are...
Right now i am learning django. I know basics about python. I see many tutorials about django+react and django+vue.js for making webapps but I...
Sunday megathread: 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/inbwja
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/inbwja
reddit
Sunday megathread: 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...
I wrote a mass emailing script named MassEmailer that you can input any sized text file of email addresses and an email body text file and it will mass send out the email. You can schedule it to send a set amount of emails per day to stay within provider limits until it has been sent to all emails.
[https://github.com/trevtravtrev/MassEmailer](https://github.com/trevtravtrev/MassEmailer)
The readme contains all the instructions you should need to run it. The code has docstrings explaining each function. It works perfect but would like to hear feedback for how it can be written to be more user friendly. Please feel free to critique here or use the code in any way you'd like. Please make sure to follow the readme to get the script running for yourself.
I currently have a 5,000 email address text file and 1 text file with the email body text. I have it set to send 100 emails per day via gmail (this is gmail's limits) and it is set to run once every 24 hours with windows task scheduler. It deletes email addresses from the text file as it sends to them so it can run seamlessly the next scheduled time picking up where it left off. Keep a backup copy of your email list elsewhere.
If this is popular, I will add updates and maybe even make an interface.
/r/Python
https://redd.it/imufvd
[https://github.com/trevtravtrev/MassEmailer](https://github.com/trevtravtrev/MassEmailer)
The readme contains all the instructions you should need to run it. The code has docstrings explaining each function. It works perfect but would like to hear feedback for how it can be written to be more user friendly. Please feel free to critique here or use the code in any way you'd like. Please make sure to follow the readme to get the script running for yourself.
I currently have a 5,000 email address text file and 1 text file with the email body text. I have it set to send 100 emails per day via gmail (this is gmail's limits) and it is set to run once every 24 hours with windows task scheduler. It deletes email addresses from the text file as it sends to them so it can run seamlessly the next scheduled time picking up where it left off. Keep a backup copy of your email list elsewhere.
If this is popular, I will add updates and maybe even make an interface.
/r/Python
https://redd.it/imufvd
GitHub
GitHub - trevtravtrev/MassEmailer: An automated, free mass emailing script that sends individual emails to unlimited addresses.
An automated, free mass emailing script that sends individual emails to unlimited addresses. - trevtravtrev/MassEmailer
How to have encrypted chat between users, where the site owner cant read any of the messages?
* The messages would be stored in the database
* Im guessing this will deal with hashing
* The site owner should not be able to read any of the messages
* Users will be private messaging other users
* Is there any common lib/tool/package that can be used with Django to accomplish this?
/r/django
https://redd.it/ing5h4
* The messages would be stored in the database
* Im guessing this will deal with hashing
* The site owner should not be able to read any of the messages
* Users will be private messaging other users
* Is there any common lib/tool/package that can be used with Django to accomplish this?
/r/django
https://redd.it/ing5h4
reddit
How to have encrypted chat between users, where the site owner...
* The messages would be stored in the database * Im guessing this will deal with hashing * The site owner should not be able to read any of the...
testing in django
Hey, does anyone knows some good django testing examples to learn from?
/r/django
https://redd.it/in975x
Hey, does anyone knows some good django testing examples to learn from?
/r/django
https://redd.it/in975x
reddit
testing in django
Hey, does anyone knows some good django testing examples to learn from?
I used Python, Flask, HTML, JS, CSS, and Google Colab to create a web-app. How would I deploy this permanently rather than temporarily?
/r/Python
https://redd.it/ingaif
/r/Python
https://redd.it/ingaif
reddit
I used Python, Flask, HTML, JS, CSS, and Google Colab to create a...
Posted in r/Python by u/bucksball • 11 points and 7 comments