Adding forms dynamically to a Django formset
https://medium.com/@taranjeet/adding-forms-dynamically-to-a-django-formset-375f1090c2b0
/r/django
https://redd.it/8q9dew
https://medium.com/@taranjeet/adding-forms-dynamically-to-a-django-formset-375f1090c2b0
/r/django
https://redd.it/8q9dew
Medium
Adding forms dynamically to a Django formset
Add multiple ordered similar arguments to manage command
I'm trying to build out a command that'll looker similar to this
`python manage.py gen-data primary=10-state with=30-users with=30-visits`
The goal here is to do test-data generation where the command doesn't become crazy for any of our front end devs. That command would do something like create 10 states, create 30 users who live in each state, and create 30 web visits for each of those users.
I know how to do the actual generation of the data, but I can't seem to find out how to handle having the same argument repeated like that.
Any help would be much appreciated.
Solved:
Turns out you can do a list object as a arg
parser.add_argument(
'--with', default=[], dest='withs', action='append',
help="Specify district ids by comma separated list.")
` python manage.py generate_data --model=user --with=Super --with=cali --with=frag --with=ilistice --with=xpial --with=idocious`
`['Super', 'cali', 'frag', 'ilistice', 'xpial', 'idocious']`
/r/django
https://redd.it/8q9scf
I'm trying to build out a command that'll looker similar to this
`python manage.py gen-data primary=10-state with=30-users with=30-visits`
The goal here is to do test-data generation where the command doesn't become crazy for any of our front end devs. That command would do something like create 10 states, create 30 users who live in each state, and create 30 web visits for each of those users.
I know how to do the actual generation of the data, but I can't seem to find out how to handle having the same argument repeated like that.
Any help would be much appreciated.
Solved:
Turns out you can do a list object as a arg
parser.add_argument(
'--with', default=[], dest='withs', action='append',
help="Specify district ids by comma separated list.")
` python manage.py generate_data --model=user --with=Super --with=cali --with=frag --with=ilistice --with=xpial --with=idocious`
`['Super', 'cali', 'frag', 'ilistice', 'xpial', 'idocious']`
/r/django
https://redd.it/8q9scf
reddit
Add multiple ordered similar arguments to manage command • r/django
I'm trying to build out a command that'll looker similar to this `python manage.py gen-data primary=10-state with=30-users with=30-visits` The...
parver: a package to parse and manipulate PEP440 version numbers
https://github.com/RazerM/parver
/r/Python
https://redd.it/8qb4zl
https://github.com/RazerM/parver
/r/Python
https://redd.it/8qb4zl
GitHub
GitHub - RazerM/parver: Parse and manipulate version numbers.
Parse and manipulate version numbers. Contribute to RazerM/parver development by creating an account on GitHub.
[D] Improving Language Understanding with Unsupervised Learning
https://blog.openai.com/language-unsupervised/
/r/MachineLearning
https://redd.it/8qbzom
https://blog.openai.com/language-unsupervised/
/r/MachineLearning
https://redd.it/8qbzom
Getting started with Apache Kafka in Python
http://blog.adnansiddiqi.me/getting-started-with-apache-kafka-in-python/?utm_source=r_python_kafka&utm_medium=reddit&utm_campaign=c_r_python_kafka
/r/Python
https://redd.it/8qe9d9
http://blog.adnansiddiqi.me/getting-started-with-apache-kafka-in-python/?utm_source=r_python_kafka&utm_medium=reddit&utm_campaign=c_r_python_kafka
/r/Python
https://redd.it/8qe9d9
Adnan's Random bytes
Getting started with Apache Kafka in Python
Learn the basics of Kafka and write a sample distributed application in Python.
Web Scrape YouTube channel for video info and a table of contents using Python 3.6 and Beautiful Soup (V1.1)
https://teklern.blogspot.com/2018/06/web-scrape-youtube-channel-for-video.html
/r/Python
https://redd.it/8qds2e
https://teklern.blogspot.com/2018/06/web-scrape-youtube-channel-for-video.html
/r/Python
https://redd.it/8qds2e
Blogspot
Web Scrape YouTube channel for video info and a table of contents using Python 3.6 and Beautiful Soup (V1.1)
I have a YouTube channel for my videos to teach programming and needed to create a nice table of contents for a web page. YouTube alwa...
[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