Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. def index(request):
  2. videoNames = []
  3. paths = []
  4. for filename in os.listdir("./mainapp/static/mainapp/videos/"):
  5. videoNames.append(filename)
  6. paths.append("/static/mainapp/videos/" + filename)
  7. videoInfo = zip(paths, videoNames)
  8. return render(request, 'mainapp/videos.html', { "videoInfo":videoInfo } )
  9.  
  10.  
  11.  
  12.  
  13.  
  14. **** template
  15.  
  16. {% block content %}
  17.  
  18. <div class = "videoGrid">
  19. {% for path, videoName in videoInfo %}
  20. <div class="postContainer">
  21. <div class = "videoContainer">
  22. <video controls>
  23. <source src={{ path }}>
  24. </video>
  25. </div>
  26. <div class = "infoContainer">
  27. <div class = "titleContainer">
  28. <b> {{ videoName }} </b>
  29. </div>
  30. <div class = "descContainer">
  31. Lorem impsulim etc tnmoew tor cod ernti.
  32. </div>
  33. </div>
  34. </div>
  35. {% endfor %}
  36. </div>
  37.  
  38. {% endblock%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement