Commits

agronholm  committed e22b74e

Added instructions for running the examples

  • Participants
  • Parent commits b8dac2f

Comments (0)

Files changed (1)

File docs/examples.rst

+Running the examples
+====================
+
+If you installed PyHttpRPC through `easy_install` or `pip`, you didn't get the
+full source package. Download and extract the source package and then enter the
+directory created in the process. You need to start a server first and then
+run one of the clients against it. You can run any client against any server --
+they are tested automatically for compatibility against each other.
+
+
+Running the servers
+===================
+
+All the example servers (except Django) are run basically the same way.
+Assuming you are in the directory extracted from the package, and that you have
+a server running::
+
+	python -m examples.server.<servername>
+
+The <servername> variable can be on the following:
+
+* wsgi (the plain WSGI application on the standard library wsgiref server)
+* webcore (a WebCore application running on the Paste http server)
+* twistd (a Twisted web server with the PyHttpRPC resource as the root resource)
+
+Django
+------
+
+In order to be able to run the Django example server, you have to set the
+value of the ``DJANGO_SETTINGS_MODULE`` environment variable to
+``examples.server.django_example.settings``.
+
+Then, to start the server::
+
+	django-admin.py testserver --addrport=localhost:8123
+
+
+Running the clients
+===================
+
+All clients are run in the same manner. Assuming you are in the directory
+extracted from the package, and that you have a server running::
+
+	python -m examples.client.<clientname>
+
+The <clientname> variable can be any of the following:
+
+* ``http`` (httplib client)
+* ``http2`` (httplib2 client)
+* ``twistd`` (Twisted client)
+* ``url2`` (urllib2 client)
+
+So, to run the basic httplib client, type::
+
+	python -m examples.client.http
+
+All the clients are rougly identical. They execute three different remote
+procedure calls.