Part 11 : Finishing Touches
| |
|
|
| |
Table of Contents |
|
| |
|
|
Uncomment the Sync with Trust Fabric Thread
- In GridClient/views.py
- Uncomment the following
thread.start_new_thread(syncTrust, ())
- Save the file
Implement the index page
Construct the index template
- In the mytemplates/thewebapp folder, make the template index.html
- 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%} - Save the file
Edit the index method
- In GridClient/views.py
- 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)) - Save the file
Test the index page
- Go to http://localhost:8000/index/

- If you're logged in, you'll see the saved queries page
- Otherwise you'll see





