What are people using to organize virtual environments these days?
Thinking multiple Python versions and packages
Is Anaconda still a go to? Are there any better options in circulation that I could look into?
/r/Python
https://redd.it/10bxkjp
Thinking multiple Python versions and packages
Is Anaconda still a go to? Are there any better options in circulation that I could look into?
/r/Python
https://redd.it/10bxkjp
reddit
What are people using to organize virtual environments these days?
Thinking multiple Python versions and packages Is Anaconda still a go to? Are there any better options in circulation that I could look into?
Total beginner - Could Python be interesting for sales?
Hi there kind Python people.
Thank you for taking the time to read my question! It might be different to what normally gets posted in this sub. It's not about programming, but about career choices.
I am a 28 year old with a masters degree in Communication Sciences. Ever since finishing my studies I have been very interested in programming, AI, big data... Yet for the last years I preferred a life of travelling around and parties instead of really sharpening my skills. The time has really come for me to dedicate myself. I have taken up routines and discipline, and I have an ambitious mindset.
At this moment I am about to start a sales job (wholesale in medical disposables) in a very small but growth-oriented company. It is far from my dream job, but I want to view this as a very important step on my ladder. I want to learn a lot.
I believe there would be an awful lot to learn before it even could become useful, but as far as I understand what this language does it could come in handy for creating and managing databases of (potential) customers, sales histories, keeping track of inventory
/r/Python
https://redd.it/10c4o15
Hi there kind Python people.
Thank you for taking the time to read my question! It might be different to what normally gets posted in this sub. It's not about programming, but about career choices.
I am a 28 year old with a masters degree in Communication Sciences. Ever since finishing my studies I have been very interested in programming, AI, big data... Yet for the last years I preferred a life of travelling around and parties instead of really sharpening my skills. The time has really come for me to dedicate myself. I have taken up routines and discipline, and I have an ambitious mindset.
At this moment I am about to start a sales job (wholesale in medical disposables) in a very small but growth-oriented company. It is far from my dream job, but I want to view this as a very important step on my ladder. I want to learn a lot.
I believe there would be an awful lot to learn before it even could become useful, but as far as I understand what this language does it could come in handy for creating and managing databases of (potential) customers, sales histories, keeping track of inventory
/r/Python
https://redd.it/10c4o15
reddit
Total beginner - Could Python be interesting for sales?
Hi there kind Python people. Thank you for taking the time to read my question! It might be different to what normally gets posted in this sub....
Check out AWESOME PANEL SHARING - An easy to use sharing service for Panel data apps
In 2022 Pyodide and PyScript paved the way for Python in the Browser. On top of that, the data app framework Panel made it easy to panel convert your data app to run in the browser only.
On top of that I created AWESOME PANEL SHARING that is a easy to use sharing service for Panel data apps.
Check out the growing Gallery of inspirational examples.
Awesome Panel Sharing Gallery
Or share your data app with the world.
https://reddit.com/link/10cbt17/video/caafvw9595ca1/player
/r/Python
https://redd.it/10cbt17
In 2022 Pyodide and PyScript paved the way for Python in the Browser. On top of that, the data app framework Panel made it easy to panel convert your data app to run in the browser only.
On top of that I created AWESOME PANEL SHARING that is a easy to use sharing service for Panel data apps.
Check out the growing Gallery of inspirational examples.
Awesome Panel Sharing Gallery
Or share your data app with the world.
https://reddit.com/link/10cbt17/video/caafvw9595ca1/player
/r/Python
https://redd.it/10cbt17
GitHub
GitHub - holoviz/panel: Panel: The powerful data exploration & web app framework for Python
Panel: The powerful data exploration & web app framework for Python - holoviz/panel
(Maybe) Everything You'll Ever Need to Know about Python Imports and Project Structure
It isn’t that hard, but it is a well-kept secret. And for good reason. I’ve had a draft of this article in my head for months, but it wasn’t until I started using Poetry that I found a method I could explain in a two-minute read.
(Maybe) Everything You'll Ever Need to Know About Python Imports and Project Structure (foundationsafety.com)
/r/Python
https://redd.it/10c49jo
It isn’t that hard, but it is a well-kept secret. And for good reason. I’ve had a draft of this article in my head for months, but it wasn’t until I started using Poetry that I found a method I could explain in a two-minute read.
(Maybe) Everything You'll Ever Need to Know About Python Imports and Project Structure (foundationsafety.com)
/r/Python
https://redd.it/10c49jo
Foundation Safety
(Maybe) Everything You'll Ever Need to Know About Python Imports and Project Structure
Trade - Multipurpose Business & Corporate Jekyll Template Jekyll Theme For Mobile Apps Download Landing Page And Blogging.
Web based GUI Application
I know that this question has been asked by many so Please bear me.
What is the best way to go about making web based GUIs using Python as backend ?
I don’t know anything about HTML CSS or JavaScript.
If you can suggest any designer tool that will be helpful Thanks
/r/flask
https://redd.it/10cfufj
I know that this question has been asked by many so Please bear me.
What is the best way to go about making web based GUIs using Python as backend ?
I don’t know anything about HTML CSS or JavaScript.
If you can suggest any designer tool that will be helpful Thanks
/r/flask
https://redd.it/10cfufj
reddit
Web based GUI Application
I know that this question has been asked by many so Please bear me. What is the best way to go about making web based GUIs using Python as backend...
Discord Bot pretending to be human using Chat GPT
Python script for a Discord bot that uses Chat GPT to generate responses for a conversation between multiple discord users.
The bot can converse in a conversation distinguishing between different people and responding like a friendly discord user. It understands the distinction between being involved in conversation and not being included.
These features only partially work, with the bot easily being able to be taken out of the immersion of being a "discord user". However, it was an interesting experiment to test the limits of GPT using the limited functionality we're currently available to. I believe it would definitely be possible to make a very convincing human! Hopefully API for Chat GPT will be released in the near future.
GitHub Link: https://github.com/karkin2002/Chat-GPT-Discord-Bot
Example conversations:
https://preview.redd.it/zk7ap6a9i7ca1.png?width=2085&format=png&auto=webp&v=enabled&s=a6d975e72e22323e115b19ad25a4da9d8b1004c6
https://preview.redd.it/dmdhmrpfi7ca1.png?width=2048&format=png&auto=webp&v=enabled&s=24102d01745ef3bfa3704e32750b5a9cfa3d216b
https://preview.redd.it/kqypicfvi7ca1.png?width=1657&format=png&auto=webp&v=enabled&s=5eb908593aa8b2a5b93e029bb46bd9756c8fd0d4
Example of distinguishing between being in conversation and not. For this test I made the bot respond with "N/A" if it thought it wasn't included in the conversation ("Friend" is the Discord bots name, "Kiwi" is another users name):
https://preview.redd.it/4sxdyhkuh7ca1.png?width=1116&format=png&auto=webp&v=enabled&s=91ba5271894d387b9d1d0bd941b7133fba562906
/r/Python
https://redd.it/10cjm62
Python script for a Discord bot that uses Chat GPT to generate responses for a conversation between multiple discord users.
The bot can converse in a conversation distinguishing between different people and responding like a friendly discord user. It understands the distinction between being involved in conversation and not being included.
These features only partially work, with the bot easily being able to be taken out of the immersion of being a "discord user". However, it was an interesting experiment to test the limits of GPT using the limited functionality we're currently available to. I believe it would definitely be possible to make a very convincing human! Hopefully API for Chat GPT will be released in the near future.
GitHub Link: https://github.com/karkin2002/Chat-GPT-Discord-Bot
Example conversations:
https://preview.redd.it/zk7ap6a9i7ca1.png?width=2085&format=png&auto=webp&v=enabled&s=a6d975e72e22323e115b19ad25a4da9d8b1004c6
https://preview.redd.it/dmdhmrpfi7ca1.png?width=2048&format=png&auto=webp&v=enabled&s=24102d01745ef3bfa3704e32750b5a9cfa3d216b
https://preview.redd.it/kqypicfvi7ca1.png?width=1657&format=png&auto=webp&v=enabled&s=5eb908593aa8b2a5b93e029bb46bd9756c8fd0d4
Example of distinguishing between being in conversation and not. For this test I made the bot respond with "N/A" if it thought it wasn't included in the conversation ("Friend" is the Discord bots name, "Kiwi" is another users name):
https://preview.redd.it/4sxdyhkuh7ca1.png?width=1116&format=png&auto=webp&v=enabled&s=91ba5271894d387b9d1d0bd941b7133fba562906
/r/Python
https://redd.it/10cjm62
GitHub
GitHub - karkin2002/Chat-GPT-Discord-Bot: This is a simple discord bot that tries to pretend to be a human!
This is a simple discord bot that tries to pretend to be a human! - karkin2002/Chat-GPT-Discord-Bot
Activities to keep in touch with python programming
Hello Everyone, I am a working professional(chip designer), I just finished the python course (Udemy) and gained fair knowledge. I have already used the knowledge gained to automate some of the reports review in the current company and have also started doing few simple projects for university students. Could you guys please suggest me some activities/habits to keep in touch with the python programing and explore much more? . Appreciate the help in advance.
/r/Python
https://redd.it/10chz9y
Hello Everyone, I am a working professional(chip designer), I just finished the python course (Udemy) and gained fair knowledge. I have already used the knowledge gained to automate some of the reports review in the current company and have also started doing few simple projects for university students. Could you guys please suggest me some activities/habits to keep in touch with the python programing and explore much more? . Appreciate the help in advance.
/r/Python
https://redd.it/10chz9y
reddit
Activities to keep in touch with python programming
Hello Everyone, I am a working professional(chip designer), I just finished the python course (Udemy) and gained fair knowledge. I have already...
Yellowpage scraper powered by Python
Hey everyone,
I've been working on a web scraping project using Python to extract data from YellowPage and I wanted to share my experience and some tips for anyone else looking to do the same.
First, I used the popular library BeautifulSoup and Playwright to navigate and automate the website. The script asks user to enter a business name, location and number of pages to scrape and save it into an excel database accordingly. It extracts all the necessary data including emails as well. I feel I used lots of try and except clause, if someone has better approach them please free to share.
Another thing to watch out for is that the website structure can change frequently, so it's important to regularly check and update your code accordingly.
Overall, it was a fun and challenging project that taught me a lot about web scraping and working with dynamic websites.
Let me know if you have any questions or tips of your own to share!
/r/Python
https://redd.it/10cc17r
Hey everyone,
I've been working on a web scraping project using Python to extract data from YellowPage and I wanted to share my experience and some tips for anyone else looking to do the same.
First, I used the popular library BeautifulSoup and Playwright to navigate and automate the website. The script asks user to enter a business name, location and number of pages to scrape and save it into an excel database accordingly. It extracts all the necessary data including emails as well. I feel I used lots of try and except clause, if someone has better approach them please free to share.
Another thing to watch out for is that the website structure can change frequently, so it's important to regularly check and update your code accordingly.
Overall, it was a fun and challenging project that taught me a lot about web scraping and working with dynamic websites.
Let me know if you have any questions or tips of your own to share!
/r/Python
https://redd.it/10cc17r
GitHub
GitHub - sushil-rgb/YellowPage-scraper: A YellowPage scraper is a Python program/script that extracts data from the YellowPages.com…
A YellowPage scraper is a Python program/script that extracts data from the YellowPages.com website using the Python programming language. The scraper can be used to gather information such as busi...
How to Create a Face Recognition Using Python
https://techzpad.com/face-recognition-using-python
/r/Python
https://redd.it/10ccwe2
https://techzpad.com/face-recognition-using-python
/r/Python
https://redd.it/10ccwe2
TechzPad
How to Create a Face Recognition Using Python
Face recognition using python is a technique of identifying or verifying the identity of an individual using their face. There are numerous algorithms that
send a list of ids using ajax
i am trying to send a list of ids which are collected from the selected checkboxes in django template to django views using ajax as below,but doesn't seems to work.what could be wrong.i suspect the url part.
<script>
$(document).ready(function(){
$('.bulk_delete').click(function(){
if(confirm("Sure you want to delete?")){
var id=[];
var csrf=$('input[name=csrfmiddlewaretoken]').val();
$(':checkbox:checked').each(function(i){
id[i]=$(this).val()
})
/r/djangolearning
https://redd.it/10cfl7m
i am trying to send a list of ids which are collected from the selected checkboxes in django template to django views using ajax as below,but doesn't seems to work.what could be wrong.i suspect the url part.
<script>
$(document).ready(function(){
$('.bulk_delete').click(function(){
if(confirm("Sure you want to delete?")){
var id=[];
var csrf=$('input[name=csrfmiddlewaretoken]').val();
$(':checkbox:checked').each(function(i){
id[i]=$(this).val()
})
/r/djangolearning
https://redd.it/10cfl7m
reddit
send a list of ids using ajax
i am trying to send a list of ids which are collected from the selected checkboxes in django template to django views using ajax as below,but...
Can you explain to me how I can track and log the IP addresses and actions of every user who visits my website. My website is using Django cookie cutter, Sentry and Traefik.
Thank you.
/r/djangolearning
https://redd.it/10c3wmt
Thank you.
/r/djangolearning
https://redd.it/10c3wmt
reddit
Can you explain to me how I can track and log the IP addresses and...
Thank you.
Hiding or showing fields based on a radio button click
I have a Django project I'm working on. I'm pretty new to Django, and even more so to CSS, HTML, HTMX. We are using Django-tweaks (which I think contains htmx?) and generating web pages for our project. I have a form where if you click on a radio button called risk\_area, it will hide or show two other fields. Those fields are called email and whatsapp. For all of my efforts, trying javascript, jquery, etc, it doesn't work. It runs the function showhide() (bottom of html file in script tags) on page load. It doesn't run it when I click on the radio buttons.
So my first question is.. using Django, htmx, tweaks, what is the cleanest solution to doing this? I could do views/forms approach to try to hide show the two fields, but this seems overkill when you just want to adjust two fields hiding or showing them. The fields are visible from the get go.
My 2nd question, assuming this is the way to go is why doesn't this javascript work?
`<script>`
`window.onload = function () {`
`function showHideEmailWhatsapp() {`
`var riskarea =
/r/djangolearning
https://redd.it/10c6vjw
I have a Django project I'm working on. I'm pretty new to Django, and even more so to CSS, HTML, HTMX. We are using Django-tweaks (which I think contains htmx?) and generating web pages for our project. I have a form where if you click on a radio button called risk\_area, it will hide or show two other fields. Those fields are called email and whatsapp. For all of my efforts, trying javascript, jquery, etc, it doesn't work. It runs the function showhide() (bottom of html file in script tags) on page load. It doesn't run it when I click on the radio buttons.
So my first question is.. using Django, htmx, tweaks, what is the cleanest solution to doing this? I could do views/forms approach to try to hide show the two fields, but this seems overkill when you just want to adjust two fields hiding or showing them. The fields are visible from the get go.
My 2nd question, assuming this is the way to go is why doesn't this javascript work?
`<script>`
`window.onload = function () {`
`function showHideEmailWhatsapp() {`
`var riskarea =
/r/djangolearning
https://redd.it/10c6vjw
reddit
Hiding or showing fields based on a radio button click
I have a Django project I'm working on. I'm pretty new to Django, and even more so to CSS, HTML, HTMX. We are using Django-tweaks (which I think...
Djoser customization
I am using djoser for user registration but I want that some user will bypass the email verification
/r/djangolearning
https://redd.it/10bfzs7
I am using djoser for user registration but I want that some user will bypass the email verification
/r/djangolearning
https://redd.it/10bfzs7
reddit
Djoser customization
I am using djoser for user registration but I want that some user will bypass the email verification
Separate into spaces for users
Hi everyone, I am building a CRM using Django and deploying on Heroku. I am trying to understand what is the best practice for such a project. Basically I have customers and I create a space for them in which they can have users. Should I deploy a new project for each space that has its own webserver/database etc or should I have only one server with one database and just add a field "space" to the models? Seems a bit more dangerous in terms of security to me. And in this case should I have a separate table for each model per space or use only one table for each model and add a field as mentioned above?
/r/django
https://redd.it/10crpk6
Hi everyone, I am building a CRM using Django and deploying on Heroku. I am trying to understand what is the best practice for such a project. Basically I have customers and I create a space for them in which they can have users. Should I deploy a new project for each space that has its own webserver/database etc or should I have only one server with one database and just add a field "space" to the models? Seems a bit more dangerous in terms of security to me. And in this case should I have a separate table for each model per space or use only one table for each model and add a field as mentioned above?
/r/django
https://redd.it/10crpk6
reddit
Separate into spaces for users
Hi everyone, I am building a CRM using Django and deploying on Heroku. I am trying to understand what is the best practice for such a project....
Custom User Model - Login with email address and password for production use
How can I ensure that users can log in to the website with just an email address and password without an additional package?
For this I have already created a Custom User Model and changed AUTH_USER_MODEL:
models.py:
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettextlazy as
class User(AbstractUser):
username = None
firstname = None
lastname = None
name = models.CharField(maxlength=150, blank=True)
email = models.EmailField(("email address"), unique=True)
USERNAMEFIELD = "email"
REQUIREDFIELDS =
settings.py:
AUTHUSERMODEL = "users.User"
There is a "Customizing authentication in Django" page on the Django website. There is an example at the end. But unfortunately there is also the following:
"not intended to be copied directly into projects for
/r/django
https://redd.it/10csae9
How can I ensure that users can log in to the website with just an email address and password without an additional package?
For this I have already created a Custom User Model and changed AUTH_USER_MODEL:
models.py:
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettextlazy as
class User(AbstractUser):
username = None
firstname = None
lastname = None
name = models.CharField(maxlength=150, blank=True)
email = models.EmailField(("email address"), unique=True)
USERNAMEFIELD = "email"
REQUIREDFIELDS =
settings.py:
AUTHUSERMODEL = "users.User"
There is a "Customizing authentication in Django" page on the Django website. There is an example at the end. But unfortunately there is also the following:
"not intended to be copied directly into projects for
/r/django
https://redd.it/10csae9
reddit
Custom User Model - Login with email address and password for...
How can I ensure that users can log in to the website with just an email address and password without an additional package? For this I have...
How to update data on a page without hitting API repeatedly?
Hi there, I have a project up and running which merges multiple pdf files into a single pdf file. The backend is in Django REST and Frontend is in Angular.
I have a merge log page showing all the ongoing or finished merge processes. It also has a percent complete column. Which only updates when the API is hit again.
I want to update the value of percent complete, without repeatedly hitting the API.
If I hit the same API at an interval of 1 second it will always show the latest data.
But is there any other way to achieve this?
/r/django
https://redd.it/10chrgo
Hi there, I have a project up and running which merges multiple pdf files into a single pdf file. The backend is in Django REST and Frontend is in Angular.
I have a merge log page showing all the ongoing or finished merge processes. It also has a percent complete column. Which only updates when the API is hit again.
I want to update the value of percent complete, without repeatedly hitting the API.
If I hit the same API at an interval of 1 second it will always show the latest data.
But is there any other way to achieve this?
/r/django
https://redd.it/10chrgo
reddit
How to update data on a page without hitting API repeatedly?
Hi there, I have a project up and running which merges multiple pdf files into a single pdf file. The backend is in Django REST and Frontend is in...
how to update an object's foreign key while representing it with a custom serializer
Hey there! I'm have a couple of models that look like this
class Project(models.Model):
...
class Task(models.Model):
project = models.ForeignKey(Project, default=None, null=True, blank=True, ondelete=models.DONOTHING)
and a serializer that looks like this:
class TaskSerializer(serializers.ModelSerializer):
project = ProjectSerializer()
fields = 'id', 'name', 'project'
I want to be able to change a task's project with a PUT or PATCH request. However, when I send a request with data like
I guess I can work around this by overriding methods in the viewset, but wanted to ask here in case there's a cleaner way to do this
/r/django
https://redd.it/10cwuvl
Hey there! I'm have a couple of models that look like this
class Project(models.Model):
...
class Task(models.Model):
project = models.ForeignKey(Project, default=None, null=True, blank=True, ondelete=models.DONOTHING)
and a serializer that looks like this:
class TaskSerializer(serializers.ModelSerializer):
project = ProjectSerializer()
fields = 'id', 'name', 'project'
I want to be able to change a task's project with a PUT or PATCH request. However, when I send a request with data like
{"project":2} I get a 200 response but the project doesn't change. using project_id instead doesn't work either. I know I could use PrimaryKeyRelatedField but in this case I really need project to use it's custom serializer.I guess I can work around this by overriding methods in the viewset, but wanted to ask here in case there's a cleaner way to do this
/r/django
https://redd.it/10cwuvl
reddit
how to update an object's foreign key while representing it with a...
Hey there! I'm have a couple of models that look like this class Project(models.Model): ... class Task(models.Model): ...
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
reddit
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module. I have my code but I keep on hitting roadblocks with...
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
reddit
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module. I have my code but I keep on hitting roadblocks with...
9 IPython Magic Commands That Make Your Programming Easier
https://medium.com/techtofreedom/9-ipython-magic-commands-that-make-your-programming-easier-67d35d74c0e6
/r/flask
https://redd.it/10cwq11
https://medium.com/techtofreedom/9-ipython-magic-commands-that-make-your-programming-easier-67d35d74c0e6
/r/flask
https://redd.it/10cwq11
Medium
9 IPython Magic Commands That Make Your Programming Easier
Beyond the normal Python