When I create a new Flask project, here are 15 libraries that are always in my requirements.txt file. What libraries do you use?
I find myself using these libraries in every new Flask project I set up:
* gunicorn
* flask-debugtoolbar
* pytest and pytest-cov
* flake8
* Flask-SQLAlchemy and psycopg2
* alembic
* celery and redis
* Flask-WTF and WTForms-Components
* Flask-Login
* Flask-Limiter
* Flask-Mail
If you want to know why I use all of these libraries, more details can be found at
https://nickjanetakis.com/blog/15-useful-flask-extensions-and-libraries-that-i-use-in-every-project.
What's your favorite extensions and libraries?
/r/flask
https://redd.it/7g4wzg
I find myself using these libraries in every new Flask project I set up:
* gunicorn
* flask-debugtoolbar
* pytest and pytest-cov
* flake8
* Flask-SQLAlchemy and psycopg2
* alembic
* celery and redis
* Flask-WTF and WTForms-Components
* Flask-Login
* Flask-Limiter
* Flask-Mail
If you want to know why I use all of these libraries, more details can be found at
https://nickjanetakis.com/blog/15-useful-flask-extensions-and-libraries-that-i-use-in-every-project.
What's your favorite extensions and libraries?
/r/flask
https://redd.it/7g4wzg
Nick Janetakis
15 Useful Flask Extensions and Libraries That I Use in Every Project — Nick Janetakis
Part of the benefit of using a popular web framework is the thriving community around it. Here's my favorite Flask extensions.
Sports statistic site
Hi,
I’m a newish full stack developer and I’m trying to build a sports statistic site in Django.
I’m struggling with working out how to structure my project with regards to both the models and the apps I use.
It is a basketball focused application so I’ve started with a player model. There are a ton of stats that each player has for each season so I’ve created a season model that has a player field as a foreignkey. So far so good, I’m struggling to get the data from the API in bulk but that’s another post.
So, we have player and career stats. Now, the next thing I need is team. Teams have all the location and historical stats but then they have players - I think players should reference team as a foreignkey with related name but then I’m not sure how I deal with players when they change team, should there be a former players field and a method to change team that would populate that?
Then we have schedule and match stats. Each game has two teams with a given roster and a given box score that’s not too bad. I need to be more confident in my data collection processes before I’d trust it live.
That’s the main functionality so far. Typing this has helped me clarify my thinking a bit - I’ll stick my work so far up on GitHub at some point if anyone is interested.
If you have initial thoughts, similar projects that might be inspiring and helpful I’d love to hear it.
Hope you’re all doing well!
/r/django
https://redd.it/7gohks
Hi,
I’m a newish full stack developer and I’m trying to build a sports statistic site in Django.
I’m struggling with working out how to structure my project with regards to both the models and the apps I use.
It is a basketball focused application so I’ve started with a player model. There are a ton of stats that each player has for each season so I’ve created a season model that has a player field as a foreignkey. So far so good, I’m struggling to get the data from the API in bulk but that’s another post.
So, we have player and career stats. Now, the next thing I need is team. Teams have all the location and historical stats but then they have players - I think players should reference team as a foreignkey with related name but then I’m not sure how I deal with players when they change team, should there be a former players field and a method to change team that would populate that?
Then we have schedule and match stats. Each game has two teams with a given roster and a given box score that’s not too bad. I need to be more confident in my data collection processes before I’d trust it live.
That’s the main functionality so far. Typing this has helped me clarify my thinking a bit - I’ll stick my work so far up on GitHub at some point if anyone is interested.
If you have initial thoughts, similar projects that might be inspiring and helpful I’d love to hear it.
Hope you’re all doing well!
/r/django
https://redd.it/7gohks
reddit
Sports statistic site • r/django
Hi, I’m a newish full stack developer and I’m trying to build a sports statistic site in Django. I’m struggling with working out how to...
PyConDE 2017 Talk are now available on YouTube
https://www.youtube.com/watch?v=3h-6GBBF4Hg&list=PLHd2BPBhxqRI_HtgmPJcm3LPAlhdX6J9v
/r/Python
https://redd.it/7glvwc
https://www.youtube.com/watch?v=3h-6GBBF4Hg&list=PLHd2BPBhxqRI_HtgmPJcm3LPAlhdX6J9v
/r/Python
https://redd.it/7glvwc
YouTube
PyCon.DE 2017 Keynote Prof. Dr. Susanne Mertens - Neutrinos: who are you and if yes how many?
Since 2008 Susanne Mertens is working on the experimental investigation of the elusive elementary particle, the Neutrino. With the two large-scale experiment...
DDoS Attack Detection with Wallaroo: A Real-time Time Series Analysis Example · Wallaroo Labs
https://blog.wallaroolabs.com/2017/11/ddos-attack-detection-with-wallaroo-a-real-time-time-series-analysis-example/
/r/Python
https://redd.it/7gm452
https://blog.wallaroolabs.com/2017/11/ddos-attack-detection-with-wallaroo-a-real-time-time-series-analysis-example/
/r/Python
https://redd.it/7gm452
Wallaroolabs
DDoS Attack Detection with Wallaroo: A Real-time Time Series Analysis Example
Official blog of the Wallaroo Labs Engineering team
Python bindings to Modest engine (very fast HTML5 parser with CSS selectors)
https://github.com/rushter/selectolax
/r/Python
https://redd.it/7gpl28
https://github.com/rushter/selectolax
/r/Python
https://redd.it/7gpl28
GitHub
GitHub - rushter/selectolax: Python binding to Modest and Lexbor engines. Fast HTML5 parser with CSS selectors for Python.
Python binding to Modest and Lexbor engines. Fast HTML5 parser with CSS selectors for Python. - rushter/selectolax
I am after a link to a video of Raymond Hettingers' ...
I lost my bookmarkto a video of Raymond Hettinger's where he discusses best practices when wrapping an external library written in some other language to make it Pythonic. It discusses things like conforming to the Python iterator protocol when the orginal library has just a `get next` function that ends by returning a sentinel value; and other such Pythonicisms.
Your help is appreciated, Thanks :-)
/r/Python
https://redd.it/7gqdni
I lost my bookmarkto a video of Raymond Hettinger's where he discusses best practices when wrapping an external library written in some other language to make it Pythonic. It discusses things like conforming to the Python iterator protocol when the orginal library has just a `get next` function that ends by returning a sentinel value; and other such Pythonicisms.
Your help is appreciated, Thanks :-)
/r/Python
https://redd.it/7gqdni
reddit
I am after a link to a video of Raymond Hettingers' ... • r/Python
I lost my bookmarkto a video of Raymond Hettinger's where he discusses best practices when wrapping an external library written in some other...
[R] "Deep Image Prior": deep super-resolution, inpainting, denoising without learning on a dataset and pretrained networks
/r/MachineLearning
https://redd.it/7gls3j
/r/MachineLearning
https://redd.it/7gls3j
Templates are annoying to set up. Right ?
https://www.reddit.com/r/django/comments/7gk708/templates_are_annoying_to_set_up_right/
/r/djangolearning
https://redd.it/7gkcqv
https://www.reddit.com/r/django/comments/7gk708/templates_are_annoying_to_set_up_right/
/r/djangolearning
https://redd.it/7gkcqv
reddit
Templates are annoying to set up. Right ? • r/django
So, I like django templates, a lot, and I have used them quite a bit. The sheer variety of built-in tags and filters and the ability to define...
Hi New to flask. Wondering. If my app uses API Keys or connects to a DB whats the most secure way to store these keys/passwords in the app? whats the best practice?
/r/flask
https://redd.it/7gpg5a
/r/flask
https://redd.it/7gpg5a
reddit
Hi New to flask. Wondering. If my app uses API Keys or... • r/flask
9 points and 6 comments so far on reddit
Implementing multiple ModelAdmin
In the project I'm working on, I'm using packages like django-import-export, django-summernote, django-polymorphic and I was wondering if there was a way to use their ModelAdmin on the same model at once.
I tried MyModel(SummernoteModelAdmin, PolymorphicModelAdmin) and I got some errors.
Also saw that I could use proxy models to achieve the same results.
Thanks for the help!
/r/djangolearning
https://redd.it/7ginao
In the project I'm working on, I'm using packages like django-import-export, django-summernote, django-polymorphic and I was wondering if there was a way to use their ModelAdmin on the same model at once.
I tried MyModel(SummernoteModelAdmin, PolymorphicModelAdmin) and I got some errors.
Also saw that I could use proxy models to achieve the same results.
Thanks for the help!
/r/djangolearning
https://redd.it/7ginao
reddit
Implementing multiple ModelAdmin • r/djangolearning
In the project I'm working on, I'm using packages like django-import-export, django-summernote, django-polymorphic and I was wondering if there...
How I deployed Flask with Celery and Redis on Heroku
http://allynh.com/blog/flask-asynchronous-background-tasks-with-celery-and-redis/
/r/flask
https://redd.it/7gudwg
http://allynh.com/blog/flask-asynchronous-background-tasks-with-celery-and-redis/
/r/flask
https://redd.it/7gudwg
[AF] Return streaming text directly into a response, without saving it to disk
I would like to return streaming text directly into a response, without saving it to disk. Right now, I save the streamed data to a file on the server and open that file to return its contents in a response. The following is a little snippet:
class Streamed(Resource):
def post(self):
file = request.files['file']
with open(FOLDER+file.filename, "wb") as f:
while True:
chunk = request.stream.read(CHUNK_SIZE)
if len(chunk) == 0:
return
f.write(chunk)...
/r/flask
https://redd.it/7gtekb
I would like to return streaming text directly into a response, without saving it to disk. Right now, I save the streamed data to a file on the server and open that file to return its contents in a response. The following is a little snippet:
class Streamed(Resource):
def post(self):
file = request.files['file']
with open(FOLDER+file.filename, "wb") as f:
while True:
chunk = request.stream.read(CHUNK_SIZE)
if len(chunk) == 0:
return
f.write(chunk)...
/r/flask
https://redd.it/7gtekb
reddit
[AF] Return streaming text directly into a response,... • r/flask
I would like to return streaming text directly into a response, without saving it to disk. Right now, I save the streamed data to a file on the...
[R] High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
https://tcwang0509.github.io/pix2pixHD/
/r/MachineLearning
https://redd.it/7gsy9b
https://tcwang0509.github.io/pix2pixHD/
/r/MachineLearning
https://redd.it/7gsy9b
tcwang0509.github.io
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
Python socket cheat sheet (include AF_ALG)
https://github.com/crazyguitar/pysheeet/blob/master/docs/notes/python-socket.rst
/r/Python
https://redd.it/7gt9sx
https://github.com/crazyguitar/pysheeet/blob/master/docs/notes/python-socket.rst
/r/Python
https://redd.it/7gt9sx
GitHub
pysheeet/python-socket.rst at master · crazyguitar/pysheeet
Python Cheat Sheet. Contribute to crazyguitar/pysheeet development by creating an account on GitHub.
How I got into programming
https://pythontips.com/2017/12/01/how-i-got-into-programming
/r/Python
https://redd.it/7guqn9
https://pythontips.com/2017/12/01/how-i-got-into-programming
/r/Python
https://redd.it/7guqn9
Python Tips
How I got into programming
Hi everyone! I hope all of you are doing great. If you have been following my blog for a while and keeping a lookout at the comments then you might know a bit about me. If you don’t then toda…
Merry Christmas: Data science advent calendar. :)
http://franz.media/advent.html
/r/Python
https://redd.it/7gxqg1
http://franz.media/advent.html
/r/Python
https://redd.it/7gxqg1
reddit
Merry Christmas: Data science advent calendar. :) • r/Python
4 points and 0 comments so far on reddit
[AF] Peewee question: how to return many rows with just one query?
Hey everyone, I'm using peewee as my ORM in conjunction with Flask. I have this query:
class Group(Model):
name = CharField()
class Project(Model):
name = CharField()
group = ForeignKeyField(Group)
class Scene(Model):
name = CharField()
project = ForeignKeyField(Project)
groups = (Group
.select(Group, Project, Scene)
.join(Project, JOIN_LEFT_OUTER)
.switch(Project)
.join(Scene, JOIN_LEFT_OUTER)
.order_by(Group.order, Project.order, Scene.order)
.aggregate_rows())
What this query does is nest all scenes under the project they have as a foreign key, and nest all projects under the group they have as a foreign key. So I end up with `groups` as a list, `groups[x].projects` as a list, and `groups[x].projects[y].scenes` as a list. I added `aggregate_rows()` at the end because, as far as I can tell from the peewee documentation, this pre-fetches all the data from the query at once.
This query works great for getting & organizing all the data I need but after [printing all queries to stderr](http://docs.peewee-orm.com/en/latest/peewee/database.html#logging-queries) I found that when I marshal `groups` with Flask-RESTful (which serializes all the data to be sent to the client) I end up with 60+ individual queries for every item nested under `groups` (i.e. `projects` and `projects[x].scenes`).
Based on the stderr output it appears that ONLY `Group` is being pre-fetched, while `Project` and `Scene` are not.
My question: **how do I run the above query so it fetches ALL my data at once (without invoking additional queries when being iterated over in Flask-RESTful)?**
Thank you for any help!
/r/flask
https://redd.it/7goeah
Hey everyone, I'm using peewee as my ORM in conjunction with Flask. I have this query:
class Group(Model):
name = CharField()
class Project(Model):
name = CharField()
group = ForeignKeyField(Group)
class Scene(Model):
name = CharField()
project = ForeignKeyField(Project)
groups = (Group
.select(Group, Project, Scene)
.join(Project, JOIN_LEFT_OUTER)
.switch(Project)
.join(Scene, JOIN_LEFT_OUTER)
.order_by(Group.order, Project.order, Scene.order)
.aggregate_rows())
What this query does is nest all scenes under the project they have as a foreign key, and nest all projects under the group they have as a foreign key. So I end up with `groups` as a list, `groups[x].projects` as a list, and `groups[x].projects[y].scenes` as a list. I added `aggregate_rows()` at the end because, as far as I can tell from the peewee documentation, this pre-fetches all the data from the query at once.
This query works great for getting & organizing all the data I need but after [printing all queries to stderr](http://docs.peewee-orm.com/en/latest/peewee/database.html#logging-queries) I found that when I marshal `groups` with Flask-RESTful (which serializes all the data to be sent to the client) I end up with 60+ individual queries for every item nested under `groups` (i.e. `projects` and `projects[x].scenes`).
Based on the stderr output it appears that ONLY `Group` is being pre-fetched, while `Project` and `Scene` are not.
My question: **how do I run the above query so it fetches ALL my data at once (without invoking additional queries when being iterated over in Flask-RESTful)?**
Thank you for any help!
/r/flask
https://redd.it/7goeah
Pentesting and automation tools I created
https://github.com/3XPL017/netpwn
twitter: @3XPL017GH057
/r/Python
https://redd.it/7gxfyu
https://github.com/3XPL017/netpwn
twitter: @3XPL017GH057
/r/Python
https://redd.it/7gxfyu
GitHub
GitHub - 3XPL017/netpwn: Tool made to automate tasks of pentesting.
Tool made to automate tasks of pentesting. Contribute to 3XPL017/netpwn development by creating an account on GitHub.
When I create a new Flask project, here are 15 libraries that are always in my requirements.txt file. What libraries do you use?
I find myself using these libraries in every new Flask project I set up:
* gunicorn
* flask-debugtoolbar
* pytest and pytest-cov
* flake8
* Flask-SQLAlchemy and psycopg2
* alembic
* celery and redis
* Flask-WTF and WTForms-Components
* Flask-Login
* Flask-Limiter
* Flask-Mail
If you want to know why I use all of these libraries, more details can be found at
https://nickjanetakis.com/blog/15-useful-flask-extensions-and-libraries-that-i-use-in-every-project.
What's your favorite extensions and libraries?
/r/flask
https://redd.it/7g4wzg
I find myself using these libraries in every new Flask project I set up:
* gunicorn
* flask-debugtoolbar
* pytest and pytest-cov
* flake8
* Flask-SQLAlchemy and psycopg2
* alembic
* celery and redis
* Flask-WTF and WTForms-Components
* Flask-Login
* Flask-Limiter
* Flask-Mail
If you want to know why I use all of these libraries, more details can be found at
https://nickjanetakis.com/blog/15-useful-flask-extensions-and-libraries-that-i-use-in-every-project.
What's your favorite extensions and libraries?
/r/flask
https://redd.it/7g4wzg
Nick Janetakis
15 Useful Flask Extensions and Libraries That I Use in Every Project — Nick Janetakis
Part of the benefit of using a popular web framework is the thriving community around it. Here's my favorite Flask extensions.