Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ii:labs:s2:01:tasks:02 [2022/04/01 13:06]
florin.stancu [02. Integration with Flask backend]
ii:labs:s2:01:tasks:02 [2024/03/15 13:30] (current)
florin.stancu [02. [20p] Let's do the math!]
Line 1: Line 1:
-==== 02. Integration with Flask backend ​====+==== 02. [25p] Let's do the math! ====
  
-We now want to move the design from a static ''​html''​ file to using Flask Jinja template rendering+Python is also popular for its numeric manipulation features (it can handle very large numbers!)
-For this, you must:+Let's find out:
  
-  * Migrate / split the HTML code to ''​templates/​_base.html'' ​(base template) and ''​templates/​index.html''​ (child)+  * Read a number from the console (you should know how to do it by now; don't forget to convert it to an ''​int''​!); 
-    * //Note:// use Jinja2 [[https://​jinja.palletsprojects.com/​en/​3.1.x/​templates/#​template-inheritance|template inheritance]] with an empty content block+  * Reverse the number's digits and print the result (e.g., ''​13568 => 86531''​)! 
-  * Modify ​''​server.py'' ​to call ''​render_template''​ to actually serve our design. +  * Define a new function, ​''​generate_prime(k)''​, which takes in an argument ​and will generate ​prime number of exactly ''​k''​ digits; use it to generate a 15-digit prime number ​(decrease this if it'​s ​taking too long '':​(''​ )!
-  * Also create ​''​about.html''​ and a Python method for serving ​it (fill it with whatever content you want ;) ); +
-  * Finally, fix the URLs in the template'​s ​menu to point to the appropriate pages.+
  
ii/labs/s2/01/tasks/02.1648807589.txt.gz · Last modified: 2022/04/01 13:06 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0