Flask,  Python,  Solr

Flask and Apache Solr 7.5

Lets develop a webapp with Solr.

Short guide to Jinja2:

http://jinja.pocoo.org/docs/2.10/

Jinja2 is a modern day templating language for Python developers. It was made after Django’s template. It is used to create HTML, XML or other markup formats that are returned to the user via an HTTP request.

  • Sandboxed Execution: It provides a protected framework for automation of testing programs, whose behaviour is unknown and must be investigated.
  • HTML Escaping: Jinja 2 has a powerful automatic HTML Escaping, which helps preventing Cross-site Scripting (XSS Attack). There are special characters like >,<,&, etc. which carry special meanings in the templates. So, if you want to use them as regular text in your documents then, replace them with entities. Not doing so might lead to XSS-Attack.
  • Template Inheritance: This is the most important feature.

A base template contains the basic layout which is common to all the other templates, and it is from this base template we extend or derive the layout for other pages.

Delimiters

  • {%….%} are for statements
  • {{….}} are expressions used to print to template output
  • {#….#} are for comments which are not included in the template output
  • #….## are used as line statements

Short guide to Flask:

http://flask.pocoo.org/

Code:

https://github.com/spawnmarvel/solrhttp

 

WebApp in progress, the picture below is the running app with not much code, and about 30 min for develepment time..

In this app we will make admin and query function for Solr in Flask for the functions we developed earlier.

We will search for data, add data, delete data, backup / load and restore and more.

 

Comments Off on Flask and Apache Solr 7.5