All Projects → digolds → digwebs

digolds / digwebs

Licence: MIT license
A tiny Python web framework that power the web app

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to digwebs

Clog
CLOG - The Common Lisp Omnificent GUI
Stars: ✭ 181 (+1031.25%)
Mutual labels:  webframework
godzilla
a powerful go web framework
Stars: ✭ 22 (+37.5%)
Mutual labels:  webframework
sgo
A simple, light and fast Web framework written in Go.
Stars: ✭ 75 (+368.75%)
Mutual labels:  webframework
Golf
⛳️ The Golf web framework
Stars: ✭ 248 (+1450%)
Mutual labels:  webframework
nim-servy
Servy is a fast, simple and lightweight micro web-framework for Nim
Stars: ✭ 30 (+87.5%)
Mutual labels:  webframework
firmeve
a out-of-the-box, full-featured go framework supporting http, http2, websocket, tcp, udp, rpc and microservice
Stars: ✭ 36 (+125%)
Mutual labels:  webframework
Alpas
🚀 The Rapid and Delightful Kotlin Web Framework. Easy, elegant, and productive!
Stars: ✭ 166 (+937.5%)
Mutual labels:  webframework
faces
Jakarta Faces
Stars: ✭ 44 (+175%)
Mutual labels:  webframework
tsukuyomi
Asynchronous Web framework for Rust
Stars: ✭ 81 (+406.25%)
Mutual labels:  webframework
Teapot
Teapot micro web framework for Pharo Smalltalk
Stars: ✭ 86 (+437.5%)
Mutual labels:  webframework
GCMS
PHP FASTEST CMS with Ajax support
Stars: ✭ 19 (+18.75%)
Mutual labels:  webframework
webfr
moved to: https://github.com/godzillaframework/godzilla.git
Stars: ✭ 13 (-18.75%)
Mutual labels:  webframework
sitefox
Node + cljs backend web framework
Stars: ✭ 180 (+1025%)
Mutual labels:  webframework
Frappejs
Node + Electron + Vue based metadata web framework (inspired by Frappe)
Stars: ✭ 214 (+1237.5%)
Mutual labels:  webframework
fly
Lightweight Python Web framework
Stars: ✭ 17 (+6.25%)
Mutual labels:  webframework
Closp
Clojure template for web development (with SPA support)
Stars: ✭ 173 (+981.25%)
Mutual labels:  webframework
presley
Presley - A lightweight web framework for Windows
Stars: ✭ 26 (+62.5%)
Mutual labels:  webframework
elton
High performance, simple Go web framework
Stars: ✭ 61 (+281.25%)
Mutual labels:  webframework
waspy
WASP framework for Python
Stars: ✭ 43 (+168.75%)
Mutual labels:  webframework
flask-empty-api
AZAP Flask boilerplate for creating API's with flask.
Stars: ✭ 15 (-6.25%)
Mutual labels:  webframework

Digolds web framework

A tiny web framework called digwebs which is developed by Python. You can checkout the detail design of digwebs in www.digolds.cn. The following steps will guide you quickly build a web service using digwebs.

  • Install digwebs by pip
pip install digwebs
  • Create a web service project, for example, my project name is "hello-world"
digwebs hello-world

After succesfully create the project, cd to it, you will see the following contents:

|____favicon.ico
|____wsgiapp.py
|____test
|____middlewares
|____static
| |____css
| |____images
| |____js
| |____fonts
|____controllers
| |____main_controller.py
|____views
  • controllers is where you put controller script
  • middlewares is where you put middlewares script
  • static is where you put front end script such as css file, javascript file, font, image etc
  • test is where you put the test script for your web app
  • views is where you put the html file

The content in wsgiapp.py is shown below:

#!/usr/bin/env python

__author__ = 'SLZ'

'''
digwebs framework demo.
'''

import logging
logging.basicConfig(level=logging.INFO)

from digwebs.web import get_app
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
digwebs_app = get_app({'root_path':dir_path})
digwebs_app.init_all()
if __name__ == '__main__':
    digwebs_app.run(9999, host='0.0.0.0')
else:
    wsgi_app = digwebs_app.get_wsgi_application()

The content in main_controller.py is shown below:

#!/usr/bin/env python

__author__ = 'SLZ'

'''
digwebs framework controller.
'''

from digwebs.web import current_app

@current_app.get('/')
def hello_world():
    return """
<html>
    <style>
    html,body{
  height:100%;
  padding:0;
  margin:0;
}
*{
  box-sizing:border-box;
}

.container{
  
  width:100%;
  height:100%;
  
  display:flex;
  justify-content:center;
  align-items:center;
  
}
    </style>
    <body>
    <div class="container">
  <h1>digwebs - A Minimal Web Framework!</h1>
</div>
    </body></html>
"""
  • Run python wsgiapp.py, you can see the following output:
INFO:root:Add module: controllers.main_controller
INFO:root:Add route: Route(static,GET,path=/)
INFO:root:application (/Users/slz/dev/src/digwebs/hello-world) will start at 0.0.0.0:9999..
  • Open your browser and enter localhost:9999, you see the content "digwebs - A Minimal Web Framework!"

Note: if you want to learn more about digwebs, head over here.

Contribution

We are looking for contributors. Please check open issues in the above repos if you think you could help, or open a new one if you have an idea you'd like to discuss.

License

This project is licensed under the MIT open source license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].