Skip to content

Enhance the twisted static file server with customised contents and html page.

Notifications You must be signed in to change notification settings

cuyu/twisted-customise-file-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twisted-customise-file-server

Enhance the twisted static file server with customised contents (e.g. add content of file create time) and html page (e.g. use bootstrap in the web page).

Here is an example of web integrated with bootstrap and also added a column for the file's created time:

Example sceenshot

Implenmented

  • Can render html file outside instead of using python string
  • The outside html file can import local static files (css, js .etc)

How to use

Start web server in python code

from customise_server import CustomiseServer

if __name__ == '__main__':
    server = CustomiseServer('/tmp')
    server.run()

This will block the main process until you stop the web server.

Start web server by cmdline

Settings

I move the hard coded variables to the settings.py file. Just look at this file and change the content if necessary.

TODO List

  • Can easily choose what contents are displayed in the table of the web (e.g. only display file name and its created time)
  • A simple cmdline to start a static file server

About

Enhance the twisted static file server with customised contents and html page.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published