Creating Specific Pages from URL Parameters

So I posted a picture of my cat, Beatrice, and I want a page that's for my cat Beatrice and only my cat Beatrice.

That's easy! I'd make a URL called

/post/Beatrice

Then, I'd redirect to a View method specifically created for my cat picture. Whoopty doo!


What about if I want to have a similar "Post Page" for each of my posts that I make? Would I have to add a new endpoint (URL) and view every time I post a picture? What about if some rando wants to post a picture and have a post page for their picture? They don't have access to the code base so it wouldn't work -- oh lordie lord we have a problem.

But we have a solution! It's called URL parameters!


Every post has a ID stored automatically in the database, so what if we used that to specify?

For post 1, the url is /post/1

For post 2, the url is /post/2

etc

results matching ""

    No results matching ""