tut request - blog related

by: kingfitz, 8 years ago

Last edited: 8 years ago

Hey bro.  When you get time would be great to see a flask/django blog pagination w comment appending.  I suppose adding comments should be relatively easy, just a form with name and email and text area, submit, stores in database, and then prints the form data at the bottom of the HTML page.  The pagination is the trickier part.  I think a good convention for a blog url would be

'/blog/<int:page>/<string:thread>/'  

(and possibly add a date in 2-15-17 form, so another <string:thread>/ )

one cool thing I did in django to organize blog posts at bottom of /blog/ is make a little data toggle box, into which new posts appear:

{% block content %}
<div class="container">
<div class="col-md-6 pull-left">
      <a class="btn btn-default" role="button" data-toggle="collapse" href="#bloglist1" aria-expanded="true"> <h4 class="text-info"> All Blog Posts » </h4> </a>
      
<div class="collapse" id="bloglist1">
  <div class="alert alert-default">
   {% for post in object_list %}
<h5> {{ post.date|date:"Y-m-d" }} <a href="/blog/{{ post.id }}"> {{ post.title }} </a> </h5>
{% endfor %}
  </div>
</div>
</div>
</div>
{% endblock %}


beyond that some commenting stuff would be in order, reply button, edit, or delete perhaps. maybe separate a comment section with a <hr>.  ok ttyl



You must be logged in to post. Please login or register an account.



Thank you for the request, not sure what I will do for Flask next, but I could do a forum example for both Flask and Django.

Also been wanting to poke around other web frameworks too.

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.