Solution for Simple Sample Django Project

comment the following line in settings.py
‘django.middleware.csrf.CsrfViewMiddleware’,

add this in urls.py

(r’^AddressBook/Update/(?P<addressbook_id>\d+)/’, ‘djtest.AddressBook.views.update’),

detail.html should be like this
<a href=”../../Index/”>Go Back</a><br>
<table>
<tr><td>ID</td><td>{{detail_data.id}}</td></tr> <form action=”/Index/New/” method=”post”>
<table>
<tr><td>FirstName</td><td>{{detail_data.firstname}}</td></tr>
<tr><td>LastName</td><td>{{detail_data.lastname}}</td></tr>
<tr><td>Phone</td><td>{{detail_data.phone}}</td></tr>
<tr><td>Address</td><td>{{detail_data.address}}</td></tr>
<tr><td>Date</td><td>{{detail_data.mod_date}}</td></tr>
</table>
</form>

Advertisements

One thought on “Solution for Simple Sample Django Project

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s