Access Keys:
Skip to content (Access Key - 0)

Knowledgebase

Part 11 : Finishing Touches


Table of Contents

Uncomment the Sync with Trust Fabric Thread

  1. In GridClient/views.py
  2. Uncomment the following
    thread.start_new_thread(syncTrust, ())
  3. Save the file

Implement the index page

Construct the index template
  1. In the mytemplates/thewebapp folder, make the template index.html
  2. Add the following:
    {% if the_username %}
    	Hello <b>{{ the_username }}</b>, you are logged in. Do you want to <a href="/logout/">Logout?</a><br>
    {% else %}
    	Hello, do you want to <a href="/login/">Login</a> to save queries and query secure data services?<br>
    {% endif %}
    <h1>Do you want to:</h1>
    <a href="/login/">Login?</a><br>
    <a href="/listservices/">List Services?</a><br>
    <a href="/discoverservices/">Discover Services?</a><br>
    <a href="/dataservices/">Query a Data Service?</a><br>
    {% if the_username %}<a href="/savedqueries/">Use a Previous Query?</a><br>{%endif%}
    
  3. Save the file
Edit the index method
  1. In GridClient/views.py
  2. Change the index method
    def index(request):
        #return HttpResponse("Hello, you're at the index :)")
        return render_to_response("thewebapp/index.html",
                                  {'the_username':logged_in(request),},
                                  context_instance=RequestContext(request))
    
  3. Save the file

Test the index page

  1. Go to http://localhost:8000/index/
  2. If you're logged in, you'll see the saved queries page
  3. Otherwise you'll see
Last edited by
Saba Bokhari (556 days ago)
Adaptavist Theme Builder Powered by Atlassian Confluence