Python Forum
Help finishing my Wikipedia page
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help finishing my Wikipedia page
#1
My issue right now is getting the view to complete both the rendering of the function that edits the entry but then also redirect the user back to the wiki/<title> webpage. I can't figure out how to make it return those 2 things. I want it to save the entry first, then go back to the original page that was edited. How can i do that?

Here is my code in question:

def save(request):
    title = request.POST.get("title")
    content = request.POST.get("content")
    return render(request, "encyclopedia/save.html", {
            "entries": util.save_entry(title, content)
        })
how is it possible that I can make it return the save_entry function but also return back to the original page? What is the syntax for including two things?

I can change the encyclopaedia/save.html to encyclopedia/wiki/<title> but then it gives me an error that save is not a valid page. What's the best way to make sure it runs the save.html briefly (that says "record save") then reloads back to the original page? Thanks!
Reply


Messages In This Thread
Help finishing my Wikipedia page - by card51shor - Jul-06-2020, 07:45 AM
RE: Help finishing my Wikipedia page - by ndc85430 - Jul-06-2020, 08:43 AM
RE: Help finishing my Wikipedia page - by ndc85430 - Jul-07-2020, 04:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help in finishing my scripts mohank84 5 3,897 Oct-16-2019, 04:54 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020