Python Forum
Help finishing my Wikipedia page
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help finishing my Wikipedia page
#4
(Jul-07-2020, 03:20 AM)card51shor Wrote: I thought that was the syntax of all views?

Well, think about it. Not all views need to render a template, do they? Examples:

- The response from an API endpoint, which as you know by now will typically be XML or JSON.
- Redirecting to another page. This is usually done by setting the appropriate status code and the Location header.

Quote:So I shouldn't call render? Why not? What should I do instead?

Quote:Now I have to change the markup to HTML when shown to the user. I'm going to fiddle around with this later tonight. Any tips as I do it?

These two things make me a bit worried. You seem to be averse to reading documentation. For the former, OK you've figured out a solution by now, but the docs do tell you how to create HTTP responses. I'm not a Django user, but looking at the "Part 3: Views and templates" page linked to from here, there's useful information (I found what I wanted under "Write views that actually do something"). For the latter, you've been advised to use a library to do that, so you need to consult its documentation. It's critical that you use documentation, tutorials etc. to figure stuff out - there isn't always going to be someone on this forum, say, who knows the ins and outs of whatever library you're using. I don't know if you're planning on doing development as a job, but even in that case, you'd have to figure stuff out because it wouldn't really be possible to wait an unspecified amount of time to get an answer. Hint: choose libraries that are well documented and maintained!
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,963 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