Example #1
0
    def setUp(self):
        Content.objects().delete()
        User.objects().delete()

        u = User(username="******", password="")
        u.save()
        
        c = Content(path="/test-path/",
                    title="Test Content item",
                    author=u,
                    publish_date=datetime.now(),
                    is_published=True)
        c.save()
Example #2
0
def content_detail(path):
    path = "/%s/" % (path,)
    content = Content.objects(path=path).first()

    if content is None:
        abort(404)

    return render_template("content.html", content=content)