I wrote a Python game engine that runs on WebAssembly
https://pickitup247.com/pyckitup.html
/r/Python
https://redd.it/azqrvy
https://pickitup247.com/pyckitup.html
/r/Python
https://redd.it/azqrvy
reddit
r/Python - I wrote a Python game engine that runs on WebAssembly
27 votes and 4 comments so far on Reddit
Jupyter notebook XSSI security fix
https://blog.jupyter.org/jupyter-notebook-xssi-security-fix-546cd95babb0
/r/IPython
https://redd.it/azgdce
https://blog.jupyter.org/jupyter-notebook-xssi-security-fix-546cd95babb0
/r/IPython
https://redd.it/azgdce
Jupyter Blog
Jupyter notebook XSSI security fix
We have just released Jupyter notebook 5.7.6 with a security fix for a cross-site inclusion (XSSI) vulnerability, where content from a…
Multiple Image/File Upload with Django, Ionic 4 and FormData
https://www.techiediaries.com/ionic-formdata-multiple-file-upload-tutorial/
/r/django
https://redd.it/azsdeh
https://www.techiediaries.com/ionic-formdata-multiple-file-upload-tutorial/
/r/django
https://redd.it/azsdeh
Techiediaries
Multiple Image Upload with Ionic 6 and FormData | Techiediaries
In this tutorial, you'll learn to implement multiple file upload with Ionic 6, django 3 and FormData
Behavior-Driven Development with Django and Aloe - updated!
https://testdriven.io/blog/behavior-driven-development-with-django-and-aloe/#.XIZgCJtRHiw.reddit
/r/django
https://redd.it/aztcz1
https://testdriven.io/blog/behavior-driven-development-with-django-and-aloe/#.XIZgCJtRHiw.reddit
/r/django
https://redd.it/aztcz1
testdriven.io
Behavior-Driven Development with Django and Aloe
This article details the Behavior-Driven Development (BDD) cycle with Django and Aloe.
RelatedObjectDoesNotExist: User has no "usertype"
I am having issues with Django defining a custom user, which in this case is "cust" (short for customer) in Django 2.1. I have several other user types which contain separate registration forms to register them as a specific user type. I have built this from the tutorial *"How to Implement Multiple User Types with Django"* by Vitor Freitas, which eliminates Django's default user management system. My goal is to have a protected view (customer hub) which only customers can enter, and so on for other user types.
​
My traceback error, respectively, is:
**RelatedObjectDoesNotExist at /companyusers/cust/**
**User has no cust.**
/r/django
https://redd.it/azu965
I am having issues with Django defining a custom user, which in this case is "cust" (short for customer) in Django 2.1. I have several other user types which contain separate registration forms to register them as a specific user type. I have built this from the tutorial *"How to Implement Multiple User Types with Django"* by Vitor Freitas, which eliminates Django's default user management system. My goal is to have a protected view (customer hub) which only customers can enter, and so on for other user types.
​
My traceback error, respectively, is:
**RelatedObjectDoesNotExist at /companyusers/cust/**
**User has no cust.**
/r/django
https://redd.it/azu965
reddit
r/django - RelatedObjectDoesNotExist: User has no "usertype"
0 votes and 1 comment so far on Reddit
[N] OpenAI LP
"We’ve created OpenAI LP, a new “capped-profit” company that allows us to rapidly increase our investments in compute and talent while including checks and balances to actualize our mission."
Sneaky.
https://openai.com/blog/openai-lp/
/r/MachineLearning
https://redd.it/azvbmn
"We’ve created OpenAI LP, a new “capped-profit” company that allows us to rapidly increase our investments in compute and talent while including checks and balances to actualize our mission."
Sneaky.
https://openai.com/blog/openai-lp/
/r/MachineLearning
https://redd.it/azvbmn
Openai
OpenAI LP
We’ve created OpenAI LP, a new “capped-profit” company that allows us to rapidly increase our investments in compute and talent while including checks and balances to actualize our mission.
Detect "real" vs. "fake/spoofed" faces with Python and OpenCV.
https://www.pyimagesearch.com/2019/03/11/liveness-detection-with-opencv/
/r/Python
https://redd.it/azu4ry
https://www.pyimagesearch.com/2019/03/11/liveness-detection-with-opencv/
/r/Python
https://redd.it/azu4ry
PyImageSearch
Liveness Detection with OpenCV - PyImageSearch
Learn how to detect liveness with OpenCV, Deep Learning, and Keras. You'll learn how to detect fake faces and perform anti-face spoofing in face recognition systems with OpenCV.
Question about front-end/back-end interaction: when user clicks on data X, how can I memorize X to re-use in another part of my template?
Hi guys,
I'm sure what I need help with is something very simple to most of you, but I'm relatively new to back-end programming and can't really figure this out.
So I'm building an app that collects information about academic publications. I'm using Django for the back-end and jQuery for the front end.
In my models, among other things, I have a Publication class that has a M2M relationship with an Author class. Each publication includes citations from other publications, therefore the Publication class has another M2M relationship, this time a *recursive* one, that goes through a CitationMetadata class. It looks like this:
class Publication(models.Model):
author = models.ManyToManyField('Author', through='PublicationAuthor', related_name='publications')
title = models.CharField(max_length=200)
year = models.IntegerField()
abstract = models.TextField()
citation = models.ManyToManyField('self', through='CitationMetadata', through_fields=('citer_pub', 'cited_pub'), symmetrical=False, related_name='citations')
class Author(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
class PublicationAuthor(models.Model):
author = models.ForeignKey('Author', related_name='publication_authors', on_delete=models.CASCADE)
publication = models.ForeignKey('Publication', related_name='publication_authors', on_delete=models.CASCADE)
author_rank = models.IntegerField()
/r/django
https://redd.it/azwwxn
Hi guys,
I'm sure what I need help with is something very simple to most of you, but I'm relatively new to back-end programming and can't really figure this out.
So I'm building an app that collects information about academic publications. I'm using Django for the back-end and jQuery for the front end.
In my models, among other things, I have a Publication class that has a M2M relationship with an Author class. Each publication includes citations from other publications, therefore the Publication class has another M2M relationship, this time a *recursive* one, that goes through a CitationMetadata class. It looks like this:
class Publication(models.Model):
author = models.ManyToManyField('Author', through='PublicationAuthor', related_name='publications')
title = models.CharField(max_length=200)
year = models.IntegerField()
abstract = models.TextField()
citation = models.ManyToManyField('self', through='CitationMetadata', through_fields=('citer_pub', 'cited_pub'), symmetrical=False, related_name='citations')
class Author(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
class PublicationAuthor(models.Model):
author = models.ForeignKey('Author', related_name='publication_authors', on_delete=models.CASCADE)
publication = models.ForeignKey('Publication', related_name='publication_authors', on_delete=models.CASCADE)
author_rank = models.IntegerField()
/r/django
https://redd.it/azwwxn
reddit
r/django - Question about front-end/back-end interaction: when user clicks on data X, how can I memorize X to re-use in another…
4 votes and 10 comments so far on Reddit
Has anyone used Django + NodeJS together?
I have a long history of using django for everything. It's fantastic for so many things. But it utterly falls down once you get into responsiveness and websockets. Sorry channels, I've used you, but you just don't compare to NodeJS.
​
I am curious if anyone has attempted to use django over a DB for the things its good at, while also using Node over the same DB for the things its good at?
​
Which makes me think that the biggest problem is; has anyone had success auth'ing/passing tokens/something with node against django's auth system?
/r/django
https://redd.it/azzltx
I have a long history of using django for everything. It's fantastic for so many things. But it utterly falls down once you get into responsiveness and websockets. Sorry channels, I've used you, but you just don't compare to NodeJS.
​
I am curious if anyone has attempted to use django over a DB for the things its good at, while also using Node over the same DB for the things its good at?
​
Which makes me think that the biggest problem is; has anyone had success auth'ing/passing tokens/something with node against django's auth system?
/r/django
https://redd.it/azzltx
reddit
r/django - Has anyone used Django + NodeJS together?
5 votes and 4 comments so far on Reddit
Learning Django Repository
I have started a repository for anybody interested in learning Django. It will be an open source project where you can just fork the repository and make changes. The goal is to make a clone of Reddit, simply for learning purposes, and you can make any changes you want, then initiate a pull request.
[https://github.com/codexplore-io/django-learning-reddit-clone](https://github.com/codexplore-io/django-learning-reddit-clone)
/r/django
https://redd.it/azzla6
I have started a repository for anybody interested in learning Django. It will be an open source project where you can just fork the repository and make changes. The goal is to make a clone of Reddit, simply for learning purposes, and you can make any changes you want, then initiate a pull request.
[https://github.com/codexplore-io/django-learning-reddit-clone](https://github.com/codexplore-io/django-learning-reddit-clone)
/r/django
https://redd.it/azzla6
GitHub
codexplore-io/django-learning-reddit-clone
Contribute to codexplore-io/django-learning-reddit-clone development by creating an account on GitHub.
Help trying to understand nested serializers
I've started to mess around with Django Rest Framework, and its amazing. However, I'm overwhelmed at the same time as to how many options there are (generics, viewsets, different ways to handle nested relationships, etc.) I thought of a good exercise for my self, but am not sure the best way to set up the views and serializers (use generics, viewsets, or customizing?)
I have three models, Trainer, Team, and Pokemon.
Trainer can have many teams, so one to many, and I suppose team and pokemon could be many to many, but for the sake of simplicity, let's go with one to many as well.
I've read the documentation, so I'm not asking for a handout, but just advice on how more seasoned developers would set this up for crud operations (not sure how to save nested relations) and how best to retrieve them (say I want to show a trainers info, all their teams, and if desired, all pokemon in any given team.)
I know this is a lot too ask but I am just overwhelmed by the documentation. Thanks in advance!
/r/django
https://redd.it/b02x3a
I've started to mess around with Django Rest Framework, and its amazing. However, I'm overwhelmed at the same time as to how many options there are (generics, viewsets, different ways to handle nested relationships, etc.) I thought of a good exercise for my self, but am not sure the best way to set up the views and serializers (use generics, viewsets, or customizing?)
I have three models, Trainer, Team, and Pokemon.
Trainer can have many teams, so one to many, and I suppose team and pokemon could be many to many, but for the sake of simplicity, let's go with one to many as well.
I've read the documentation, so I'm not asking for a handout, but just advice on how more seasoned developers would set this up for crud operations (not sure how to save nested relations) and how best to retrieve them (say I want to show a trainers info, all their teams, and if desired, all pokemon in any given team.)
I know this is a lot too ask but I am just overwhelmed by the documentation. Thanks in advance!
/r/django
https://redd.it/b02x3a
reddit
r/django - Help trying to understand nested serializers
0 votes and 0 comments so far on Reddit
Using Python in Weather Forecasting
https://www.youtube.com/watch?v=PNeZOOBV_UQ
/r/Python
https://redd.it/b01if7
https://www.youtube.com/watch?v=PNeZOOBV_UQ
/r/Python
https://redd.it/b01if7
YouTube
Using Python in Weather Forecasting
Social Network for Developers: https://morioh.com/p/b56ae6b04ffc
Developer's Store: https://www.moteefe.com/store/developer?cp=WP6JDT
Learn Startup: https://learnstartup.net
PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization…
Developer's Store: https://www.moteefe.com/store/developer?cp=WP6JDT
Learn Startup: https://learnstartup.net
PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization…
Mildly Interesting: The source for the Zen of Python completely violates the Zen of Python
For those that don't know, the Zen of Python is an easter egg included with the language:
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain,
/r/Python
https://redd.it/azuq9g
For those that don't know, the Zen of Python is an easter egg included with the language:
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain,
/r/Python
https://redd.it/azuq9g
reddit
r/Python - Mildly Interesting: The source for the Zen of Python completely violates the Zen of Python
172 votes and 44 comments so far on Reddit
Job execution, celery + flask
Hi,
I need your advices about python jobs execution. I'm working with ad platforms and i have several job with are independant python project which do stuff as data extraction ( from ad platform ) and data insertion ( to my databases ). Thoses jobs take around 30 minutes each. Each time i want to run a job, i clone it from github, install a virtualenv and the requirements. Then i run the job and keep the logs. But now i'll need to expose them trought an API.I was wondering using celery with flask but i saw no one executing job by cloning from github + install venv + requiremenst and at the end delete the job folder.
Am i doing something wrong ?
Does anyone had the same experience ?
Thanks for reading
/r/Python
https://redd.it/b05c20
Hi,
I need your advices about python jobs execution. I'm working with ad platforms and i have several job with are independant python project which do stuff as data extraction ( from ad platform ) and data insertion ( to my databases ). Thoses jobs take around 30 minutes each. Each time i want to run a job, i clone it from github, install a virtualenv and the requirements. Then i run the job and keep the logs. But now i'll need to expose them trought an API.I was wondering using celery with flask but i saw no one executing job by cloning from github + install venv + requiremenst and at the end delete the job folder.
Am i doing something wrong ?
Does anyone had the same experience ?
Thanks for reading
/r/Python
https://redd.it/b05c20
reddit
r/Python - Job execution, celery + flask
15 votes and 3 comments so far on Reddit
Knitty: Jupyter+Pandoc+IDE power in plain Python/Julia/R/any-kernel-lang. Pandoc filter and Atom/Hydrogen friendly literature programming
[**Knitty**](https://github.com/kiwi0fruit/knitty) is a Pandoc filter and [Atom/Hydrogen](https://atom.io/packages/hydrogen)-friendly reproducible report generation tool via Jupyter, Pandoc and Markdown (fork of the [Stitch](https://github.com/kiwi0fruit/knitty/blob/master/docs/stitch.md) that is a [Knitr](http://yihui.name/knitr/)-[RMarkdown](http://rmarkdown.rstudio.com)-like library in Python). Insert python code (or other Jupyter kernel code) *to the Markdown document* **or write in plain Python/Julia/R with block-commented Markdown** and have code's results in the Pandoc output document.
Knitty is an important part of the [Best Python/Jupyter/PyCharm experience + report generation with Pandoc filters](https://github.com/kiwi0fruit/pandoctools/blob/master/docs/best_python_jupyter_pycharm_experience.md) (see there why writing in plain Python/Julia/R is great) but actually
Knitty is language agnostic and can be used with any Jupyter kernel. Can be used independently of Pandoctools and with any IDE of choise. So I guess it deserves a separate post. By the way: Atom/Hydrogen is also language agnostic. You can also try **VS Code** interface to Jupyter from [**vscode-python**](https://github.com/Microsoft/vscode-python) instead of Atom/Hydrogen. I highly recommend to try to think about ipynb as merely an output format like pdf instead of main format or intermediate format (albeit ipynb is great for presenting narrative interactively and it can even [be much more](https://github.com/kiwi0fruit/misc/blob/master/src/pdf_and_word_killer.md)).
[**knitty repo**](https://github.com/kiwi0fruit/knitty).
### P.S.
[Knitty vs. Knitpy](https://github.com/kiwi0fruit/knitty/issues/1) joke.
/r/JupyterNotebooks
https://redd.it/b06wvq
[**Knitty**](https://github.com/kiwi0fruit/knitty) is a Pandoc filter and [Atom/Hydrogen](https://atom.io/packages/hydrogen)-friendly reproducible report generation tool via Jupyter, Pandoc and Markdown (fork of the [Stitch](https://github.com/kiwi0fruit/knitty/blob/master/docs/stitch.md) that is a [Knitr](http://yihui.name/knitr/)-[RMarkdown](http://rmarkdown.rstudio.com)-like library in Python). Insert python code (or other Jupyter kernel code) *to the Markdown document* **or write in plain Python/Julia/R with block-commented Markdown** and have code's results in the Pandoc output document.
Knitty is an important part of the [Best Python/Jupyter/PyCharm experience + report generation with Pandoc filters](https://github.com/kiwi0fruit/pandoctools/blob/master/docs/best_python_jupyter_pycharm_experience.md) (see there why writing in plain Python/Julia/R is great) but actually
Knitty is language agnostic and can be used with any Jupyter kernel. Can be used independently of Pandoctools and with any IDE of choise. So I guess it deserves a separate post. By the way: Atom/Hydrogen is also language agnostic. You can also try **VS Code** interface to Jupyter from [**vscode-python**](https://github.com/Microsoft/vscode-python) instead of Atom/Hydrogen. I highly recommend to try to think about ipynb as merely an output format like pdf instead of main format or intermediate format (albeit ipynb is great for presenting narrative interactively and it can even [be much more](https://github.com/kiwi0fruit/misc/blob/master/src/pdf_and_word_killer.md)).
[**knitty repo**](https://github.com/kiwi0fruit/knitty).
### P.S.
[Knitty vs. Knitpy](https://github.com/kiwi0fruit/knitty/issues/1) joke.
/r/JupyterNotebooks
https://redd.it/b06wvq
GitHub
kiwi0fruit/knitty
Jupyter power in plain Python/Julia/R/any-kernel-lang. Jupyter kernels output as Pandoc filter. Atom/Hydrogen friendly Markdown literature programming. Stitch/Knotr fork. - kiwi0fruit/knitty
How do you separate the Django environment variables, and which ones do you use?
I did a tutorial that I can not remember which one, where some of the settings were in an .env file. I also do not remember which settings were there.
​
By the way, how do you separate some of the settings, like secret key and database? It's a good idea for me to do something like:
.env
source .env // in a linux terminal
​
And inside env file, contain something like
EXPORT DATABASE = 'database settings in a json format here'
​
And then use the .environ and json loads to get these values?
​
If not, how do you do this, more specifically, in a professional environment?
​
EDIT: I used python-decouple, which also uses an .env file or settings.ini, and from what I've seen, it (and others who do this work) will automatically search the file in the project root directory and do things automatically. But from what I've seen, they use it as environment variables, but they search the file directly, instead of exporting to the linux environment and then searching for them.
/r/djangolearning
https://redd.it/azzxeg
I did a tutorial that I can not remember which one, where some of the settings were in an .env file. I also do not remember which settings were there.
​
By the way, how do you separate some of the settings, like secret key and database? It's a good idea for me to do something like:
.env
source .env // in a linux terminal
​
And inside env file, contain something like
EXPORT DATABASE = 'database settings in a json format here'
​
And then use the .environ and json loads to get these values?
​
If not, how do you do this, more specifically, in a professional environment?
​
EDIT: I used python-decouple, which also uses an .env file or settings.ini, and from what I've seen, it (and others who do this work) will automatically search the file in the project root directory and do things automatically. But from what I've seen, they use it as environment variables, but they search the file directly, instead of exporting to the linux environment and then searching for them.
/r/djangolearning
https://redd.it/azzxeg
reddit
r/djangolearning - How do you separate the Django environment variables, and which ones do you use?
4 votes and 7 comments so far on Reddit
What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/b087td
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/b087td
reddit
r/Python - What's everyone working on this week?
3 votes and 3 comments so far on Reddit
Status of r/djangolearning common repository
I have seen a few different posts on r/djangolearning regarding creating a common respository for learning purposes. Is there one currently being used? If not, I would love to create one and take charge of managing it.
/r/djangolearning
https://redd.it/azy60d
I have seen a few different posts on r/djangolearning regarding creating a common respository for learning purposes. Is there one currently being used? If not, I would love to create one and take charge of managing it.
/r/djangolearning
https://redd.it/azy60d
reddit
r/djangolearning - Status of r/djangolearning common repository
6 votes and 0 comments so far on Reddit
An explanation of Python metaclasses, and how the Django ORM uses them to work some "magic"
https://www.b-list.org/weblog/2019/mar/04/class/
/r/django
https://redd.it/b09dhn
https://www.b-list.org/weblog/2019/mar/04/class/
/r/django
https://redd.it/b09dhn
reddit
r/django - An explanation of Python metaclasses, and how the Django ORM uses them to work some "magic"
18 votes and 0 comments so far on Reddit
Use cases of Django on Kubernetes
I was curious if anyone knew of good use cases of Django on Kubernetes. It seems a little "heavy" for a microservice compared to a microframework like Flask but maybe there are ways to work around that fact.
/r/django
https://redd.it/b08l5y
I was curious if anyone knew of good use cases of Django on Kubernetes. It seems a little "heavy" for a microservice compared to a microframework like Flask but maybe there are ways to work around that fact.
/r/django
https://redd.it/b08l5y
reddit
r/django - Use cases of Django on Kubernetes
10 votes and 9 comments so far on Reddit