Pure-python-server - A blogging platform written in pure python for developer to share their coding knowledge

Overview

Pure Python web server - PyProject

A blogging platform written in pure python (no web frameworks used) for developer to share their coding knowledge

How was this web app made?

The web app is based on WSGI and will work perfectly with any WSGI complaint web servers.

Here's a short summary of a WSGI application:

  • WSGI application are callable python objects (functions or classes with a call method that are passed two arguments: a WSGI environment as first argument and a function that starts the response.
  • the application has to start a response using the function provided and return an iterable where each yielded item means writing and flushing.
  • you can add middlewares to your application by wrapping it.

Most Python web frameworks are WSGI compatible, and use a WSGI complaint web server to call them when a request happens return its response to client.

I took some liberties to design the architecture of the project similar to that of a Flask app, and used to some essential libraries for templating, DB storage, conversion of markdown to html and sanitizing of user input.

There was a lot of research invloved as there is scarce information on this topic, I also had to implement code to manage exceptionx instead of crashing and I had to study source code of Python web frameworks, and other libraries to understand how they implemented certain things.

You can find the core code which is the backbone of the app in the folders pyproject/lib, pyproject/errors.

How to run this project

  1. Clone the project
git clone https://github.com/SrikarKSV/pure-python-server.git
  1. Install all the dependencies
pip install -r requirements.txt
  1. Fill the environment variables in a .env file, you can find the example in .env.example

  2. Use gunicorn server to start the application

gunicorn -w 4 main:app
  1. If you don't want make an instance of database, don't mention DATABASE_URI in .env file and the app will create a sqlite db with the table automatically

NOTE : If your computer has an error when running gunicorn, you can directly run the python file main.py and it will spin up a WSGI server from python standard library (But it's really slow)

Libraries used in the app

  1. Jinja2
  2. Python-Markdown
  3. SQLAlchemy
  4. bleach
  5. python-dotenv (For development)

The goals of the project:

  • Understand how python web servers works under the hood
  • Connect the small pieces that frameworks takes care of
  • Study the source code of these frameworks to imitate their functionality

NOT the goals of the project:

  • To create the entire functionality of a python web framework
  • To create every functionality from scratch
  • To not use a single external package

Todos:

  • Create a routing system
  • Use Jinja templating language to render html
  • Serve static files
  • Parse both GET and POST requests form
  • A page which shows all the articles
  • A form page to add new articles
  • Use markdown for article content
  • Update and delete articles
  • Style with CSS
  • Add meta tags
Owner
Srikar Koushik Satya Viswanadha
I'm a 2nd-year college student, a self-taught coding enthusiast.
Srikar Koushik Satya Viswanadha
Markdown journal template.

Markdown Journal Template Description This project contains a script which creates a markdown journal template for the current year by creating a mark

Stephen McAleese 2 Mar 06, 2022
CiteURL is an extensible tool that parses legal citations and makes links to websites where you can read the cited language for free.

CiteURL is an extensible tool that parses legal citations and makes links to websites where you can read the cited language for free. It can be used t

15 Dec 27, 2022
Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.

Markdown-Include This is an extension to Python-Markdown which provides an "include" function, similar to that found in LaTeX (and also the C pre-proc

Chris MacMackin 85 Dec 30, 2022
A markdown lexer and parser which gives the programmer atomic control over markdown parsing to html.

A markdown lexer and parser which gives the programmer atomic control over markdown parsing to html.

stonepresto 4 Aug 13, 2022
An automated scanning, enumeration, and note taking tool for pentesters

EV1L J3ST3R An automated scanning, enumeration, and note taking tool Created by S1n1st3r Meant to help easily go through Hack The Box machine and TryH

14 Oct 02, 2022
An interactive, terminal-based markdown presenter

lookatme lookatme is an interactive, extensible, terminal-based markdown presentation tool. TOC TOC Features Tour Navigating the Presentation CLI Opti

James Johnson 1.4k Jan 01, 2023
A markdown template manager for writing API docs in python.

DocsGen-py A markdown template manager for writing API docs in python. Contents Usage API Reference Usage You can install the latest commit of this re

Ethan Evans 1 May 10, 2022
Notedown - Markdown <=> IPython Notebook

Python 2/3 and IPython 4 / Jupyter compatible! Convert IPython Notebooks to markdown (and back) notedown is a simple tool to create IPython notebooks

Aaron O'Leary 840 Jan 04, 2023
A Discord Bot for rendering Markdown

Markdown to PDF Bot A discord bot that accepts markdown files (or messages) and displays them as images. Prerequisite To install, you must have have :

1 Oct 21, 2021
A automated python script that creates mark-down files to read for the aes keys and other useful information.

Archive A automated python script that creates mark-down files to read for the aes keys and other useful information. Table of Contents Benbot Automat

Tector 13 Dec 14, 2022
Remarkable Markdown Debian Package Fix

Remarkable debian package fix For some reason the Debian package for remarkable markdown editor has not been made to install properly on Ubuntu 20.04

Eric Seifert 37 Jan 02, 2023
😸Awsome markdown readme for your profile or your portfolio

GitHub Profile Readme Description That's a simple and minimalist README.md for your profile Usage You can download or copy to your repository and make

0 Jul 24, 2022
Toci is a markdown tool to generate an outline from a given Jupyter notebook.

Toci is a markdown tool to generate an outline from a given Jupyter notebook. It traverses the markdown cells of a given ipynb file to form a toc for you.

Hakan Özler 7 Jan 22, 2022
A super simple script which uses the GitHub API to convert your markdown files to GitHub styled HTML site.

A super simple script which uses the GitHub API to convert your markdown files to GitHub styled HTML site.

Çalgan Aygün 213 Dec 22, 2022
A Python library to retrieve annotations and notes from Zotero and save them into Markdown files.

Zotero to Markdown Generate Markdown files from Zotero annotations and notes. With new Zotero PDF Reader, all highlights are saved in the Zotero datab

Essi Alizadeh 20 Nov 03, 2022
Convert mind maps to markdown for import into Roam.

Mind Map to Markdown for Roam import Got a Mind Map with contents you'd like to import into Roam? Soon, this Python application might do what just you

Romilly Cocking 3 Dec 09, 2021
A command line tool that can convert Day One data into markdown files.

Introduction Features Before Start Export data from Day One Check Integrity Special Cases for Photo Extension Name Audio Extension Name Usage Known Is

gyro永不抽风 26 Dec 31, 2022
A fast, extensible and spec-compliant Markdown parser in pure Python.

mistletoe mistletoe is a Markdown parser in pure Python, designed to be fast, spec-compliant and fully customizable. Apart from being the fastest Comm

Mi Yu 546 Jan 01, 2023
Preview GitHub README.md files locally before committing them.

Grip -- GitHub Readme Instant Preview Render local readme files before sending off to GitHub. Grip is a command-line server application written in Pyt

Joe Esposito 5.9k Jan 08, 2023
Lightweight Markdown dialect for Python desktop apps

Litemark is a lightweight Markdown dialect originally created to be the markup language for the Codegame Platform project. When you run litemark from the command line interface without any arguments,

10 Apr 23, 2022