[P] Simple Tensorflow implementation of StarGAN (CVPR 2018 Oral)
/r/MachineLearning
https://redd.it/8qh7e5
/r/MachineLearning
https://redd.it/8qh7e5
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/8qj87y
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/8qj87y
reddit
r/Python - What's everyone working on this week?
1 votes and 1 so far on reddit
JWT Auth with AWS Cognito
How does one get started with using warrant/cognito for flask JWT auth ?
We can login to cognito using warrant and it returns a token, but from there we don't know how to proceed in flask.
https://stackoverflow.com/questions/50801247/python-and-flask-for-authentication-with-amazon-cognito
/r/flask
https://redd.it/8qj3pp
How does one get started with using warrant/cognito for flask JWT auth ?
We can login to cognito using warrant and it returns a token, but from there we don't know how to proceed in flask.
https://stackoverflow.com/questions/50801247/python-and-flask-for-authentication-with-amazon-cognito
/r/flask
https://redd.it/8qj3pp
Stack Overflow
Python and Flask for authentication with Amazon Cognito
Here's the end goal: to write a Flask app that supports login/authentication using Amazon Cognito User Pools. Both frameworks are fairly new to me.
I used warrant serverless authentication to get ...
I used warrant serverless authentication to get ...
Python script I wrote that tells whether it’s a Pizza or Not a Pizza
https://youtu.be/m_S7caqSFxc
/r/Python
https://redd.it/8qh9gf
https://youtu.be/m_S7caqSFxc
/r/Python
https://redd.it/8qh9gf
YouTube
Python image recognition
It’s a simple python script that I wrote it allows us to classify image. In my case I am using Clarifai Api to determine whether the image is pizza or not It...
May Release of Saleor: getting ready for GDPR
https://medium.com/saleor/may-release-of-saleor-getting-ready-for-gdpr-4bcb8c99438d
/r/django
https://redd.it/8qide2
https://medium.com/saleor/may-release-of-saleor-getting-ready-for-gdpr-4bcb8c99438d
/r/django
https://redd.it/8qide2
Medium
May Release of Saleor: getting ready for GDPR
Welcome to the May 2018 release of Saleor!
Celery 4.2.0 released!
http://docs.celeryproject.org/en/master/changelog.html#changelog
/r/Python
https://redd.it/8qj5ez
http://docs.celeryproject.org/en/master/changelog.html#changelog
/r/Python
https://redd.it/8qj5ez
What's the right way to handle these workflows in DRF?
I've never that been that into external APIs. We honestly haven't needed them that much, and when we have, API views written for each situation has both made sense and (obviously) done exactly what we need.
We're planning to open some of our system up to our clients (and their clients). It's essentially a booking system with, amongst other thins, Booking and User Models.
Basic viewsets and permissions are all done. 10 minute job. But there are two operations that I'm finding difficult to translate (in my head as much as anywhere else) into whatever passes for the "proper" way to do in REST.
The first is booking state change. Advancing the booking from EDITING to CONFIRMED or REJECTED or ON_SITE or LEFT_SITE or CANCELLED, etc. There are quite a few. In the "old" views we have logic to say what states some users can go between. There are also availability checks performed when going from EDITING to a confirmed state.
Do I just assume somebody is going to `partial_update` or 'update' the state and I have to validate this? Or should I be abstracting state change to '/bookings/<id>/{cancel,edit,reject,arrived,left}` etc?
The other problem is some views *occasionally* need more data. One example is a user list. Normally the list of users is enough but occasionally we might want to show (even sort) by when a User last had a booking.
In a Django view this is pretty trivial to annotate in. It's an expensive query, but it's trivial. And that's the problem. There are some Viewsets where I don't want all these expensive annotated fields littering the response where they aren't needed.
Do I just hack in a `?booking_data=1`, or *should* I add a separate API view for Users with booking data?
Again, I realise there are many simple things I could do to hack these in but this is intended for an external audience who have to read —and understand— documentation to use our product. I'm conscious that doing everything via hacky querystrings might not give the best impression.
/r/django
https://redd.it/8qkwqv
I've never that been that into external APIs. We honestly haven't needed them that much, and when we have, API views written for each situation has both made sense and (obviously) done exactly what we need.
We're planning to open some of our system up to our clients (and their clients). It's essentially a booking system with, amongst other thins, Booking and User Models.
Basic viewsets and permissions are all done. 10 minute job. But there are two operations that I'm finding difficult to translate (in my head as much as anywhere else) into whatever passes for the "proper" way to do in REST.
The first is booking state change. Advancing the booking from EDITING to CONFIRMED or REJECTED or ON_SITE or LEFT_SITE or CANCELLED, etc. There are quite a few. In the "old" views we have logic to say what states some users can go between. There are also availability checks performed when going from EDITING to a confirmed state.
Do I just assume somebody is going to `partial_update` or 'update' the state and I have to validate this? Or should I be abstracting state change to '/bookings/<id>/{cancel,edit,reject,arrived,left}` etc?
The other problem is some views *occasionally* need more data. One example is a user list. Normally the list of users is enough but occasionally we might want to show (even sort) by when a User last had a booking.
In a Django view this is pretty trivial to annotate in. It's an expensive query, but it's trivial. And that's the problem. There are some Viewsets where I don't want all these expensive annotated fields littering the response where they aren't needed.
Do I just hack in a `?booking_data=1`, or *should* I add a separate API view for Users with booking data?
Again, I realise there are many simple things I could do to hack these in but this is intended for an external audience who have to read —and understand— documentation to use our product. I'm conscious that doing everything via hacky querystrings might not give the best impression.
/r/django
https://redd.it/8qkwqv
reddit
r/django - What's the right way to handle these workflows in DRF?
2 votes and 3 so far on reddit
[D] Keys to compete against industry when in academia
It seems from published papers that state\-of\-the\-art results are always coming out from industry, and that makes sense because of the much stronger compute power typically available in companies vs. universities. Traditionally, it is somewhat expected that university researchers should focus more on ideas and concepts while industry researchers should consider large scale implementations. However, one observation at recent NIPS/ICML/ICLR/CVPR/etc.. papers reveals a common trend of showing off empirical results. This has haunted me several times and resulted in papers being rejected. It is just too hard to generate empirical results as awesome as those from industry. I hence focus on the more theoretical and algorithmic aspects, but it gets so frustrating when reviewers only critique the empirical results. My question is how to compete with industry in the era where empiricism is becoming so strong in machine learning?
/r/MachineLearning
https://redd.it/8qmhmo
It seems from published papers that state\-of\-the\-art results are always coming out from industry, and that makes sense because of the much stronger compute power typically available in companies vs. universities. Traditionally, it is somewhat expected that university researchers should focus more on ideas and concepts while industry researchers should consider large scale implementations. However, one observation at recent NIPS/ICML/ICLR/CVPR/etc.. papers reveals a common trend of showing off empirical results. This has haunted me several times and resulted in papers being rejected. It is just too hard to generate empirical results as awesome as those from industry. I hence focus on the more theoretical and algorithmic aspects, but it gets so frustrating when reviewers only critique the empirical results. My question is how to compete with industry in the era where empiricism is becoming so strong in machine learning?
/r/MachineLearning
https://redd.it/8qmhmo
reddit
[D] Keys to compete against industry when in... • r/MachineLearning
It seems from published papers that state\-of\-the\-art results are always coming out from industry, and that makes sense because of the much...
Somebody please help me convert some url patterns to the newer "path" syntax
So I was following what I thought was a Django 2.0 tutorial until we got [to this part](http://muva.co.ke/blog/lesson-4-defining-url-patterns-template-shop-products-django-2-0-python-3-6/) where I just couldn't continue because I can't understand how to read those URL patterns. I'm new to Django and only wanna consider the new "path" syntax for urls. Anyway, would somebody be kind enough to convert the patterns in the linked tutorial to be in the new syntax? By the way, I didn't expect this, had been getting along with what I thought was a version 2.0 tutorial, but oh, well.
/r/django
https://redd.it/8qnoy1
So I was following what I thought was a Django 2.0 tutorial until we got [to this part](http://muva.co.ke/blog/lesson-4-defining-url-patterns-template-shop-products-django-2-0-python-3-6/) where I just couldn't continue because I can't understand how to read those URL patterns. I'm new to Django and only wanna consider the new "path" syntax for urls. Anyway, would somebody be kind enough to convert the patterns in the linked tutorial to be in the new syntax? By the way, I didn't expect this, had been getting along with what I thought was a version 2.0 tutorial, but oh, well.
/r/django
https://redd.it/8qnoy1
We Create, You Like! | Muva Blog, Kenya
Lesson 4: Defining Url patterns and template for Our Shop products in Django 2.0 and Python 3.6
Hey, this is Henry Mbugua again with the fourth lesson of our ecommerce shop project series. In this section we…
Google is finally working on Python 3 for the App Engine Standard Environment
https://issuetracker.google.com/issues/35876441#comment104
/r/Python
https://redd.it/8qlwvy
https://issuetracker.google.com/issues/35876441#comment104
/r/Python
https://redd.it/8qlwvy
reddit
r/Python - Google is finally working on Python 3 for the App Engine Standard Environment
94 votes and 12 so far on reddit
r/RoguelikeDev is running a summer dev-along tutorial series in python
Interested in making a traditional turn-based roguelike? Want to do it alongside other devs and beginners with a tutorial? Over at r/roguelikedev we're starting a [weekly summer event](https://i.imgur.com/EYJFgdI.png) on June 19th where you can do just that :D
Check out "[RoguelikeDev Does The Complete Roguelike Tutorial](https://www.reddit.com/r/roguelikedev/comments/8ql895/roguelikedev_does_the_complete_roguelike_tutorial/)" for more info, including the planned schedule.
The main tutorial we'll be following is in python, although some participants may opt to use other languages.
/r/Python
https://redd.it/8qnlcm
Interested in making a traditional turn-based roguelike? Want to do it alongside other devs and beginners with a tutorial? Over at r/roguelikedev we're starting a [weekly summer event](https://i.imgur.com/EYJFgdI.png) on June 19th where you can do just that :D
Check out "[RoguelikeDev Does The Complete Roguelike Tutorial](https://www.reddit.com/r/roguelikedev/comments/8ql895/roguelikedev_does_the_complete_roguelike_tutorial/)" for more info, including the planned schedule.
The main tutorial we'll be following is in python, although some participants may opt to use other languages.
/r/Python
https://redd.it/8qnlcm
Does Flask-SQLAlchemy DB instance need to be closed?
I am converting the Flask\-SQLAlchemy tutorial (Which I have found the latest version to be kind of confusing) to use Postgres with Flask\-SQLAlchemy. I noticed in it that he creates used `.close()` to close the db connection. Do I need to do this same thing in Flask\-SQLAlchemy? I don’t see a `.close()` method in it. Also, when exactly is this `app.teardown_appcontext(close_db)` code run?
http://flask.pocoo.org/docs/1.0/tutorial/database/
/r/flask
https://redd.it/8qlf9l
I am converting the Flask\-SQLAlchemy tutorial (Which I have found the latest version to be kind of confusing) to use Postgres with Flask\-SQLAlchemy. I noticed in it that he creates used `.close()` to close the db connection. Do I need to do this same thing in Flask\-SQLAlchemy? I don’t see a `.close()` method in it. Also, when exactly is this `app.teardown_appcontext(close_db)` code run?
http://flask.pocoo.org/docs/1.0/tutorial/database/
/r/flask
https://redd.it/8qlf9l
How many of you Djangonauts here are full-time entrepreneurs?
I've been bootstrapping full\-time my startup idea, built using Django for the last year or so. I've really benefited tremendously from the advice I received here, from beginning to launch. Thank you so much.
A couple of weeks ago I got contacted by a firm in the industry I used to work in about a possible job opportunity. It would pay probably around 500k usd in total comp. What really surprised me is that, having worked on this idea single\-mindedly for around a year or so, the thought and possibility of going back to paid employment and the world of office politics really plunged me into something that feels like clinical depression. I knew I hated corporate employment but I didn't realize I hate it this much.
I'm not trolling here.
This made me want to find out: How many of you Djangonauts lurking here are in a similar situation? You are using technology and you really like Django in particular, not to get employment but to run away from it, as your ticket to freedom from soul\-crushing BS. Maybe you are self\-taught in everything from HTML to JS to Django like me. We should connect and probably start something together, or just share ideas.
Always, thanks to all in this community. I've gotten so much from you guys.
/r/django
https://redd.it/8qp1l3
I've been bootstrapping full\-time my startup idea, built using Django for the last year or so. I've really benefited tremendously from the advice I received here, from beginning to launch. Thank you so much.
A couple of weeks ago I got contacted by a firm in the industry I used to work in about a possible job opportunity. It would pay probably around 500k usd in total comp. What really surprised me is that, having worked on this idea single\-mindedly for around a year or so, the thought and possibility of going back to paid employment and the world of office politics really plunged me into something that feels like clinical depression. I knew I hated corporate employment but I didn't realize I hate it this much.
I'm not trolling here.
This made me want to find out: How many of you Djangonauts lurking here are in a similar situation? You are using technology and you really like Django in particular, not to get employment but to run away from it, as your ticket to freedom from soul\-crushing BS. Maybe you are self\-taught in everything from HTML to JS to Django like me. We should connect and probably start something together, or just share ideas.
Always, thanks to all in this community. I've gotten so much from you guys.
/r/django
https://redd.it/8qp1l3
reddit
r/django - How many of you Djangonauts here are full-time entrepreneurs?
15 votes and 9 so far on reddit
Python 3.7.0rc1 and 3.6.6rc1 now available for testing
https://blog.python.org/2018/06/python-370rc1-and-366rc1-now-available.html
/r/Python
https://redd.it/8qn86l
https://blog.python.org/2018/06/python-370rc1-and-366rc1-now-available.html
/r/Python
https://redd.it/8qn86l
reddit
r/Python - Python 3.7.0rc1 and 3.6.6rc1 now available for testing
43 votes and 1 so far on reddit
Oh boy...did I fuck up? [Flask SQLAlchemy]
Haha, well, funny problem. I've made an app with quite a few users. It seems to be running into some issues. I realised that due to the Charge IDs from my Shopify app now being too large, no new users can join.
I have some Python code a bit like this.
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
charge_id = db.Column(db.Integer, unique=True, nullable=False)
def __repr__(self):
return '<User %r>' % self.username
I realise now that my charge_id should be of type BigInteger to accomodate the large charge id's I'm getting now.
The thing is, in the past, I've never managed to fix this without deleting and creating the DB again. So, is it possible to edit the type of charge ID, to make it db.BigInteger, without having
to recreate the entire table? Of course, deleting the entire database isn't an option for me.
/r/flask
https://redd.it/8qm96d
Haha, well, funny problem. I've made an app with quite a few users. It seems to be running into some issues. I realised that due to the Charge IDs from my Shopify app now being too large, no new users can join.
I have some Python code a bit like this.
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
charge_id = db.Column(db.Integer, unique=True, nullable=False)
def __repr__(self):
return '<User %r>' % self.username
I realise now that my charge_id should be of type BigInteger to accomodate the large charge id's I'm getting now.
The thing is, in the past, I've never managed to fix this without deleting and creating the DB again. So, is it possible to edit the type of charge ID, to make it db.BigInteger, without having
to recreate the entire table? Of course, deleting the entire database isn't an option for me.
/r/flask
https://redd.it/8qm96d
reddit
r/flask - Oh boy...did I fuck up? [Flask SQLAlchemy]
1 votes and 2 so far on reddit
Debugging a slow part of Flask app; and how do I run tests?
My slow part is probably an AJAX, here, in [Javascript](https://github.com/patarapolw/HanziLevelUp/blob/48a6a2d8927b49a9ba0d2809a886a63a143ee628/webapp/static/js/viewVocab.js#L22), and in Python [1](https://github.com/patarapolw/HanziLevelUp/blob/48a6a2d8927b49a9ba0d2809a886a63a143ee628/webapp/views/vocab.py#L62)->[2](https://github.com/patarapolw/HanziLevelUp/blob/48a6a2d8927b49a9ba0d2809a886a63a143ee628/CJKhyperradicals/dict.py#L24)
Also, I'd like to ask, generally, how do I run tests in (Client-side) Javascript and (server-side) Flask/Python? I am used to pytest/unittest/doctest in Python, but not in Flask, at all.
I'd like to know more about speed/performance profiling (server load, client load...)
/r/flask
https://redd.it/8qm73s
My slow part is probably an AJAX, here, in [Javascript](https://github.com/patarapolw/HanziLevelUp/blob/48a6a2d8927b49a9ba0d2809a886a63a143ee628/webapp/static/js/viewVocab.js#L22), and in Python [1](https://github.com/patarapolw/HanziLevelUp/blob/48a6a2d8927b49a9ba0d2809a886a63a143ee628/webapp/views/vocab.py#L62)->[2](https://github.com/patarapolw/HanziLevelUp/blob/48a6a2d8927b49a9ba0d2809a886a63a143ee628/CJKhyperradicals/dict.py#L24)
Also, I'd like to ask, generally, how do I run tests in (Client-side) Javascript and (server-side) Flask/Python? I am used to pytest/unittest/doctest in Python, but not in Flask, at all.
I'd like to know more about speed/performance profiling (server load, client load...)
/r/flask
https://redd.it/8qm73s
GitHub
patarapolw/HanziLevelUp
HanziLevelUp - A Hanzi learning suite, with levels based on Hanzi Level Project, aka. another attempt to clone WaniKani.com for Chinese.
Qt for Python 5.11 released - Qt Blog
https://blog.qt.io/blog/2018/06/13/qt-python-5-11-released/
/r/Python
https://redd.it/8qrgef
https://blog.qt.io/blog/2018/06/13/qt-python-5-11-released/
/r/Python
https://redd.it/8qrgef
Qt Blog
Qt for Python 5.11 released - Qt Blog
We are happy to announce the first official release of Qt for Python (Pyside2). As the version tag implies, it is based on Qt 5.11 and therefore the first release that supports the Qt 5 series. At large the project will follow the general Qt release schedule…
MultipleObjectsReturned on Delete and update view
I just found that I am getting a MultipleObjectsReturned if I have a user put in similar required data fields. Here is my model and view:
**Models.py**
`class Product(models.Model):`
`name = models.CharField(max_length=50)`
`company = models.ForeignKey(`
`Company, on_delete=models.CASCADE)`
`serial = models.CharField(max_length=50, null=True, blank=True)`
`description = TextField()`
`date_added = models.DateTimeField(auto_now_add=True, auto_now=False)`
**Views.py**
`class ProductUpdateView(UpdateView):`
`model = Product`
`fields = ['name', 'serial', 'description']`
`pk_url_kwarg = 'id'`
`slug_field = 'serial'`
`slug_url_kwarg = 'serial'`
`template_name = 'update_product.html'`
`success_url = reverse_lazy('main:product list')`
`def get_queryset(self):`
`base_qs = super(ProductUpdateView, self).get_queryset()`
`return base_qs.filter(Company__user=\`\`self.request.user.id\`\`)`
**urls.py**
`path('product/update/<int:pk>=?<slug:serial>', login_required(views.ProductUpdateView.as_view()), name='update product'),`
The error I am when two objects are entered with the similar info is:
`MultipleObjectsReturned at /product/37=?333=delete`
`get() returned more than one Product -- it returned 2!`
Is there a way to get these views working since there is a unique id in the url path? or do I have to use "unique =true" on one of the fields to limit what the user can input?
/r/djangolearning
https://redd.it/8qpmlr
I just found that I am getting a MultipleObjectsReturned if I have a user put in similar required data fields. Here is my model and view:
**Models.py**
`class Product(models.Model):`
`name = models.CharField(max_length=50)`
`company = models.ForeignKey(`
`Company, on_delete=models.CASCADE)`
`serial = models.CharField(max_length=50, null=True, blank=True)`
`description = TextField()`
`date_added = models.DateTimeField(auto_now_add=True, auto_now=False)`
**Views.py**
`class ProductUpdateView(UpdateView):`
`model = Product`
`fields = ['name', 'serial', 'description']`
`pk_url_kwarg = 'id'`
`slug_field = 'serial'`
`slug_url_kwarg = 'serial'`
`template_name = 'update_product.html'`
`success_url = reverse_lazy('main:product list')`
`def get_queryset(self):`
`base_qs = super(ProductUpdateView, self).get_queryset()`
`return base_qs.filter(Company__user=\`\`self.request.user.id\`\`)`
**urls.py**
`path('product/update/<int:pk>=?<slug:serial>', login_required(views.ProductUpdateView.as_view()), name='update product'),`
The error I am when two objects are entered with the similar info is:
`MultipleObjectsReturned at /product/37=?333=delete`
`get() returned more than one Product -- it returned 2!`
Is there a way to get these views working since there is a unique id in the url path? or do I have to use "unique =true" on one of the fields to limit what the user can input?
/r/djangolearning
https://redd.it/8qpmlr
reddit
MultipleObjectsReturned on Delete and update view • r/djangolearning
I just found that I am getting a MultipleObjectsReturned if I have a user put in similar required data fields. Here is my model and view: ...
Introduction to Matplotlib — Data Visualization in Python
https://heartbeat.fritz.ai/introduction-to-matplotlib-data-visualization-in-python-d9143287ae39
/r/Python
https://redd.it/8qrh6d
https://heartbeat.fritz.ai/introduction-to-matplotlib-data-visualization-in-python-d9143287ae39
/r/Python
https://redd.it/8qrh6d
Medium
Introduction to Matplotlib — Data Visualization in Python
Learn how to install and use Matplotlib, create commonly-used plots, and determine when to use them.