Posts

Showing posts from June, 2020

Notes on Flask

Flask with AJAX For those well versed with Flask and AJAX this is nothing new, but for newcomers to both/either, the following code snippet is a quick start introduction to using AJAX with Flask on their websites. Python Flask + JavaScript XMLHttpRequest. There are a large number of tutorials and examples out there, but this one helped me the most because of its simplicity. It uses plain JavaScript instead of JQuery or any other framework, and given my incremental style of development, and "Mistake Driven Learning" style of learning, this was my starting point for the MarketDB project. Eschewing JSON In the current stage, I am avoiding using JSON as much as possible for three conscious reasons: (1) less learning required to handle JSON in JavaScript and Python. I know this is just laziness, and I already do know the basics of JSON in both languages, but using it in a production project requires deeper dive into the standards, which is really not necessary. Lists suffice for

Theme-ing Lektor

Documented steps for changing theme: https://www.getlektor.com/docs/themes/installing/ So first I create a local directory in project root to hold all Lektor themes mkdir themes then I cloned a theme into that folder git clone https://github.com/Andrew-Shay/lektor-theme-simple-strap.git themes then I added a reference to that theme in the project config file: nano nitishshukla.com.lektorproject themes = lektor-theme-simple-strap #Ctrl+o, Enter, Ctrl+x, Enter now update repo git add . git commit git push origin master By this time there was already an error in Netlify: 12:51:55 AM: Error checking out submodules: fatal: No url found for submodule path 'themes' in .gitmodules 12:51:55 AM: Failing build: Failed to prepare repo 12:51:55 AM: Failed during stage 'preparing repo': Error checking out submodules: fatal: No url found for submodule path 'themes' in .gitmodules : exit status 128 This basically means that the theme that I cloned into [project]/