From 0f803fa13413f2170e6386fc6f62c691c5c1e17b Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Wed, 16 Jul 2014 18:35:02 +0530 Subject: [PATCH 1/2] Updated the docs for writing new training missions --- docs/tutorials/writing_missions.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/writing_missions.rst b/docs/tutorials/writing_missions.rst index 6c06568f9a..4a6da1e180 100644 --- a/docs/tutorials/writing_missions.rst +++ b/docs/tutorials/writing_missions.rst @@ -181,20 +181,27 @@ Making it Accessible -------------------- The final step to writing your Mission is to make it accessible on the -site. This requires telling OpenHatch how to route the URLs. Django -projects define URL routing in a file cunningly named ``urls.py``. You -can find this in the ``mysite`` directory. If you open it, you'll find -a list of URL patterns -- regular expressions which Django will use to -match URLs and figure out where to send requests. You can add the new -mission by adding a new item after the other missions:: +site by telling OpenHatch how to route the URLs. Django projects define +URL routing in a file cunningly named ``urls.py``. You can find this +in the ``mysite`` directory. The first step to making your mission accessible +is to tell ``urls.py`` where the file ``views.py`` for your new mission +lives by adding an ``import`` statement near the top of ``urls.py`` right +after the ``import`` statements for the existing training missions like so:: + + import mysite.missions.makeamission.views + +Next, if you open ``urls.py``, you'll find a list of URL patterns -- regular +expressions which Django will use to match URLs and figure out where to +send requests. The second and final step to making your mission accessible +is to add the new mission by adding a new item after the other missions:: (r'^missions/makeamission', include(mysite.missions.makeamission.views.MakeAMission.urls())), Two important things to note: -* ``makeamission`` in the ``include`` statement refers to the - directory you created, so you'll need to make sure the name matches. +* ``makeamission`` in the ``include`` and ``import`` statements above refer + to the directory you created, so you'll need to make sure the name matches. * ``MakeAMission`` is the name you give your Mission class. Once you've added it to the URLs, you can start the server and visit From deb925f3fd8a29da555e83d37dd9b1d540d0fb6a Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Sun, 20 Jul 2014 10:55:25 +0530 Subject: [PATCH 2/2] Delete confusing and superfluous text --- docs/tutorials/writing_missions.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/writing_missions.rst b/docs/tutorials/writing_missions.rst index 4a6da1e180..a1b52c3efe 100644 --- a/docs/tutorials/writing_missions.rst +++ b/docs/tutorials/writing_missions.rst @@ -183,17 +183,17 @@ Making it Accessible The final step to writing your Mission is to make it accessible on the site by telling OpenHatch how to route the URLs. Django projects define URL routing in a file cunningly named ``urls.py``. You can find this -in the ``mysite`` directory. The first step to making your mission accessible -is to tell ``urls.py`` where the file ``views.py`` for your new mission +in the ``mysite`` directory. You can begin by opening ``urls.py``. +You'll need to tell it where the file ``views.py`` for your new mission lives by adding an ``import`` statement near the top of ``urls.py`` right after the ``import`` statements for the existing training missions like so:: import mysite.missions.makeamission.views -Next, if you open ``urls.py``, you'll find a list of URL patterns -- regular +In ``urls.py``, you'll also find a list of URL patterns -- regular expressions which Django will use to match URLs and figure out where to -send requests. The second and final step to making your mission accessible -is to add the new mission by adding a new item after the other missions:: +send requests. Finally, add the new mission by adding a new item after the +other missions:: (r'^missions/makeamission', include(mysite.missions.makeamission.views.MakeAMission.urls())),