Forums

How to delete other users posts from flask database blog?

just made a basic blog using flask tutorial - one that sets up books and authors

But can't get to delete other users posts even if signing on under 'admin'

So what's to stop anyone from just trolling it?

ie. how to delete posts? thanks

Which tutorial were you following?

http://flask.pocoo.org

what I'd like is admin access to the blog so that all posts could be edited - like how exists on a chat forum

but as it stands, anyone who finds the web page can sign up, and post anything, and I can't change or edit their posts easily

Ah, I see. That's the kind of thing they're leaving you to do for your own future development. You could delete posts by using the sqlite command-line tool to connect to your database and then use SQL commands to delete them, of course -- or you could write a new view and then restrict it so that only your admin user could access it, and then in that write the code to delete a post, and only show a link to it in the HTML if the user is admin.