This is really more a django template / basic css question, but what you can do is test for forloop.first and last, and in those cases change your <li> to include a class="first" or class="last"
Then style the <li> first and last appropriately in css.