SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>> from worldguestbook.models import GuestBookItem
  2. >>> GuestBookItem.objects.all()
  3. <QuerySet [<GuestBookItem: GuestBookItem object (1)>, <GuestBookItem: GuestBookItem object (2)>, <GuestBookItem: GuestBookItem object (3)>]>
  4. >>>
  5.      
  6. <div id="mce-responses" class="clear">
  7.             <div class="response" id="mce-error-response" style="display:none"></div>
  8.             <div class="response" id="mce-success-response" style="display:none"></div>
  9.           </div>
  10.  
  11.           <div class="" style="position: absolute; left: -5000px;"><input type="text" name="b_410ed4e009d15301d90f6492b_753384883a" value=""></div>
  12.         </form>
  13.         <span class="form_nospam">Warning: The world will see your message</span>
  14.       </div>
  15.       <!--End mc_embed_signup-->
  16.     </div>
  17.   </div>
  18.   <!-- /end of Row-->
  19. </div>
  20. <!-- End of container-->
  21. <ul>
  22.     {% for guestbookitem in all_items %}
  23.         <li> {{ GuestBookItem.content }} </li>
  24.     {% endfor %}
  25. </ul>
  26. </body>
  27. </html>
  28.      
  29. from django.shortcuts import render
  30.  
  31. from django.http import HttpResponse
  32. from .models import GuestBookItem
  33.  
  34.  
  35. # Create your views here.
  36. def worldguestbookView(request):
  37.     allguestbookitems=GuestBookItem.objects.all()
  38.     return render(request, 'worldguestbookworldguestbook.html',{'all_items' : allguestbookitems})
  39.  
  40. def loginView(request):
  41.     return render(request, 'worldguestbooklogin.html')
  42.      
  43. from django.db import models
  44.  
  45. # Create your models here.
  46.  
  47. class GuestBookItem(models.Model):
  48.     content=models.TextField()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top