Forums

Python Django Blog Post

Alright, so I am trying to setup a Blog that anyone can add a post to, just like I would myself. All of the tutorials I come across don't mention anything about a website where they can add a post themselves. I already have it setup to read off the current posts, how can I use Http POST to add a new blog post entry?

I'm not sure I understand the question... normally a blog would have some kind of authentication in there to make sure that only an authorised user can post to it. So for your open blog, presumably you'd just need to remove the authentication...?

Yep that sounds about right.

"Blog" probably wasn't the best word to describe it. It would me more like what we are using right now, replying to this thread. It would do the same thing as the following website, but would append the new POST entry instead of making a new file. http://posttestserver.com/

Ah, I see. What you need to do is store each entry in a separate Django model object. You'd have two views, one which displays all of the entries, one after the other, and one of which, if the request made to it is a GET, shows a page that contains a form, and if it's a POST, uses the form to create a new model object and then (probably) redirects to the view displaying all entries.

If you need more details on how to set that up, I recommend going through the Django tutorial. Here are some hints on how to do that with PythonAnywhere.

The link you gave just brought me back to the Dashboard/Console screen. The real issue is that I am trying to do something above current skill, but it is the main reason I started learning this language.

It takes you back to the Dashboard, but at the top of the dashboard there should be a green "helper" window that walks you through the tutorial. Is it not there?