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
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
A Straightforward Markdown Journal

Introducing Pepys: A straightforward markdown journal "It is rightly made for those who love to document their daily life events" - FOSSBytes Pepys is

Luke Briggs 23 Nov 12, 2022
A Python implementation of John Gruber’s Markdown with Extension support.

Python-Markdown This is a Python implementation of John Gruber's Markdown. It is almost completely compliant with the reference implementation, though

Python-Markdown 3.1k Dec 31, 2022
A lightweight and fast-to-use Markdown document generator based on Python

A lightweight and fast-to-use Markdown document generator based on Python

快乐的老鼠宝宝 1 Jan 10, 2022
Pure-python-server - A blogging platform written in pure python for developer to share their coding knowledge

Pure Python web server - PyProject A blogging platform written in pure python (n

Srikar Koushik Satya Viswanadha 10 Nov 07, 2022
Static site generator that supports Markdown and reST syntax. Powered by Python.

Pelican Pelican is a static site generator, written in Python. Write content in reStructuredText or Markdown using your editor of choice Includes a si

Pelican dev team 11.3k Jan 05, 2023
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
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 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
A markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML

LeidenMark $ pip install leidenmark A Python Markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML. Inspired by the Brill plain te

André van Delft 2 Aug 04, 2021
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
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
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
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
A Python implementation of John Gruber’s Markdown with Extension support.

Python-Markdown This is a Python implementation of John Gruber's Markdown. It is almost completely compliant with the reference implementation, though

Python-Markdown 3.1k Dec 30, 2022
Extensions for Python Markdown

PyMdown Extensions Extensions for Python Markdown. Documentation Extension documentation is found here: https://facelessuser.github.io/pymdown-extensi

Isaac Muse 685 Jan 01, 2023
Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed. Now in Python!

markdown-it-py Markdown parser done right. Follows the CommonMark spec for baseline parsing Configurable syntax: you can add new rules and even replac

Executable Books 398 Dec 24, 2022
A markdown generation library for Python.

Welcome to SnakeMD SnakeMD is your ticket to generating Markdown in Python. To prove it to you, we've generated this entire README using SnakeMD. See

The Renegade Coder 22 Dec 08, 2022
Livemark is a static page generator that extends Markdown with interactive charts, tables, and more.

Livermark This software is in the early stages and is not well-tested Livemark is a static site generator that extends Markdown with interactive chart

Frictionless Data 86 Dec 25, 2022
Comprehensive Markdown plugin built for Django

Django MarkdownX Django MarkdownX is a comprehensive Markdown plugin built for Django, the renowned high-level Python web framework, with flexibility,

neutronX 740 Jan 08, 2023