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

Update the usage part #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 51 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ mounted from the host i.e. changes made on the host are immediately reflected in
the VM and vice versa. This allows you to work on the code either on the host or
in the VM according to your preference.

Usage
_____

Usage for VM
____________

.. note::
When using a virtual machine, run the following commands in the VM.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is VM specific, you can just say "Run the following commands in the VM:"

Expand All @@ -189,19 +190,61 @@ Then upload the `waterpoint data`_: ::

python manage.py upload_waterpoints <path/to/waterpoints/file.csv>

Start the application from the TaarifaWaterpoints directory by running: ::

python manage.py runserver -r -d

By default the API server is only accessible from the local machine. If access
from the outside is required (e.g. when running from inside a VM), run: ::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you could also say "Since the server is running inside the, access from the host is required ..."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can update the windows and linux usage guide
but i have no experience on VM
can you update VM usage guide?


python manage.py runserver -h 0.0.0.0 -r -d


The flags ``-r`` and ``-d`` cause the server to run in debug mode and reload
automatically when files are changed.

To verify things are working, open a browser (on the host and when using the VM)
and navigate to: ::

http://localhost:5000/api/waterpoints

This should show a list of all the waterpoint resources currently in the
database.

To work on the frontend web application start the `grunt` server (with the API
server running on port 5000) using: ::

grunt serve --watch

Then navigate to (on the host and when using the VM): ::

http://localhost:9000


Usage for windows and Linux
___________________________

.. note::
When using a virtual machine, run the following commands in the VM.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is now for the non-VM case this note is no longer necessary.


Make sure the virtualenv is active: ::

workon TaarifaAPI

From the TaarifaWaterpoints directory run the following commands to
create the waterpoint schemas: ::

python manage.py create_facility
python manage.py create_service

Then upload the `waterpoint data`_: ::

python manage.py upload_waterpoints <path/to/waterpoints/file.csv>

Start the application from the TaarifaWaterpoints directory by running: ::

python manage.py runserver -r -d

The flags ``-r`` and ``-d`` cause the server to run in debug mode and reload
automatically when files are changed.

To verify things are working, open a browser (on the host when using the VM)
To verify things are working, open a browser (on the host and when using the VM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now grammatically incorrect.

and navigate to: ::

http://localhost:5000/api/waterpoints
Expand All @@ -214,7 +257,7 @@ server running on port 5000) using: ::

grunt serve --watch

Then navigate to (on the host when using the VM): ::
Then navigate to (on the host and when using the VM): ::

http://localhost:9000

Expand Down