I just wanna give a shout-out to my friends in the Django community
I work with a small business and I don’t get to use Django in my work environment (I’m working with PHP) but I come home and practice with Django, building small things. I love the framework. I hope to make it a professional thing sooner than later.
/r/django
https://redd.it/xdry91
I work with a small business and I don’t get to use Django in my work environment (I’m working with PHP) but I come home and practice with Django, building small things. I love the framework. I hope to make it a professional thing sooner than later.
/r/django
https://redd.it/xdry91
reddit
I just wanna give a shout-out to my friends in the Django community
I work with a small business and I don’t get to use Django in my work environment (I’m working with PHP) but I come home and practice with Django,...
djstripe admin cannot view synced plans or products
I have a problem when I use django admin to view products and prices in djstripe. I have synced everything on Stripe portal. I get an error Exception Type: TypeError at /admin/djstripe/plan/ Exception Value: 'NoneType' object is not subscriptable
How do I solve this? Been stuck here
/r/django
https://redd.it/xdwykx
I have a problem when I use django admin to view products and prices in djstripe. I have synced everything on Stripe portal. I get an error Exception Type: TypeError at /admin/djstripe/plan/ Exception Value: 'NoneType' object is not subscriptable
How do I solve this? Been stuck here
/r/django
https://redd.it/xdwykx
reddit
djstripe admin cannot view synced plans or products
I have a problem when I use django admin to view products and prices in djstripe. I have synced everything on Stripe portal. I get an error...
Tips and Tricks to Use Jupyter Notebooks Effectively
https://ploomber.io/blog/tips-tricks-notebooks/
/r/IPython
https://redd.it/wdn112
https://ploomber.io/blog/tips-tricks-notebooks/
/r/IPython
https://redd.it/wdn112
ploomber.io
Tips and Tricks to Use Jupyter Notebooks Effectively
Keyboard shortcuts, code magics, quick documentation, and more!
django all auth twitter error
Can sb check my setup for twitter as a login provider?
settings.py
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.twitter',
'myapp',
'django_select2',
'django_tables2',
'django_filters',
'bootstrap4'
]
SITE_ID = 1
/r/django
https://redd.it/xdz9em
Can sb check my setup for twitter as a login provider?
settings.py
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.twitter',
'myapp',
'django_select2',
'django_tables2',
'django_filters',
'bootstrap4'
]
SITE_ID = 1
/r/django
https://redd.it/xdz9em
reddit
django all auth twitter error
Can sb check my setup for twitter as a login provider? settings.py # Application definition INSTALLED_APPS = [ ...
Having to stop Flask server to run other functions.
I'm currently trying to make a simple flask server that gets input from the local frontend, uses the input to get certain data from a CSV, and then send the data back to the frontend. (I'm brand new to python and web development).
The issue that I'm having is this:
When I run the program, it starts the server and I go onto the frontend and post the input to the backend. It then stores the input in a variable.
I then have to manually stop the server by pressing ctrl-c. This then allows the code after it to run. (The function to get data from the CSV).
Do I then have to automatically restart the server to then send the data to the frontend? This just seems too complicated, and I've been told that you can do all this without stopping the server at all in the first place. I heavily get the sense that I'm missing the trick somewhere, however I'm new to this so pls understand :).
Please let me know if the above makes no sense and I'll try to rephrase.
/r/flask
https://redd.it/xe46js
I'm currently trying to make a simple flask server that gets input from the local frontend, uses the input to get certain data from a CSV, and then send the data back to the frontend. (I'm brand new to python and web development).
The issue that I'm having is this:
When I run the program, it starts the server and I go onto the frontend and post the input to the backend. It then stores the input in a variable.
I then have to manually stop the server by pressing ctrl-c. This then allows the code after it to run. (The function to get data from the CSV).
Do I then have to automatically restart the server to then send the data to the frontend? This just seems too complicated, and I've been told that you can do all this without stopping the server at all in the first place. I heavily get the sense that I'm missing the trick somewhere, however I'm new to this so pls understand :).
Please let me know if the above makes no sense and I'll try to rephrase.
/r/flask
https://redd.it/xe46js
reddit
Having to stop Flask server to run other functions.
I'm currently trying to make a simple flask server that gets input from the local frontend, uses the input to get certain data from a CSV, and...
Making Jupyter notebooks more SQL-friendly?
As a data scientist, I spend a lot of time preparing SQL queries, usually in a Jupyter notebook; however, I feel the experience isn't smooth. After a few days of beginning some analysis, my notebook is full of copy-pasted SQL chunks and a weird mix of SQL and pandas.
Sometimes I use the [ipython-sql](https://github.com/catherinedevlin/ipython-sql) extension, allowing me to write simpler code than [pandas.read\_sql](https://pandas.pydata.org/docs/reference/api/pandas.read_sql.html). However, I think some features would come in handy.
Here's my wishlist:
* Facilitate writing large queries
* Choosing plotting backends like matplotlib, plotly, etc.
* Plot computation by the SQL engine
Anything I'm missing? What would it make a smooth SQL experience in Jupyter notebooks for you?
/r/IPython
https://redd.it/wb5fwh
As a data scientist, I spend a lot of time preparing SQL queries, usually in a Jupyter notebook; however, I feel the experience isn't smooth. After a few days of beginning some analysis, my notebook is full of copy-pasted SQL chunks and a weird mix of SQL and pandas.
Sometimes I use the [ipython-sql](https://github.com/catherinedevlin/ipython-sql) extension, allowing me to write simpler code than [pandas.read\_sql](https://pandas.pydata.org/docs/reference/api/pandas.read_sql.html). However, I think some features would come in handy.
Here's my wishlist:
* Facilitate writing large queries
* Choosing plotting backends like matplotlib, plotly, etc.
* Plot computation by the SQL engine
Anything I'm missing? What would it make a smooth SQL experience in Jupyter notebooks for you?
/r/IPython
https://redd.it/wb5fwh
GitHub
GitHub - catherinedevlin/ipython-sql: %%sql magic for IPython, hopefully evolving into full SQL client
%%sql magic for IPython, hopefully evolving into full SQL client - catherinedevlin/ipython-sql
3 models union function mixing up values
so I have this function
`def all(request):`
`movie = List.objects.all()`
`music = MusicList.objects.all()`
`book = BookList.objects.all()`
`a = movie.union(music)`
`allPosts = a.union(book)`
`# allPosts = List.objects.filter(title__search=query)`
`params = {'allPosts' : allPosts}`
`return render(request, 'app/all.html', params)`
All 3 models have same fields
​
`class List(models.Model):`
`title = models.CharField(max_length=65)`
`author = models.ForeignKey('Author',on_delete=models.SET_NULL,null=True)`
`genre = models.ManyToManyField('Genre')`
`posted = models.DateTimeField(auto_now_add=True)`
`content = RichTextField(null=True,default=' ')`
`type = models.CharField(max_length=10,default="Movie")`
`class BookList(models.Model):`
`title = models.CharField(max_length=65)`
`author = models.ForeignKey('Author',on_delete=models.SET_NULL,null=True)`
`genre = models.ManyToManyField('BookGenre')`
`posted = models.DateTimeField(auto_now_add=True)`
`content = RichTextField(null=True,default=' ')`
`type = models.CharField(max_length=10,default="book")`
​
and so on
​
in my template
`<div class="thumb">{{allPosts}}</div>`
`{% for lola in allPosts %}`
`<div class="elements">`
`<div class="thumb">`
`<img src="{% static 'app/images/movie-poster.jpg' %}" width="100px" />`
`</div>`
`<div class="Title">`
`{% comment %} <a href="{{lola.id}}/"><h4 class="tit">{{lola.title}}</h4></a> {% endcomment %}`
`<a href="{{lola.id}}/"><h4 class="tit">{{lola.title}}</h4></a>`
`</div>`
`<div class="Author">`
`<small>Author : {{lola.author}}<span>{{lola.posted}}</span></small>`
`</div>`
`<div
/r/django
https://redd.it/xe9bjo
so I have this function
`def all(request):`
`movie = List.objects.all()`
`music = MusicList.objects.all()`
`book = BookList.objects.all()`
`a = movie.union(music)`
`allPosts = a.union(book)`
`# allPosts = List.objects.filter(title__search=query)`
`params = {'allPosts' : allPosts}`
`return render(request, 'app/all.html', params)`
All 3 models have same fields
​
`class List(models.Model):`
`title = models.CharField(max_length=65)`
`author = models.ForeignKey('Author',on_delete=models.SET_NULL,null=True)`
`genre = models.ManyToManyField('Genre')`
`posted = models.DateTimeField(auto_now_add=True)`
`content = RichTextField(null=True,default=' ')`
`type = models.CharField(max_length=10,default="Movie")`
`class BookList(models.Model):`
`title = models.CharField(max_length=65)`
`author = models.ForeignKey('Author',on_delete=models.SET_NULL,null=True)`
`genre = models.ManyToManyField('BookGenre')`
`posted = models.DateTimeField(auto_now_add=True)`
`content = RichTextField(null=True,default=' ')`
`type = models.CharField(max_length=10,default="book")`
​
and so on
​
in my template
`<div class="thumb">{{allPosts}}</div>`
`{% for lola in allPosts %}`
`<div class="elements">`
`<div class="thumb">`
`<img src="{% static 'app/images/movie-poster.jpg' %}" width="100px" />`
`</div>`
`<div class="Title">`
`{% comment %} <a href="{{lola.id}}/"><h4 class="tit">{{lola.title}}</h4></a> {% endcomment %}`
`<a href="{{lola.id}}/"><h4 class="tit">{{lola.title}}</h4></a>`
`</div>`
`<div class="Author">`
`<small>Author : {{lola.author}}<span>{{lola.posted}}</span></small>`
`</div>`
`<div
/r/django
https://redd.it/xe9bjo
reddit
3 models union function mixing up values
so I have this function `def all(request):` `movie = List.objects.all()` `music = MusicList.objects.all()` `book =...
How do I integrate Django rest with ckeditor?
Does anybody know a good tutorial that explains how to integrate Django rest Framework with ckeditor (or any similar editor). I am making a RESTfull API to be consumed with react. I would like to edit blog posts on Django Admin then use the endpoints in react. I have been googling for the same but I can not find a tutorial. Here's the project if you wanna look around. Thanks.
/r/django
https://redd.it/xea042
Does anybody know a good tutorial that explains how to integrate Django rest Framework with ckeditor (or any similar editor). I am making a RESTfull API to be consumed with react. I would like to edit blog posts on Django Admin then use the endpoints in react. I have been googling for the same but I can not find a tutorial. Here's the project if you wanna look around. Thanks.
/r/django
https://redd.it/xea042
GitHub
GitHub - mosesmbadi/todayilearn: Containerized RESTful API created with Django Rest framework
Containerized RESTful API created with Django Rest framework - mosesmbadi/todayilearn
how to correct this error?
I want to show whether those who scored lower will have lower salary than those who scored higher.
https://preview.redd.it/yyenlky6e8e91.png?width=883&format=png&auto=webp&s=345422026e344d1cb24afdb33773d3999eebe63f
/r/IPython
https://redd.it/w9z77l
I want to show whether those who scored lower will have lower salary than those who scored higher.
https://preview.redd.it/yyenlky6e8e91.png?width=883&format=png&auto=webp&s=345422026e344d1cb24afdb33773d3999eebe63f
/r/IPython
https://redd.it/w9z77l
Machine Learning from Scratch with Python
Hey everyone!
I've seen a growing number of people looking for resources on how to implement Machine Learning algos from scratch to better understand how they work (rather than just applying e.g. sklearn).
This free **Machine Learning from Scratch Course** on YouTube takes you through writing 10 algorithms from scratch with nothing but Python and NumPy! The algorithms are:
1. K-Nearest Neighbors
2. Linear Regression
3. Logistic Regression
4. Decision Trees
5. Random Forest
6. Naive Bayes
7. PCA
8. Perceptron
9. SVM
10. K-Means
Hopefully some of my Python + ML friends will find this helpful! :)
/r/Python
https://redd.it/xe2mzy
Hey everyone!
I've seen a growing number of people looking for resources on how to implement Machine Learning algos from scratch to better understand how they work (rather than just applying e.g. sklearn).
This free **Machine Learning from Scratch Course** on YouTube takes you through writing 10 algorithms from scratch with nothing but Python and NumPy! The algorithms are:
1. K-Nearest Neighbors
2. Linear Regression
3. Logistic Regression
4. Decision Trees
5. Random Forest
6. Naive Bayes
7. PCA
8. Perceptron
9. SVM
10. K-Means
Hopefully some of my Python + ML friends will find this helpful! :)
/r/Python
https://redd.it/xe2mzy
YouTube
Machine Learning From Scratch Full course
To master machine learning models, one of the best things you can do is to implement them yourself. Although it might seem like a difficult task, for most algorithms, it is actually easier than you think. So throughout the next 10 days, we will implement…
Xarray variables
Is there any way to see xarray variables on variable inspector?
Thanks in advance.
/r/JupyterNotebooks
https://redd.it/xd2dg5
Is there any way to see xarray variables on variable inspector?
Thanks in advance.
/r/JupyterNotebooks
https://redd.it/xd2dg5
reddit
Xarray variables
Is there any way to see xarray variables on variable inspector? Thanks in advance.
What kind of subplots is the best?
​
https://preview.redd.it/pf4doyu36xd91.png?width=1234&format=png&auto=webp&s=903c951f219a64964871611a54462825e00435eb
Tried using the codes below but it is not the kind i wanted. I wanted 4 subplots with the xaxis as 'salary' or is there other way to show it?
plt.figure(figsize=(14,8))
sns.pairplot(df['ssc_p','hsc_p','degree_p','etest_p'], kind="reg")
/r/IPython
https://redd.it/w8kplp
​
https://preview.redd.it/pf4doyu36xd91.png?width=1234&format=png&auto=webp&s=903c951f219a64964871611a54462825e00435eb
Tried using the codes below but it is not the kind i wanted. I wanted 4 subplots with the xaxis as 'salary' or is there other way to show it?
plt.figure(figsize=(14,8))
sns.pairplot(df['ssc_p','hsc_p','degree_p','etest_p'], kind="reg")
/r/IPython
https://redd.it/w8kplp
Argument parsing/validation for flask?
Is there a way with flask to create some sort of argument serializer deserializer?
I really like in django how you can specify a serializier that take a requests urlparams/body and tells you which fields are correct, which are required and what format they need to be in.
I was hoping there might be an equivalent for endpoints that don't directly use a sqlalchemy/marshmallow serializer
thanks for any help!
/r/flask
https://redd.it/xe9r5v
Is there a way with flask to create some sort of argument serializer deserializer?
I really like in django how you can specify a serializier that take a requests urlparams/body and tells you which fields are correct, which are required and what format they need to be in.
I was hoping there might be an equivalent for endpoints that don't directly use a sqlalchemy/marshmallow serializer
thanks for any help!
/r/flask
https://redd.it/xe9r5v
reddit
Argument parsing/validation for flask?
Is there a way with flask to create some sort of argument serializer deserializer? I really like in django how you can specify a serializier...
CI/CD Django How to make this work: push to GitHub > run GitHub action (tests) > auto deploy app if tests passed?
Hello guys,
I'm new in CI/CD and not-so-experienced in Docker. Right now I have my Django project deployed on DigitalOcean droplet and every time new code is pushed to GitHub, after GitHub action that runs tests automatically, I need to deploy the project manually.
I'm trying to figure out how to make this flow automatic.
This is what I want:
1. push to master (manually)
2. run tests on master (auto)
3. automatically deploy app (auto) if tests passed
I'm considering DigitalOcean Apps platform but the code would be deployed even before the tests passed.
I'm also considering Dockerizing the app but I'm not sure how that would help.
​
Can you give me some advice? How would you do that?
​
Thanks
/r/django
https://redd.it/xecxo5
Hello guys,
I'm new in CI/CD and not-so-experienced in Docker. Right now I have my Django project deployed on DigitalOcean droplet and every time new code is pushed to GitHub, after GitHub action that runs tests automatically, I need to deploy the project manually.
I'm trying to figure out how to make this flow automatic.
This is what I want:
1. push to master (manually)
2. run tests on master (auto)
3. automatically deploy app (auto) if tests passed
I'm considering DigitalOcean Apps platform but the code would be deployed even before the tests passed.
I'm also considering Dockerizing the app but I'm not sure how that would help.
​
Can you give me some advice? How would you do that?
​
Thanks
/r/django
https://redd.it/xecxo5
reddit
[CI/CD Django] How to make this work: push to GitHub > run GitHub...
Hello guys, I'm new in **CI/CD** and not-so-experienced in **Docker**. Right now I have my **Django** project deployed on **DigitalOcean**...
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!
This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.
/r/Python
https://redd.it/xehfdb
Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!
This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.
/r/Python
https://redd.it/xehfdb
reddit
Thursday Daily Thread: Python Careers, Courses, and Furthering...
Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python...
Three Tools for Executing Jupyter Notebooks
https://ploomber.io/blog/notebook-execution/
/r/IPython
https://redd.it/w7ucii
https://ploomber.io/blog/notebook-execution/
/r/IPython
https://redd.it/w7ucii
ploomber.io
Three Tools for Executing Jupyter Notebooks
Execute Jupyter notebooks from the terminal or Python.
Deployment - After setting up Gunicorn, Nginx and turn DEBUG = False, how do you update your code?
Is this done through your VPS service (digitalocean, vultr, aws, etc.) ? I am still in my local environment and I have a self-signed HTTPS cert set up so I can "see" what my project will look like without running Django's built-in server. Everything looks good but I wanted to change a couple of things (css, html in the templates, and some of my backend logic in the views.py) but none of my changes have taken effect.
I have:
cleared my browsers cache, restarted Gunicorn and Nginx service, none of it worked. It's almost as if Gunicorn and Nginx have a snapshot of my web app and cannot see any updates that I make.
Any help would be greatly appreciated.
/r/django
https://redd.it/xero8v
Is this done through your VPS service (digitalocean, vultr, aws, etc.) ? I am still in my local environment and I have a self-signed HTTPS cert set up so I can "see" what my project will look like without running Django's built-in server. Everything looks good but I wanted to change a couple of things (css, html in the templates, and some of my backend logic in the views.py) but none of my changes have taken effect.
I have:
cleared my browsers cache, restarted Gunicorn and Nginx service, none of it worked. It's almost as if Gunicorn and Nginx have a snapshot of my web app and cannot see any updates that I make.
Any help would be greatly appreciated.
/r/django
https://redd.it/xero8v
Web Scraping With Python (An Ultimate Guide)
https://www.scrapingdog.com/blog/web-scraping-with-python/
/r/Python
https://redd.it/xetbdk
https://www.scrapingdog.com/blog/web-scraping-with-python/
/r/Python
https://redd.it/xetbdk
scrapingdog
Python Web Scraping Guide | Scrapingdog
Learn Python Web Scraping from scratch! This guide covers 8 popular libraries with live examples to help you master data extraction.
Real-time glucose updates on Discord
I made a small python script to read your glucose level and update your discord 'playing status' accordingly. Also displays a quote based this value.
Here's a link to the Github. Make sure to give some feedback.
This script uses the API of the external LibreLinkUp app and sents some HTTP requests to retreive glucose data.
It also uses qwertyquerty's Pypresence to update Discord's 'Currently playing status' in which the glucose level and other data is shown.
​
Example of my blood sugar being a little high after a meal.
​
Another example. This time it is on a good value.
I am planning on running this on my raspberry pi at home so it will update constantly.
It was a very fun little project to work on!
By the way, if you got some fun quotes, make sure to post them in the comments and I might add them.
/r/Python
https://redd.it/xf0i8c
I made a small python script to read your glucose level and update your discord 'playing status' accordingly. Also displays a quote based this value.
Here's a link to the Github. Make sure to give some feedback.
This script uses the API of the external LibreLinkUp app and sents some HTTP requests to retreive glucose data.
It also uses qwertyquerty's Pypresence to update Discord's 'Currently playing status' in which the glucose level and other data is shown.
​
Example of my blood sugar being a little high after a meal.
​
Another example. This time it is on a good value.
I am planning on running this on my raspberry pi at home so it will update constantly.
It was a very fun little project to work on!
By the way, if you got some fun quotes, make sure to post them in the comments and I might add them.
/r/Python
https://redd.it/xf0i8c
GitHub
GitHub - LennartCMol/How-Sweet-Am-I: A python script to read your glucose level and update your discord 'playing status' accordingly.…
A python script to read your glucose level and update your discord 'playing status' accordingly. Also displays a quote based this value. - GitHub - LennartCMol/How-Sweet-Am-I: A py...