Why '&' changes to '&' when it gets to frontend? (FLASK-REACT)
I am working on a project with Flask backend and React frontend.
I send data like this
`auth_url = '`[`https://abc.com/tr/authorize?client_id=abc&response_type=code&`](https://accounts.spotify.com/tr/authorize?client_id=a2a038c0cf9f4fb08c36873347d16858&response_type=code&redirect_uri=http:%2F%2F127.0.0.1:5000&scope=playlist-modify-private%20user-read-currently-playing&show_dialog=True)`'`
`return render_template('index.html', auth_url=auth_url, page_name='sign_in')`
When I call this url from React, it changes '&' to '&', why it does it make this change.
I did some googling most of the responses says it is due to security reasons.
/r/flask
https://redd.it/iz3gbi
I am working on a project with Flask backend and React frontend.
I send data like this
`auth_url = '`[`https://abc.com/tr/authorize?client_id=abc&response_type=code&`](https://accounts.spotify.com/tr/authorize?client_id=a2a038c0cf9f4fb08c36873347d16858&response_type=code&redirect_uri=http:%2F%2F127.0.0.1:5000&scope=playlist-modify-private%20user-read-currently-playing&show_dialog=True)`'`
`return render_template('index.html', auth_url=auth_url, page_name='sign_in')`
When I call this url from React, it changes '&' to '&', why it does it make this change.
I did some googling most of the responses says it is due to security reasons.
/r/flask
https://redd.it/iz3gbi
What is the correct way to create Virtual Environment for a project.
I 've seen several ways to create "Virtual Environment" in tutorials. Can someone tell me what the correct way is or better way. I'm pretty new to Django and Web-Dev, and my first Django tutorial was using this command: python -m venv project_env (new environment name). This works without any issue, but I would like to know if this is proper way. Any help will be greatly appreciated. Thank you.
/r/django
https://redd.it/iz1ogt
I 've seen several ways to create "Virtual Environment" in tutorials. Can someone tell me what the correct way is or better way. I'm pretty new to Django and Web-Dev, and my first Django tutorial was using this command: python -m venv project_env (new environment name). This works without any issue, but I would like to know if this is proper way. Any help will be greatly appreciated. Thank you.
/r/django
https://redd.it/iz1ogt
reddit
What is the correct way to create Virtual Environment for a project.
I 've seen several ways to create "Virtual Environment" in tutorials. Can someone tell me what the correct way is or better way. I'm pretty new to...
Python and FastAI to Qualify at Fall Guys
https://youtu.be/GS_0ZKzrvk0
/r/Python
https://redd.it/iz0agr
https://youtu.be/GS_0ZKzrvk0
/r/Python
https://redd.it/iz0agr
YouTube
FastAI learns to play Fall Guys - Undetectable Fall Guys bot.
I used the very powerful FastAI library with Python to play Fall Guys and qualify over human players. These AI bots are fun and easy to code with FastAI and undetectable by anti-cheat efforts. Join us and share this video to stop these bots!
Want to chat…
Want to chat…
Data Science (Decision trees) - Please help! DM Me if you can for venmo/paypal/cashapp
Python help $$$$
Need help with this project looking for a pro thats affordable.
/r/JupyterNotebooks
https://redd.it/izcidj
Python help $$$$
Need help with this project looking for a pro thats affordable.
/r/JupyterNotebooks
https://redd.it/izcidj
reddit
Data Science (Decision trees) - Please help! DM Me if you can for...
Python help $$$$ Need help with this project looking for a pro thats affordable.
Automated My Job for the First Time
So this just happened today. I've been learning Python on and off for a long time. I had to take a couple of classes for my undergrad a couple years back, and after that, I never really needed to apply it in my job.
Fast forward to today, my manager was complaining about how many requests for test data the business team was giving him. He tasked me with helping him generate the data using Excel and advanced SQL logic.
I decided to dust off my rusty Python scripting knowledge and created a script that automated the entire process. It took many hours, a lot of googling and 2 mugs of coffee, but I accomplished what I set out to do. My script was able to generate nearly 5000 queries in less than a minute.
Needless to say, my boss was impressed by my initiative, and I've found out first hand how useful knowing Python is. I want to thank this subreddit for being so supportive and always promoting new learning resources. Automate the Boring Stuff is a gold mine of info and I am more motivated than ever before to expand my skills and knowledge!
/r/Python
https://redd.it/izdclm
So this just happened today. I've been learning Python on and off for a long time. I had to take a couple of classes for my undergrad a couple years back, and after that, I never really needed to apply it in my job.
Fast forward to today, my manager was complaining about how many requests for test data the business team was giving him. He tasked me with helping him generate the data using Excel and advanced SQL logic.
I decided to dust off my rusty Python scripting knowledge and created a script that automated the entire process. It took many hours, a lot of googling and 2 mugs of coffee, but I accomplished what I set out to do. My script was able to generate nearly 5000 queries in less than a minute.
Needless to say, my boss was impressed by my initiative, and I've found out first hand how useful knowing Python is. I want to thank this subreddit for being so supportive and always promoting new learning resources. Automate the Boring Stuff is a gold mine of info and I am more motivated than ever before to expand my skills and knowledge!
/r/Python
https://redd.it/izdclm
reddit
Automated My Job for the First Time
So this just happened today. I've been learning Python on and off for a long time. I had to take a couple of classes for my undergrad a couple...
Pytest API endpoints that do Sqlite DB CRUD
I have a simple page that has a couple routes to do CURD into a SQLITE3 database. That's working fine. But I need to add tests with Pytest to verify their functionality.
Ideally I need to create a new database and somehow make each test use the endpoints in my website but instead of adding and delete data into the normal db, they should use the db created for testing purposes.
After tests conclude this database gets destroyed, in fact each test should spin it's own database so they are all isolated.
I know about fixtures and that I can create a new db and pass it to the tests but I don't know how to make the endpoints to point to this new database only while testing. If anybody have any ideas or point me in the right direction it'd be appreciated.
/r/flask
https://redd.it/izcv0h
I have a simple page that has a couple routes to do CURD into a SQLITE3 database. That's working fine. But I need to add tests with Pytest to verify their functionality.
Ideally I need to create a new database and somehow make each test use the endpoints in my website but instead of adding and delete data into the normal db, they should use the db created for testing purposes.
After tests conclude this database gets destroyed, in fact each test should spin it's own database so they are all isolated.
I know about fixtures and that I can create a new db and pass it to the tests but I don't know how to make the endpoints to point to this new database only while testing. If anybody have any ideas or point me in the right direction it'd be appreciated.
/r/flask
https://redd.it/izcv0h
reddit
Pytest API endpoints that do Sqlite DB CRUD
I have a simple page that has a couple routes to do CURD into a SQLITE3 database. That's working fine. But I need to add tests with Pytest to...
Dyno reset in heroku deleting SQLAlchemy db
Hi guys, I am a beginner in FLASK and deployed a basic CRUD application on heroku. But what I noticed was after every 2-3 hrs the data entered after deployment gets deleted. I am assuming this is because of the Dyno getting reset.
I am using Flask, SQLite, gunicorn.
Can anyone pls help me out with this and what I should do.
Thanks in advance ❤️
/r/flask
https://redd.it/izeuk7
Hi guys, I am a beginner in FLASK and deployed a basic CRUD application on heroku. But what I noticed was after every 2-3 hrs the data entered after deployment gets deleted. I am assuming this is because of the Dyno getting reset.
I am using Flask, SQLite, gunicorn.
Can anyone pls help me out with this and what I should do.
Thanks in advance ❤️
/r/flask
https://redd.it/izeuk7
reddit
Dyno reset in heroku deleting SQLAlchemy db
Hi guys, I am a beginner in FLASK and deployed a basic CRUD application on heroku. But what I noticed was after every 2-3 hrs the data entered...
How to deploy a Django App to Heroku (The Github Method)
https://cakebaby.dev/how-to-deploy-a-django-app-to-heroku-the-github-method-ckfgpzsbm001g7xs1aac4e54p
/r/django
https://redd.it/izevef
https://cakebaby.dev/how-to-deploy-a-django-app-to-heroku-the-github-method-ckfgpzsbm001g7xs1aac4e54p
/r/django
https://redd.it/izevef
cakebaby.dev
How to deploy a Django App to Heroku (The Github Method)
The beauty of building an app or a website is appreciated when others are able to see and view it from their end.
Deploying an application means putting it on a web server so it can be used through the internet. The goal of deploying is to make it av...
Deploying an application means putting it on a web server so it can be used through the internet. The goal of deploying is to make it av...
PyPy new release: now offers python 3.7
https://morepypy.blogspot.com/2020/09/pypy-732-triple-release-python-27-36.html
/r/Python
https://redd.it/izevjh
https://morepypy.blogspot.com/2020/09/pypy-732-triple-release-python-27-36.html
/r/Python
https://redd.it/izevjh
Blogspot
PyPy 7.3.2 triple release: python 2.7, 3.6, and 3.7
The PyPy team is proud to release version 7.3.2 of PyPy, which includes three different interpreters: PyPy2.7, which is an interpreter su...
Flask with ReactJS form library - React Bare Forms
If you're using React on your Flask projects either as a front in your flask views or as a separate single page app, then take a look at React Bare forms [https://github.com/joegasewicz/react-bare-forms](https://github.com/joegasewicz/react-bare-forms)
It's designed to be the easiest form library to use in the world for ReactJS.
I would be really grateful for any feedback and your thoughts on the project!
​
Thanks
/r/flask
https://redd.it/izhwkd
If you're using React on your Flask projects either as a front in your flask views or as a separate single page app, then take a look at React Bare forms [https://github.com/joegasewicz/react-bare-forms](https://github.com/joegasewicz/react-bare-forms)
It's designed to be the easiest form library to use in the world for ReactJS.
I would be really grateful for any feedback and your thoughts on the project!
​
Thanks
/r/flask
https://redd.it/izhwkd
GitHub
GitHub - joegasewicz/react-bare-forms: A bare minimal React form library for quick & simple forms.
A bare minimal React form library for quick & simple forms. - GitHub - joegasewicz/react-bare-forms: A bare minimal React form library for quick & simple forms.
Model field constraint based on other field value?
Is it somehow possible to add predefined values or constraint (former preferred), based on another field value?
E.g. based on a item transaction type \`RENTAL\` or \`PURCHASE\`, a field indicating \`RENEWAL\` becomes either active or inactive. (meaning when it's active a value is required and when it's inactive, no value is required)
Is it also possible to reflect that logic on forms?
/r/django
https://redd.it/izhcyc
Is it somehow possible to add predefined values or constraint (former preferred), based on another field value?
E.g. based on a item transaction type \`RENTAL\` or \`PURCHASE\`, a field indicating \`RENEWAL\` becomes either active or inactive. (meaning when it's active a value is required and when it's inactive, no value is required)
Is it also possible to reflect that logic on forms?
/r/django
https://redd.it/izhcyc
reddit
Model field constraint based on other field value?
Is it somehow possible to add predefined values or constraint (former preferred), based on another field value? E.g. based on a item...
Python Insider: Python 3.8.6 is now available
https://blog.python.org/2020/09/python-386-is-now-available.html
/r/Python
https://redd.it/iyxl9m
https://blog.python.org/2020/09/python-386-is-now-available.html
/r/Python
https://redd.it/iyxl9m
blog.python.org
Python Insider: Python 3.8.6 is now available
The Jupyter Ecosystem seems vast and overwhelming -- is there a good website or book that distills it?
+ Hosting at Google
+ Hosting at Azure
+ Hosting at Amazon
+ Hosting at MyBinder
-----
If I want to create a series of notebooks that form the basis of an app / website or website / app, but I'd like the website itself to be a static site with the notebooks hosted live elsewhere, what are my options?
/r/JupyterNotebooks
https://redd.it/izh771
+ Hosting at Google
+ Hosting at Azure
+ Hosting at Amazon
+ Hosting at MyBinder
-----
If I want to create a series of notebooks that form the basis of an app / website or website / app, but I'd like the website itself to be a static site with the notebooks hosted live elsewhere, what are my options?
/r/JupyterNotebooks
https://redd.it/izh771
reddit
The Jupyter Ecosystem seems vast and overwhelming -- is there a...
+ Hosting at Google + Hosting at Azure + Hosting at Amazon + Hosting at MyBinder ----- If I want to create a series of notebooks that form the...
I created my First Python package on PyPI : jupyter_timetracker : Time management in a pythonic way.
# Purpose of making
I had always obsessed about saving each and every second of my time in my life. More than just saving, I was more concerned about being able to look at where my time is going throughout the day. The led me to install so many time management app on my mobile, after a lot of trial and error, I found atimelogger the best. It has all the capability what I was looking for. However, later it started to provide only basic features in free version and asking to pay to upgrade to have full features. Also, it has no desktop app. I found helpless in situations, where I am on desktop and away from my mobile. That led me to search for more productive and free apps that were both for mobile and desktop. Then i got to know about toggl and timecamp. However, these sites also provide very minimal features for free and require to pay for all features.
As an introvert guy, I want to know deeply about myself ( self-introspection ). So apart from just logging time and having timesheet, I want to
/r/Python
https://redd.it/izop7a
# Purpose of making
I had always obsessed about saving each and every second of my time in my life. More than just saving, I was more concerned about being able to look at where my time is going throughout the day. The led me to install so many time management app on my mobile, after a lot of trial and error, I found atimelogger the best. It has all the capability what I was looking for. However, later it started to provide only basic features in free version and asking to pay to upgrade to have full features. Also, it has no desktop app. I found helpless in situations, where I am on desktop and away from my mobile. That led me to search for more productive and free apps that were both for mobile and desktop. Then i got to know about toggl and timecamp. However, these sites also provide very minimal features for free and require to pay for all features.
As an introvert guy, I want to know deeply about myself ( self-introspection ). So apart from just logging time and having timesheet, I want to
/r/Python
https://redd.it/izop7a
reddit
I created my First Python package on PyPI : jupyter_timetracker :...
# Purpose of making I had always obsessed about saving each and every second of my time in my life. More than just saving, I was more concerned...
flask sqlalchecmy db.relationship column is not created
hello everyone, when i execute `db.create_all()` all columns gets created just fine except for one column:
products = db.relationship('Product', backref='owner', lazy=True)
here is the models
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
city = db.Column(db.String(20), nullable=False)
branch = db.Column(db.String(20), nullable=False)
username = db.Column(db.String(20), unique=True, nullable=False)
products = db.relationship('Product', backref='owner', lazy=True)
class Product(db.Model):
id = db.Column(db.Integer, primary_key=True)
productName = db.Column(db.String(50))
productCode = db.Column(db.String(200))
productDescription = db.Column(db.String(50))
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
it was working just fine i don't know what went wrong
here is how i created the tables
>>from root import db, create_app
>>db.create_all(app=create_app())
i also tried:
>>from root import db, create_app
>>from root.users.models import User
>>from root.api.models import Product
/r/flask
https://redd.it/izjahf
hello everyone, when i execute `db.create_all()` all columns gets created just fine except for one column:
products = db.relationship('Product', backref='owner', lazy=True)
here is the models
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
city = db.Column(db.String(20), nullable=False)
branch = db.Column(db.String(20), nullable=False)
username = db.Column(db.String(20), unique=True, nullable=False)
products = db.relationship('Product', backref='owner', lazy=True)
class Product(db.Model):
id = db.Column(db.Integer, primary_key=True)
productName = db.Column(db.String(50))
productCode = db.Column(db.String(200))
productDescription = db.Column(db.String(50))
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
it was working just fine i don't know what went wrong
here is how i created the tables
>>from root import db, create_app
>>db.create_all(app=create_app())
i also tried:
>>from root import db, create_app
>>from root.users.models import User
>>from root.api.models import Product
/r/flask
https://redd.it/izjahf
reddit
flask sqlalchecmy db.relationship column is not created
hello everyone, when i execute `db.create_all()` all columns gets created just fine except for one column: products =...
Im starting a job in django
Hey guys!
In one week i will start mi first job as a dev with django + angular/react.
I just learn the django basics, can anyone give me some noobie advice?
thanks a lot!
/r/django
https://redd.it/izir65
Hey guys!
In one week i will start mi first job as a dev with django + angular/react.
I just learn the django basics, can anyone give me some noobie advice?
thanks a lot!
/r/django
https://redd.it/izir65
reddit
Im starting a job in django
Hey guys! In one week i will start mi first job as a dev with django + angular/react. I just learn the django basics, can anyone give me some...
[P] The Last Machine & Deep-Learning Compendium You’ll Ever Need
**TL;DR –** [Go to The Compendium](https://towardsdatascience.com/the-last-machine-deep-learning-compendium-youll-ever-need-dc973643c4e1) – This is a curated ***\~330*** page document, with resources on almost any Data Science and ML topic you can probably imagine.
***Disclaimer:*** This is not my project, but a friend's.
I know medium posts are not exactly projects – but this one should count as one.
It is an incredible resource created over a very long period of time – it has literally hundreds of pages with links and summaries on almost any topic in DS, ML, DL you can think of (using CTRL+F is a huge pleasure). It is still being maintained, by someone that has real life experience in the industry and academic research....also, if you want [you can go directly to the Google Doc itself](https://docs.google.com/document/d/1wvtcwc8LOb3PZI9huQOD7UjqUoY98N5r3aQsWKNAlzk/edit?usp=sharing).
I think this would be a great resource for many people in the community, and this might be a good place to share additional awesome curated resources.
/r/MachineLearning
https://redd.it/izh8a7
**TL;DR –** [Go to The Compendium](https://towardsdatascience.com/the-last-machine-deep-learning-compendium-youll-ever-need-dc973643c4e1) – This is a curated ***\~330*** page document, with resources on almost any Data Science and ML topic you can probably imagine.
***Disclaimer:*** This is not my project, but a friend's.
I know medium posts are not exactly projects – but this one should count as one.
It is an incredible resource created over a very long period of time – it has literally hundreds of pages with links and summaries on almost any topic in DS, ML, DL you can think of (using CTRL+F is a huge pleasure). It is still being maintained, by someone that has real life experience in the industry and academic research....also, if you want [you can go directly to the Google Doc itself](https://docs.google.com/document/d/1wvtcwc8LOb3PZI9huQOD7UjqUoY98N5r3aQsWKNAlzk/edit?usp=sharing).
I think this would be a great resource for many people in the community, and this might be a good place to share additional awesome curated resources.
/r/MachineLearning
https://redd.it/izh8a7
Medium
The Last Machine & Deep-Learning Compendium You’ll Ever Need
A comprehensive resource on practically every topic for data science researchers.
Question regarding nested serializers
I'm building an API for a web application that I'm working on where I'm using a nested relationship for a create end point like the one here in the DRF framework
​
[https://www.django-rest-framework.org/api-guide/relations/#nested-relationships](https://www.django-rest-framework.org/api-guide/relations/#nested-relationships)
​
I want to use the serializer for updating, so I'm using a code like this:
def update(self, instance, validated_data):
tracks_data = validated_data.pop('tracks')
tracks = instance.tracks.all()
tracks = list(tracks)
instance.album_name = validated_data.get('album_name', instance.album_name)
instance.artist = validated_data.get('artist', instance.artist)
instance.save()
for track_data in tracks_data:
track = tracks.pop(0)
track.order = track_data.get('order', track.order)
track.title = track_data.get('title', track.title)
track.duration = track_data.get('duration', track.duration)
track.save()
/r/django
https://redd.it/izozan
I'm building an API for a web application that I'm working on where I'm using a nested relationship for a create end point like the one here in the DRF framework
​
[https://www.django-rest-framework.org/api-guide/relations/#nested-relationships](https://www.django-rest-framework.org/api-guide/relations/#nested-relationships)
​
I want to use the serializer for updating, so I'm using a code like this:
def update(self, instance, validated_data):
tracks_data = validated_data.pop('tracks')
tracks = instance.tracks.all()
tracks = list(tracks)
instance.album_name = validated_data.get('album_name', instance.album_name)
instance.artist = validated_data.get('artist', instance.artist)
instance.save()
for track_data in tracks_data:
track = tracks.pop(0)
track.order = track_data.get('order', track.order)
track.title = track_data.get('title', track.title)
track.duration = track_data.get('duration', track.duration)
track.save()
/r/django
https://redd.it/izozan
www.django-rest-framework.org
Serializer relations - Django REST framework
Django, API, REST, Serializer relations
My open-source website built with Flask. You can convert audio and video files to another format, or download YouTube videos.
https://free-av-tools.com
Source code can be found on my GitHub page, GitHub.com/BassThatHertz
Feedback is welcome, whether it's regarding the website itself or the code. I'm not a Python expert, it was my first programming language which I started learning around Jan 2019 and I've been using it on-and-off since then. I had to learn Flask and JavaScript to make this website.
/r/flask
https://redd.it/izv8gd
https://free-av-tools.com
Source code can be found on my GitHub page, GitHub.com/BassThatHertz
Feedback is welcome, whether it's regarding the website itself or the code. I'm not a Python expert, it was my first programming language which I started learning around Jan 2019 and I've been using it on-and-off since then. I had to learn Flask and JavaScript to make this website.
/r/flask
https://redd.it/izv8gd
Free-Av-Tools
Home
Convert video and audio files to MP3, MP4, AAC, WAV, FLAC and more. Download YouTube videos or just the audio.
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/izv3tl
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/izv3tl
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...