Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve serve command #771

Merged
merged 4 commits into from
Nov 22, 2018
Merged

Improve serve command #771

merged 4 commits into from
Nov 22, 2018

Conversation

Morendil
Copy link
Contributor

@Morendil Morendil commented Nov 16, 2018

Fixes #634

We need to be able to specify host as well as port in openfisca serve.

Absent a specific host option, openfisca serve --bind 0.0.0.0:7777 will do, as the documentation hints at.

Discoverability of this was limited in two ways:

  • the bare command openfisca crashed with AttributeError: 'Namespace' object has no attribute 'vars'
  • the help option openfisca serve -h does not mention gunicorn's --bind

This PR fixes both shortcomings.

@fpagnoux
Copy link
Member

the bare command openfisca crashed with AttributeError: 'Namespace' object has no attribute 'vars'

Hum, the bare openfisca command was not supposed to trigger a serve. The initial behavior was to crash and indicate that the command was missing. This still works in Python 2.7, but not in Python 3, as the behavior or ArgParse changed.

@fpagnoux
Copy link
Member

Hum, the bare openfisca command was not supposed to trigger a serve. The initial behavior was to crash and indicate that the command was missing. This still works in Python 2.7, but not in Python 3, as the behavior or ArgParse changed.

Just pushed a small commit to adapt to Python 3:
image

openfisca_web_api/scripts/serve.py Outdated Show resolved Hide resolved
@pblayo pblayo dismissed fpagnoux’s stale review November 22, 2018 14:37

Change requests were taken into account

@pblayo pblayo merged commit dca8985 into master Nov 22, 2018
@pblayo pblayo deleted the improve-serve branch November 22, 2018 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a "host" option to openfisca-serve
3 participants