Thursday megathread: Python careers!
Discussion of using Python in a professional environment, getting jobs in Python and more!
**This thread is not for recruitment, please see** r/PythonJobs **or the thread in the sidebar for that.**
/r/Python
https://redd.it/ihaiio
Discussion of using Python in a professional environment, getting jobs in Python and more!
**This thread is not for recruitment, please see** r/PythonJobs **or the thread in the sidebar for that.**
/r/Python
https://redd.it/ihaiio
reddit
Thursday megathread: Python careers!
Discussion of using Python in a professional environment, getting jobs in Python and more! **This thread is not for recruitment, please see**...
Django admin: adding objects for foreignkey from other side
so I have these two models:
class Recipe(models.Model):
short_description = HTMLField(max_length=400)
likes = models.ManyToManyField(User, blank=True,
related_name='recipe_likes')
slug = models.SlugField(blank=True, unique=True)
published_date = models.DateTimeField(blank=True, default=datetime.now)
ratings = GenericRelation(Rating, related_query_name='recipes')
class Ingredient(models.Model):
name = models.CharField(max_length=20)
amount = models.FloatField()
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE,
/r/django
https://redd.it/ihij82
so I have these two models:
class Recipe(models.Model):
short_description = HTMLField(max_length=400)
likes = models.ManyToManyField(User, blank=True,
related_name='recipe_likes')
slug = models.SlugField(blank=True, unique=True)
published_date = models.DateTimeField(blank=True, default=datetime.now)
ratings = GenericRelation(Rating, related_query_name='recipes')
class Ingredient(models.Model):
name = models.CharField(max_length=20)
amount = models.FloatField()
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE,
/r/django
https://redd.it/ihij82
reddit
Django admin: adding objects for foreignkey from other side
so I have these two models: class Recipe(models.Model): short_description = HTMLField(max_length=400) likes =...
Are my tests okay?
I read on Two Scoops of Django that you should test the following aspects of your models:
>Two Scoops of Django 3.x
>
>Models: Creating/updating/deletingofmodels,modelmethods,modelmanagermethods.
however, there is not an example of how to do it with pytest, is my approach correct for these tests?
​
models.py
from model_utils.models import TimeStampedModel
import uuid
# from mysocialbeer.accounts.models import Account
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
class Post(TimeStampedModel):
"""
This is the model that represent posts in MySocialBeer
"""
uid = models.UUIDField(default=uuid.uuid4())
title = models.CharField(verbose_name=_("Title"), max_length=50)
body = models.TextField(verbose_name=_("Body"))
latitude = models.FloatField(verbose_name=_("Latitude"))
/r/djangolearning
https://redd.it/ihskvi
I read on Two Scoops of Django that you should test the following aspects of your models:
>Two Scoops of Django 3.x
>
>Models: Creating/updating/deletingofmodels,modelmethods,modelmanagermethods.
however, there is not an example of how to do it with pytest, is my approach correct for these tests?
​
models.py
from model_utils.models import TimeStampedModel
import uuid
# from mysocialbeer.accounts.models import Account
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
class Post(TimeStampedModel):
"""
This is the model that represent posts in MySocialBeer
"""
uid = models.UUIDField(default=uuid.uuid4())
title = models.CharField(verbose_name=_("Title"), max_length=50)
body = models.TextField(verbose_name=_("Body"))
latitude = models.FloatField(verbose_name=_("Latitude"))
/r/djangolearning
https://redd.it/ihskvi
reddit
Are my tests okay?
I read on Two Scoops of Django that you should test the following aspects of your models: >Two Scoops of Django 3.x > >Models:...
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/ihwl4s
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/ihwl4s
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!
DearPyGui now supports Python 3.7
**DearPyGui** now supports Python **3.7** and **3.8**!
[https://github.com/hoffstadt/DearPyGui](https://github.com/hoffstadt/DearPyGui)
[https://pypi.org/project/dearpygui/](https://pypi.org/project/dearpygui/)
[https://www.reddit.com/r/DearPyGui/](https://www.reddit.com/r/DearPyGui/)
/r/Python
https://redd.it/ihnesx
**DearPyGui** now supports Python **3.7** and **3.8**!
[https://github.com/hoffstadt/DearPyGui](https://github.com/hoffstadt/DearPyGui)
[https://pypi.org/project/dearpygui/](https://pypi.org/project/dearpygui/)
[https://www.reddit.com/r/DearPyGui/](https://www.reddit.com/r/DearPyGui/)
/r/Python
https://redd.it/ihnesx
GitHub
GitHub - hoffstadt/DearPyGui: Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies - hoffstadt/DearPyGui
Is there a better way to handle unexpected view errors.
What I do is, I add a middleware so that in case the view function raises an unhandled exception the default Django response is overridden by my specified response, see the following code snippet.
class ErrorHandlingMiddleware:
"""
The purpose of this middleware is to handle unexpected errors in the requests and
provide a user friendly error response.
"""
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
return response
@staticmethod
def process_exception(request, exception):
if settings.DEBUG:
/r/django
https://redd.it/ihznwr
What I do is, I add a middleware so that in case the view function raises an unhandled exception the default Django response is overridden by my specified response, see the following code snippet.
class ErrorHandlingMiddleware:
"""
The purpose of this middleware is to handle unexpected errors in the requests and
provide a user friendly error response.
"""
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
return response
@staticmethod
def process_exception(request, exception):
if settings.DEBUG:
/r/django
https://redd.it/ihznwr
reddit
Is there a better way to handle unexpected view errors.
What I do is, I add a middleware so that in case the view function raises an unhandled exception the default Django response is overridden by my...
The Amazing Mutable, Immutable Tuple and Other Philosophic Digressions
https://www.youtube.com/watch?v=EVBq1boGP6s
/r/Python
https://redd.it/ihvs3i
https://www.youtube.com/watch?v=EVBq1boGP6s
/r/Python
https://redd.it/ihvs3i
YouTube
The Amazing Mutable Immutable Tuple and Other Philosophic Digressions
A Python talk I gave at PyCascades 2019, re-recorded for the web. I discuss Python tuples, mutability, the Python data model, and whether tuples are immutable or not. The original talk is at https://www.youtube.com/watch?v=argy7dRB_LI
I learned how to make an online Multiplayer game using Python!!
I am interested in game development but am very new to it. I've messed around with unity and C# for a bit but decided I wanted to learn how to create an online multiplayer game like Agario or Draw my things. I decided to use Python since it is my favorite language!
The whole process was pretty difficult. I had to learn to make web apps (flask), web sockets (socketio), manage databases, and a bunch of other stuff.
[If you are interested in the process or want to see how it turned out, check out my video here!](https://www.youtube.com/watch?v=DrYXpVLQY_E)
Thanks
/r/Python
https://redd.it/ii1tnj
I am interested in game development but am very new to it. I've messed around with unity and C# for a bit but decided I wanted to learn how to create an online multiplayer game like Agario or Draw my things. I decided to use Python since it is my favorite language!
The whole process was pretty difficult. I had to learn to make web apps (flask), web sockets (socketio), manage databases, and a bunch of other stuff.
[If you are interested in the process or want to see how it turned out, check out my video here!](https://www.youtube.com/watch?v=DrYXpVLQY_E)
Thanks
/r/Python
https://redd.it/ii1tnj
YouTube
I Made a Multiplayer Game (and got roasted)
Check now if your .TECH is available! https://go.tech/Tren
Use Code Tren at Checkout for a special 80% OFF on 1 & 5 Year .TECH Domains!
Play my game: https://www.watercolor.tech
► Patreon: https://www.patreon.com/trenblack
► Instagram: https://www.…
Use Code Tren at Checkout for a special 80% OFF on 1 & 5 Year .TECH Domains!
Play my game: https://www.watercolor.tech
► Patreon: https://www.patreon.com/trenblack
► Instagram: https://www.…
[R] Extended blog post on "Hopfield Networks is All You Need"
My colleague Johannes Brandstetter wrote an awesome blog post on our new paper "Hopfield Networks is All You Need": [https://ml-jku.github.io/hopfield-layers/](https://ml-jku.github.io/hopfield-layers/)
It illustratively introduces traditional, dense, and our modern Hopfield neworks, and provides explained code examples of the Hopfield layer.
Highly recommended!
/r/MachineLearning
https://redd.it/ii319z
My colleague Johannes Brandstetter wrote an awesome blog post on our new paper "Hopfield Networks is All You Need": [https://ml-jku.github.io/hopfield-layers/](https://ml-jku.github.io/hopfield-layers/)
It illustratively introduces traditional, dense, and our modern Hopfield neworks, and provides explained code examples of the Hopfield layer.
Highly recommended!
/r/MachineLearning
https://redd.it/ii319z
hopfield-layers
Hopfield Networks is All You Need
Blog post
PyWeek 30 starts on the 20th September!
***PyWeek 30 will begin on the 20th September (00:00 UTC) and end on the 27th September (00:00 UTC).***
# What is PyWeek?
PyWeek is one of the longest running events in the Python community – it's been run twice a year for the past 15 years! During the jam, competitors are given a theme which is decided by the community through a vote. You must build a game from scratch in a week using Python that relates to this theme. After the jam, your fellow competitors vote on submissions to decide a winner. You can see hundreds of previous submissions to PyWeek at [https://pyweek.org/all\_games/](https://pyweek.org/all_games/)
# How can I join?
You can enter PyWeek as an individual or as a team. If you are looking for teammates, you can find fellow PyWeekers in #pyweek on [Python Discord](https://discord.gg/python)! If you want to compete in PyWeek, check out the information on the PyWeek website at [https://pyweek.org/](https://pyweek.org/), you need to register with this site before September 27th (00:00 UTC) in order to participate!
# Where can I find out more?
You can find all the necessary rules and documentation at [https://pyweek.readthedocs.io/](https://pyweek.readthedocs.io/). There are no restrictions on what game library you use as long as the game logic is written in
/r/Python
https://redd.it/ii5r6d
***PyWeek 30 will begin on the 20th September (00:00 UTC) and end on the 27th September (00:00 UTC).***
# What is PyWeek?
PyWeek is one of the longest running events in the Python community – it's been run twice a year for the past 15 years! During the jam, competitors are given a theme which is decided by the community through a vote. You must build a game from scratch in a week using Python that relates to this theme. After the jam, your fellow competitors vote on submissions to decide a winner. You can see hundreds of previous submissions to PyWeek at [https://pyweek.org/all\_games/](https://pyweek.org/all_games/)
# How can I join?
You can enter PyWeek as an individual or as a team. If you are looking for teammates, you can find fellow PyWeekers in #pyweek on [Python Discord](https://discord.gg/python)! If you want to compete in PyWeek, check out the information on the PyWeek website at [https://pyweek.org/](https://pyweek.org/), you need to register with this site before September 27th (00:00 UTC) in order to participate!
# Where can I find out more?
You can find all the necessary rules and documentation at [https://pyweek.readthedocs.io/](https://pyweek.readthedocs.io/). There are no restrictions on what game library you use as long as the game logic is written in
/r/Python
https://redd.it/ii5r6d
Build Your Own Flight Tracking Application with Python and Open Air Traffic Data
I wrote a tutorial how to build a flight tracking application with Python and Open Air Traffic Data from OpenSky Network. Check out the tutorial and the code.
[https://www.geodose.com/2020/08/create-flight-tracking-apps-using-python-open-data.html](https://www.geodose.com/2020/08/create-flight-tracking-apps-using-python-open-data.html)
[filght tracking application](https://i.redd.it/vg1z387kzpj51.gif)
/r/Python
https://redd.it/ii4oga
I wrote a tutorial how to build a flight tracking application with Python and Open Air Traffic Data from OpenSky Network. Check out the tutorial and the code.
[https://www.geodose.com/2020/08/create-flight-tracking-apps-using-python-open-data.html](https://www.geodose.com/2020/08/create-flight-tracking-apps-using-python-open-data.html)
[filght tracking application](https://i.redd.it/vg1z387kzpj51.gif)
/r/Python
https://redd.it/ii4oga
Geodose
Build Your Own Flight Tracking Application with Python and Open Air Traffic Data
APIs.
I recently joined as a Intern in a company mainly assisting in Back End. Now, last day, my frontends developers came to me and asked me to provide the Api . So, does that mean I should be providing all the codes that I have written for APis.?? I developed simple apis using serialization of some models. Now, I should provide the source code and endpoints to that frontend developer? I mean cant he looked into my Github and download the code? I am totally lost.
/r/django
https://redd.it/ii3isd
I recently joined as a Intern in a company mainly assisting in Back End. Now, last day, my frontends developers came to me and asked me to provide the Api . So, does that mean I should be providing all the codes that I have written for APis.?? I developed simple apis using serialization of some models. Now, I should provide the source code and endpoints to that frontend developer? I mean cant he looked into my Github and download the code? I am totally lost.
/r/django
https://redd.it/ii3isd
reddit
APIs.
I recently joined as a Intern in a company mainly assisting in Back End. Now, last day, my frontends developers came to me and asked me to provide...
[News] Apple's AI/ML Residency Program
Apple just announced it's new AI/ML residency program! More details about the program can be found at [https://machinelearning.apple.com/updates/introducing-aiml-residency-program](https://machinelearning.apple.com/updates/introducing-aiml-residency-program). The program is available in multiple locations -- details [here](https://jobs.apple.com/en-us/search?search=%23aimlresidency&sort=relevance).
I'm an ML engineer at Apple Special Projects Group (SPG) in the Applied ML team led by Ian Goodfellow, and I'll be a resident host for this program. To apply to work on my team, please check out [https://jobs.apple.com/en-us/details/200175569/ai-ml-residency-program?team=MLAI](https://jobs.apple.com/en-us/details/200175569/ai-ml-residency-program?team=MLAI).
/r/MachineLearning
https://redd.it/ii18ae
Apple just announced it's new AI/ML residency program! More details about the program can be found at [https://machinelearning.apple.com/updates/introducing-aiml-residency-program](https://machinelearning.apple.com/updates/introducing-aiml-residency-program). The program is available in multiple locations -- details [here](https://jobs.apple.com/en-us/search?search=%23aimlresidency&sort=relevance).
I'm an ML engineer at Apple Special Projects Group (SPG) in the Applied ML team led by Ian Goodfellow, and I'll be a resident host for this program. To apply to work on my team, please check out [https://jobs.apple.com/en-us/details/200175569/ai-ml-residency-program?team=MLAI](https://jobs.apple.com/en-us/details/200175569/ai-ml-residency-program?team=MLAI).
/r/MachineLearning
https://redd.it/ii18ae
Why Django and Not...
Hey all, I work for a company that's considering a major redo of their e-commerce platform. We're considering a bunch of frameworks for this: Rails, Laravel, Django, and Node. So I thought I'd ask the community here what would be some good reasons for Django over these others? Thanks so much in advance. :)
/r/django
https://redd.it/iiaelg
Hey all, I work for a company that's considering a major redo of their e-commerce platform. We're considering a bunch of frameworks for this: Rails, Laravel, Django, and Node. So I thought I'd ask the community here what would be some good reasons for Django over these others? Thanks so much in advance. :)
/r/django
https://redd.it/iiaelg
reddit
Why Django and Not...
Hey all, I work for a company that's considering a major redo of their e-commerce platform. We're considering a bunch of frameworks for this:...
I created a webapp for generating mock data
https://www.mockerdata.com/
/r/flask
https://redd.it/iiadxc
https://www.mockerdata.com/
/r/flask
https://redd.it/iiadxc
How to run all cells?
I tried to create a keyboard shortcut for it, but it doesn't work...
​
https://preview.redd.it/l0kzylrsyij51.png?width=879&format=png&auto=webp&s=c6309c76b35effba03f903480745af5d4a245010
/r/JupyterNotebooks
https://redd.it/ihitfy
I tried to create a keyboard shortcut for it, but it doesn't work...
​
https://preview.redd.it/l0kzylrsyij51.png?width=879&format=png&auto=webp&s=c6309c76b35effba03f903480745af5d4a245010
/r/JupyterNotebooks
https://redd.it/ihitfy
This post has
961 upvotes,
197 downvotes,
and 125 comments!
Credit to u/Krukerfluk and Tom Scott!
Code: https://github.com/CalvinMiller190/reddit-post
This post uses the [praw module](https://praw.readthedocs.io/en/latest/) to get the information about the post, then edits the post every second based on the information that it got!
/r/Python
https://redd.it/iiamfv
961 upvotes,
197 downvotes,
and 125 comments!
Credit to u/Krukerfluk and Tom Scott!
Code: https://github.com/CalvinMiller190/reddit-post
This post uses the [praw module](https://praw.readthedocs.io/en/latest/) to get the information about the post, then edits the post every second based on the information that it got!
/r/Python
https://redd.it/iiamfv
GitHub
CalvinMiller190/reddit-post
Changes reddit post body based on how much upvotes, downvotes, and comments the post has. - CalvinMiller190/reddit-post
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/iiihwe
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/iiihwe
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...
Is it worthy to use frontend framework like react or vue with Django?
Django comes up with DTL which has enough power to create pretty much everything.
But in the world full of JS frameworks I'd like to know is there any benefit if using javascript frontend frameworks along with Django?
Also give some use cases!
/r/django
https://redd.it/iilow7
Django comes up with DTL which has enough power to create pretty much everything.
But in the world full of JS frameworks I'd like to know is there any benefit if using javascript frontend frameworks along with Django?
Also give some use cases!
/r/django
https://redd.it/iilow7
reddit
Is it worthy to use frontend framework like react or vue with Django?
Django comes up with DTL which has enough power to create pretty much everything. But in the world full of JS frameworks I'd like to know is...