Linting while the dev server runs
I've been doing a bit of front-end development lately and one of the things I really started to like is that while using webpack-dev-server with eslint, any linting errorswill show in the console in real-time when the server reloads.
I was wondering if I could do the same thing using Flask dev server and flake8
Turns out it's fairly simple.
I modified my `run.py` to run flake8 and show the errors any time the Flask dev server restarts.
https://gist.github.com/timster/a6b8d01c864cf7ce7ad20ecb3f8d85b6
This gives a pretty output in the console for any linting errors:
https://i.imgur.com/7zbsXu9.png
Has anyone done anything similar?
/r/flask
https://redd.it/7mty89
I've been doing a bit of front-end development lately and one of the things I really started to like is that while using webpack-dev-server with eslint, any linting errorswill show in the console in real-time when the server reloads.
I was wondering if I could do the same thing using Flask dev server and flake8
Turns out it's fairly simple.
I modified my `run.py` to run flake8 and show the errors any time the Flask dev server restarts.
https://gist.github.com/timster/a6b8d01c864cf7ce7ad20ecb3f8d85b6
This gives a pretty output in the console for any linting errors:
https://i.imgur.com/7zbsXu9.png
Has anyone done anything similar?
/r/flask
https://redd.it/7mty89
Gist
run.py
8 Python developers that inspired me in 2017. Who inspired you?
https://hackernoon.com/8-python-developers-that-inspired-me-in-2017-85cb43b302a0?source=linkShare-ec39004dd57f-1514536217
/r/Python
https://redd.it/7mt5au
https://hackernoon.com/8-python-developers-that-inspired-me-in-2017-85cb43b302a0?source=linkShare-ec39004dd57f-1514536217
/r/Python
https://redd.it/7mt5au
Hacker Noon
8 Python developers that inspired me in 2017
2017 has been the first year in a long time that I’ve not been in a full-time technical job. I’m currently managing Talent Development…
[D] Full graduate course in Bayesian ML [videos + slides + homework]
https://www.zabaras.com/statisticalcomputing
/r/MachineLearning
https://redd.it/7muyz2
https://www.zabaras.com/statisticalcomputing
/r/MachineLearning
https://redd.it/7muyz2
home
Statisical Computing | University of Notre Dame
statisticalcomputing
App, project, site - making sense of Django's naming scheme
https://consideratecode.com/2017/12/29/app-project-site-making-sense-djangos-naming-scheme/
/r/django
https://redd.it/7mvnlm
https://consideratecode.com/2017/12/29/app-project-site-making-sense-djangos-naming-scheme/
/r/django
https://redd.it/7mvnlm
Considerate Code
App, project, site - making sense of Django's naming scheme - Considerate Code
Nowadays everyone knows what an App is. It’s a program you download from the App Store to your smart phone, right? In Django, a bunch of terms like “App” might have a meaning that differs from their common use. This might lead to some confusion, which I hope…
django app with celery enabling users to create tasks, and configure how to run them.
hello, i am making a django app using celery, i want the user to be able to schedule tasks. how should i go about doing it?should i use periodic tasks or something else, the examples show static calls to functions.
/r/django
https://redd.it/7mucll
hello, i am making a django app using celery, i want the user to be able to schedule tasks. how should i go about doing it?should i use periodic tasks or something else, the examples show static calls to functions.
/r/django
https://redd.it/7mucll
reddit
django app with celery enabling users to create tasks,... • r/django
hello, i am making a django app using celery, i want the user to be able to schedule tasks. how should i go about doing it?should i use periodic...
%run magic not working with other ipynb files
So I created a "test" environment where I have 3 separate jupyter notebooks (`one, two, run_all`).
- `one` adds a few integer numbers
- `two` creates a dataframe and writes to a csv file
- `run_all` contains only 2 cells:
- `%run ./one.ipynb`
- `%run ./two.ipynb`
Unfortunately it is not working. There is no error the two cells inside the `run_all` executes but nothing is happening
/r/IPython
https://redd.it/7mvz9v
So I created a "test" environment where I have 3 separate jupyter notebooks (`one, two, run_all`).
- `one` adds a few integer numbers
- `two` creates a dataframe and writes to a csv file
- `run_all` contains only 2 cells:
- `%run ./one.ipynb`
- `%run ./two.ipynb`
Unfortunately it is not working. There is no error the two cells inside the `run_all` executes but nothing is happening
/r/IPython
https://redd.it/7mvz9v
reddit
%run magic not working with other ipynb files • r/IPython
So I created a "test" environment where I have 3 separate jupyter notebooks (`one, two, run_all`). - `one` adds a few integer numbers - `two`...
cookiecutter-django has been upgraded to Django 1.11 LTS
https://github.com/pydanny/cookiecutter-django/commit/5395687f730f70db16821273f2a7a0efe1fe3dd6
/r/django
https://redd.it/7mnl4x
https://github.com/pydanny/cookiecutter-django/commit/5395687f730f70db16821273f2a7a0efe1fe3dd6
/r/django
https://redd.it/7mnl4x
GitHub
Upgraded to Django 1.11 to resolve · pydanny/cookiecutter-django@5395687
cookiecutter-django - Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
[AF] Populating forums with url values?
Hello!
I have a search page on my Flask site that takes user input, when they submit it refreshes the page with the url changed to www.url.com/search?query=value
Is there a way to automatically populate the search bar with the value from the url? There are several search bars and drop down selectors with values to sync with the url.
Thanks!
/r/flask
https://redd.it/7mw98a
Hello!
I have a search page on my Flask site that takes user input, when they submit it refreshes the page with the url changed to www.url.com/search?query=value
Is there a way to automatically populate the search bar with the value from the url? There are several search bars and drop down selectors with values to sync with the url.
Thanks!
/r/flask
https://redd.it/7mw98a
Flask Listens on Private IP vs Localhost
This might be the wrong place but I'm wondering, I'm just using a basic flask sample app from
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html
And I'm wondering, why when I use localhost/127.0.0.1 as the ip to host the server on port 80, I cannot connect to it from anywhere else, but when I use the private IP assigned to it by AWS, I can connect to it from my house.
So if I use app.run(host='172.16.1.15', port=80), I can put in the public IP in my browser and connect to it. But when I use localhost, I cannot connect to it, only from the instance itself.
I'm curious as to why using my private IP as the app host would make this available to anyone, and using just localhost would only have it available to that box. Does AWS automatically map incoming connections on the public IP to the private IP?
Thanks.
/r/flask
https://redd.it/7mvytj
This might be the wrong place but I'm wondering, I'm just using a basic flask sample app from
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html
And I'm wondering, why when I use localhost/127.0.0.1 as the ip to host the server on port 80, I cannot connect to it from anywhere else, but when I use the private IP assigned to it by AWS, I can connect to it from my house.
So if I use app.run(host='172.16.1.15', port=80), I can put in the public IP in my browser and connect to it. But when I use localhost, I cannot connect to it, only from the instance itself.
I'm curious as to why using my private IP as the app host would make this available to anyone, and using just localhost would only have it available to that box. Does AWS automatically map incoming connections on the public IP to the private IP?
Thanks.
/r/flask
https://redd.it/7mvytj
Amazon
Deploying a Flask application to Elastic Beanstalk - AWS Elastic Beanstalk
Create, configure and deploy a Flask application to AWS Elastic Beanstalk with the EB CLI.
opening .txt file from a specific folder
Hi guys, I am having some trouble opening files from a specific folder in my downloads. I need then to be from this specific folder because I am using a TfIdf Vectorizer later on in my code, and I want the edited files from that folder to be used in the dendogram I am making.
When I just put the files in the download folder I have no trouble opening them when I just use:
text = open('blabla.txt','r')
blabla = text.read()
But when I put them in the folder it can't read the file, so basically it can only find these files in the download folder.
Can anyone help me? Or at least maybe explain why this is the case?
/r/IPython
https://redd.it/7mxcvc
Hi guys, I am having some trouble opening files from a specific folder in my downloads. I need then to be from this specific folder because I am using a TfIdf Vectorizer later on in my code, and I want the edited files from that folder to be used in the dendogram I am making.
When I just put the files in the download folder I have no trouble opening them when I just use:
text = open('blabla.txt','r')
blabla = text.read()
But when I put them in the folder it can't read the file, so basically it can only find these files in the download folder.
Can anyone help me? Or at least maybe explain why this is the case?
/r/IPython
https://redd.it/7mxcvc
reddit
opening .txt file from a specific folder • r/IPython
Hi guys, I am having some trouble opening files from a specific folder in my downloads. I need then to be from this specific folder because I am...
[R] Modular Composition Networks for Deep RL
https://himanshusahni.github.io/2017/12/26/reusability-in-ai.html
/r/MachineLearning
https://redd.it/7mx303
https://himanshusahni.github.io/2017/12/26/reusability-in-ai.html
/r/MachineLearning
https://redd.it/7mx303
himanshusahni.github.io
Learning to Compose Skills
One of the weaknesses of vanilla deep reinforcement learning is that policies and values learned are typically limited to a single environment, the one the agent was trained on. In other words, it is hard to transfer policies from one setting to another.…
Hosting Flask App on Heroku
Hi there,
I've been working through deploying an application on Heroku.
On my local host I run my application with:
*python manage.py runserver*
As I understand it this runs a Development server and should not be used in production.
I am assuming i need to refactor my application to run on Heroku with the standard
*web: gunicorn app:app*
Any suggestions on how to refactor my code/file tree? Thanks!
FileTree:
* myApp(root)
* -templates
* -admin.py
* -__init__.py
* -auth.py
* -config.py
* -manage.py
* -models.py
* -Procfile
* -requirements.txt
* -.gitignore
/r/flask
https://redd.it/7mz2z5
Hi there,
I've been working through deploying an application on Heroku.
On my local host I run my application with:
*python manage.py runserver*
As I understand it this runs a Development server and should not be used in production.
I am assuming i need to refactor my application to run on Heroku with the standard
*web: gunicorn app:app*
Any suggestions on how to refactor my code/file tree? Thanks!
FileTree:
* myApp(root)
* -templates
* -admin.py
* -__init__.py
* -auth.py
* -config.py
* -manage.py
* -models.py
* -Procfile
* -requirements.txt
* -.gitignore
/r/flask
https://redd.it/7mz2z5
reddit
Hosting Flask App on Heroku • r/flask
Hi there, I've been working through deploying an application on Heroku. On my local host I run my application with: *python manage.py...
Examples of people reporting fee contribution from Django trademark usage?
From https://www.djangoproject.com/trademarks/
>You may incorporate the Django name into any website or product whose purpose is to organize, educate or inform the Django community, provided that:
>
> <snip>
>
> If a fee is to be charged for the product, or for access to any or all of the material on the website, a clear statement must exist declaring what proportion of those fees will be retained by the authors, and what proportion, if any, will be contributed back to the DSF. A link to this statement must be prominently displayed on the website or product.
Anyone got good examples of people doing this? I had a cursory browse of https://www.twoscoopspress.com/ and https://www.oreilly.com/ but couldn't find anything - I'd love to see example wording and example percentages!
/r/django
https://redd.it/7morjd
From https://www.djangoproject.com/trademarks/
>You may incorporate the Django name into any website or product whose purpose is to organize, educate or inform the Django community, provided that:
>
> <snip>
>
> If a fee is to be charged for the product, or for access to any or all of the material on the website, a clear statement must exist declaring what proportion of those fees will be retained by the authors, and what proportion, if any, will be contributed back to the DSF. A link to this statement must be prominently displayed on the website or product.
Anyone got good examples of people doing this? I had a cursory browse of https://www.twoscoopspress.com/ and https://www.oreilly.com/ but couldn't find anything - I'd love to see example wording and example percentages!
/r/django
https://redd.it/7morjd
Django Project
Django Trademark License Agreement
The web framework for perfectionists with deadlines.
How bad have I screwed up?
So I made a web application that is going to be used by multiple users, but at a low frequency (let's say around 10-20 applications a day). I haven't tested what happens if I submit multiple applications concurrently...
What is the best way to test this? I'm using SQLAlchemy if that means anything.
/r/flask
https://redd.it/7n2wpt
So I made a web application that is going to be used by multiple users, but at a low frequency (let's say around 10-20 applications a day). I haven't tested what happens if I submit multiple applications concurrently...
What is the best way to test this? I'm using SQLAlchemy if that means anything.
/r/flask
https://redd.it/7n2wpt
reddit
How bad have I screwed up? • r/flask
So I made a web application that is going to be used by multiple users, but at a low frequency (let's say around 10-20 applications a day). I...
IBM Data Science Experience
https://jaxenter.com/python-project-sharing-platforms-139946.html
/r/IPython
https://redd.it/7n1za4
https://jaxenter.com/python-project-sharing-platforms-139946.html
/r/IPython
https://redd.it/7n1za4
JAXenter
New Python project-sharing platforms help data scientists collaborate - JAXenter
Today, commercial platforms for Python developers are similar to the platforms for JavaScript developers. In this article, Jesse Casman explains why companies like IBM are bringing Python collaboration tools into the enterprise.
A REAL Python cheat sheet for beginners
https://learnxinyminutes.com/docs/python3/
/r/Python
https://redd.it/7n1c9u
https://learnxinyminutes.com/docs/python3/
/r/Python
https://redd.it/7n1c9u
reddit
A REAL Python cheat sheet for beginners • r/Python
269 points and 14 comments so far on reddit
Nitpicking: Naming convention for forms and view functions
I want to be consistent with the naming convention of my forms and view functions so that I can better memorize their exact names without needing to look them up. The question is the order of nouns and verbs.
Example: You have a view where you can add and remove members from a party invite list, and also assign someone else to be the party host if you are the current host. The view will be called `party_members`.
You will need 3 form classes. What should they be called?
* Option A - VerbNoun: `AddMemberForm`, `RemoveMemberForm`, `ChangeHostForm`
* Option B - NounVerb: `MemberAddForm`, `MemberRemoveForm`, `HostChangeForm`. (Actually, should it be called `MemberAdditionForm` and `MemberRemovalForm`? This case makes option A easier...)
And the view should call subfunctions. What should they be called?
* Option A: `add_member`, `remove_member`, `change_host`
* Option B: `member_add`, `member_remove`, `host_change`
And if you choose option A for the form, must you also choose A for the view, and vice versa? Sorry for the nitpicking, I couldn't find this in pep8. It really bothers me when I mix my conventions because then I'm always guessing what the functions/forms are called.
/r/django
https://redd.it/7n5gie
I want to be consistent with the naming convention of my forms and view functions so that I can better memorize their exact names without needing to look them up. The question is the order of nouns and verbs.
Example: You have a view where you can add and remove members from a party invite list, and also assign someone else to be the party host if you are the current host. The view will be called `party_members`.
You will need 3 form classes. What should they be called?
* Option A - VerbNoun: `AddMemberForm`, `RemoveMemberForm`, `ChangeHostForm`
* Option B - NounVerb: `MemberAddForm`, `MemberRemoveForm`, `HostChangeForm`. (Actually, should it be called `MemberAdditionForm` and `MemberRemovalForm`? This case makes option A easier...)
And the view should call subfunctions. What should they be called?
* Option A: `add_member`, `remove_member`, `change_host`
* Option B: `member_add`, `member_remove`, `host_change`
And if you choose option A for the form, must you also choose A for the view, and vice versa? Sorry for the nitpicking, I couldn't find this in pep8. It really bothers me when I mix my conventions because then I'm always guessing what the functions/forms are called.
/r/django
https://redd.it/7n5gie
reddit
Nitpicking: Naming convention for forms and view functions • r/django
I want to be consistent with the naming convention of my forms and view functions so that I can better memorize their exact names without needing...
Pyfiddle v 1.1 released!
I wrote https://pyfiddle.io, an online Python IDE for running, saving and sharing light weight Python with ease
Also support features like file uploads, argument passing and package installation.
Happy fiddling at pyfiddle.io !!
Love, a pythonista
/r/Python
https://redd.it/7n5ivo
I wrote https://pyfiddle.io, an online Python IDE for running, saving and sharing light weight Python with ease
Also support features like file uploads, argument passing and package installation.
Happy fiddling at pyfiddle.io !!
Love, a pythonista
/r/Python
https://redd.it/7n5ivo
reddit
Pyfiddle v 1.1 released! • r/Python
I wrote https://pyfiddle.io, an online Python IDE for running, saving and sharing light weight Python with ease Also support features like file...
[Question] What is the best way to implement search functionality to your site?
/r/django
https://redd.it/7n2ljy
/r/django
https://redd.it/7n2ljy
reddit
[Question] What is the best way to implement search... • r/django
8 points and 10 comments so far on reddit