On Monday, 4 June 2018 16:00:09 UTC+10, Bernd Wechner wrote:
> Say I have a page on my Django website (because I do) that I would like to
> take a snapshot of on an automated basis on the server itself with a
> crontab say. I imagine writing a small python script that I could run, that
> loads Django, a settings file, knows a URL and has a way of saying "give me
> the rendered page for that URL please" and save it in a file.
> On way of course is open port 80 or 443, send an HTTP request and get the
> HTTP response. But there is probably a better way that leaves the web and
> UWSGI servers right out of the equation and just runs Django template
> rendering code or a view itself and nabs the result.
> As usual, I'm both confident this is possible and that I'll nut out a way
> to do it, but am throwing it out there in case:
> a) there's a canonical way to do this already that can be recommended
> b) I can save myself some time reading and experimenting if anyone whose
> done this already shares their experience
> I will raise the bar one on the original question while I'm here, and
> some rendering on page load - I have a page or two like that ;-), In that
> case neither of these strategies are likely to work and either one might if
> coupled with what would basically need to be, a rendering engine like
> mozilla's. Does Python offer that I wonder, a way to pump a response (with
> rendered page?
> Kind regards,
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.