#140 Added argument support for hubs/app.py
Merged 8 years ago by ryanlerch. Opened 8 years ago by ryanlerch.
ryanlerch/fedora-hubs addargs  into  develop

file modified
+10 -9
@@ -1,14 +1,15 @@ 

- Fedora Hubs will provide a communication and collaboration center for Fedora 

- contributors of all types. The idea is that contributors will be able to visit 

- Hubs to check on their involvements across Fedora, discover new places that they 

+ Fedora Hubs will provide a communication and collaboration center for Fedora

+ contributors of all types. The idea is that contributors will be able to visit

+ Hubs to check on their involvements across Fedora, discover new places that they

  can contribute, and more.

  

- Hubs is currently under development, and you can see the progress on the 

+ Hubs is currently under development, and you can see the progress on the

  Development instance here: http://209.132.184.98

  

  Mailing List

  ============

- We have a mailing list here: https://lists.fedoraproject.org/archives/list/hubs-devel@lists.fedoraproject.org/

+ We have a mailing list here:

+ https://lists.fedoraproject.org/archives/list/hubs-devel@lists.fedoraproject.org

  

  

  Hacking
@@ -43,8 +44,8 @@ 

  

  With that, try running the app with::

  

-     $ PYTHONPATH=. python populate.py  # To create the db

-     $ PYTHONPATH=. python hubs/app.py  # To run the dev server

+     $ python populate.py  # To create the db

+     $ python runserver.py  # To run the dev server

  

  And then navigate to http://localhost:5000/

  
@@ -77,11 +78,11 @@ 

  -------------------

  

  You need to add a new file to the ``fedmsg.d/`` directory.

- Call it ``fedmsg.d/credentials.py``.  It's needed to query FAS 

+ Call it ``fedmsg.d/credentials.py``.  It's needed to query FAS

  for information about other users. When we deploy this thing to

  production, we'll use a system account for this but for now, just

  use your personal account. You don't want to accidentally share this

- with anyone else. so be sure to keep it private.  It should have 

+ with anyone else. so be sure to keep it private.  It should have

  contents like this::

  

      config = {

file modified
-4
@@ -480,7 +480,3 @@ 

          return flask.abort(400)

      session.commit()

      return flask.redirect(flask.url_for('hub', name=hub.name))

- 

- 

- if __name__ == '__main__':

-     app.run(debug=True)

file added
+22
@@ -0,0 +1,22 @@ 

+ #!/usr/bin/env python2

+ 

+ import argparse

+ import sys

+ import os

+ 

+ parser = argparse.ArgumentParser(

+     description='Run the Hubs app')

+ parser.add_argument(

+     '--port', '-p', default=5000,

+     help='Port for Hubs to run on.')

+ parser.add_argument(

+     '--host', default="127.0.0.1",

+     help='Hostname to listen on. When set to 0.0.0.0 the server is available \

+           externally. Defaults to 127.0.0.1 making the it only visible on \

+           localhost')

+ 

+ args = parser.parse_args()

+ 

+ from hubs.app import app

+ 

+ app.run(debug=True, host=args.host, port=int(args.port))

no initial comment

Added args support for hubs/app.py so a dev can specify
the host and port variables when running a dev server

I think I'd rather have a runserver.py script to do this than adding CLI options to the web app :)

Pull-Request has been updated

8 years ago

Fair enough!

I have updated the branch with a few more commits, adding a runserver.py, and updating the readme to say that runserver.py is the script to run the dev server now.

Pull-Request has been updated

8 years ago

Pull-Request has been rebased

8 years ago

I think we don't need PYTHONPATH anymore. :relaxed:

I had the same thought, we just need to check it (since it's also asked for
the populate.py script above) and I thought it does no harm in the mean
while (thus my +1).

yeah! right. populate.py would also not require PYTHONPATH. I have using it without the PYTHONPATH

Ok so let's remove the two PYTHONPATH and we're good to merge :)

Pull-Request has been rebased

8 years ago

Pull-Request has been merged by ryanlerch

8 years ago