Are Django developers ready to create AMP-HTML pages?
(For reference: Google AMP project )
If I understand correctly how AMP-HTML works, you create 2 separate files for each page. Normal HTML result, plus a new AMP-HTML file. The AMP-HTML file is a smaller version of a regular HTML page and is used by Google to return an accelerated mobile page (hence the name Accelerated Mobile Pages). Each of these files refers to each other in a tag in the head that tells Google to use the AMP file for mobile results.
As part of Django, I am wondering how to create 2 separate files based on the same set of content.
How can one context be used that can be passed along with two HTML results? One result is a plain HTML page, the other is an AMP-HTML page.
In Django, a URL must be created for each page returned. How can I automatically create a second URL for every existing URL? Also, how can one context be invoked for each of these URLs?
Perhaps this is possible in the view? For example, return the extension .html, which is an AMP page, and then also create a template for the URL?
I have no answers yet how to solve this. Look for feedback and suggestions. This seems to be the first ever question posted on stackoverflow in Django and AMP-HTML. This will probably not be the last.
django amp-html accelerated-mobile-page
Renkai
source share