Roy Tang

Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart.

Blog Notes Photos Links Archives About

Playing with Generic Views and URLs

"when redirecting, how can I make the redirect URL decoupled from the of the parent app?"

-> It turns out that HttpResponseRedirect supports relative paths, so this was fine.

return HttpResponseRedirect("../" + str( + "/")

I got the basic posting structure up.

/post/new/ -> To make new posts

/post// -> To view a single post

/post/all/ -> To view all posts

I should probably start thinking of a better url scheme. Ideally, I'd want the @login_required views to be indicated as such in the urls. Something like "/admin/post/" for new posts "/admin/manage/" for a screen to manage posts to differentiate it from a screen just to list them out.

Next I think I'll try to CSS-ify the blog; I'll probably just reuse stuff from one of the blogger templates as I'm still not very good with the HTML/CSS.

I'll also look into using some of the date-based generic views to get an archive view. I'll need more data though. Will consider importing from the WordPress blog.

Posted by under blog at #royondjango #django #python #software-development

Also on: blogger / 167 words

Last modified at: Jan. 17, 2021, 4:57 a.m.. Source file