Giter VIP home page Giter VIP logo

snow's Introduction

Snow a simple web framework

This repository is an effort to understand how the web framework works. We started with a simple static page rendering engine until we arrived at a simple framework called Snow.

First way with Pure Python

The main goal of this repository is to study Python to develop a web application without any framework or external library just using built-in functions and classes of Python itself.

We'll follow these steps:

  • create a database integration with SQLite that has a native Python integration;
  • create templates for our HTML files that will be generated by our render script;
  • create a render template script, this script catches the data on the database and mixes it with the HTML template to generate a respective HTML file. This script needs to be executed before publishing our website pages.
  • create a simple server WSGI script that serves dynamically the HTML pages. With this simple server, we don't need to render the pages of our websites before publishing, but these pages will be generated dynamically.

Second way with some libraries of Python ecosystem

After the first way, now we'll use some Python libraries to help us to build a robust application to render and serve our blog.

These libraries are on requirements.txt file.

We'll follow these steps:

  • improve the app with Jinja2 template engine

Third way is to convert the WSGI server to a Web Framework

After creating a static HTML render and migrating it to a simple WSGI dynamic server, now we improve our knowledge by converting the WSGI server to a simple Web Framework called Snow.

We followed these steps:

  • Create a class called Snow, that is our framework
  • Instantiate an app object from our class
  • Create business rules in a specific module to decouple our logic from our implementation

snow's People

Contributors

riverfount avatar

Stargazers

Getúlio Augusto Ferreira de Castro Júnior avatar

Watchers

James Cloos avatar  avatar

snow's Issues

Create blog templates of HTML.

The goal of this issue is to create the templates for HTML files that will generate with the templates render script.

Create SQLite connection

The goal of this issue is to create a SQLite connection, create a blog post table, and insert two new registers in it.

Create a template render script

The goal of this issue is to create a template render script. This script catches the data on the database and mixes it with the HTML template to generate a respective HTML file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.