Serving files in current directory using Python http module

When developing backend in Python sometimes we need to easily share files on our development server. Let say we want your collegue to download some file.

Here is a standard python module http we can use for this purpose. To share files in current directory simply run this command

python3 -m http.server

Here I will show listing of my Django project. Output:

Serving HTTP on 0.0.0.0 port 8000 ...

Open browser on 0.0.0.0:8000

That’s it. Very simple.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Subgraph Evaluation: the new life of curators

2D Mobile Game: Enemy Class Setup

Kivy: Create a Separate .py File for Each Class

Software for the Connect World — Atlassian’s JIRA Changes the Game

Comprehensive Architecture of Serverless REST Services for Scale on AWS

Popper Tutorial 2/3

Current project structure. R packages are included now.

Suncoast Developers Guild: Week 13

Choosing the Right Service Level Indicators (SLI)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Privalov Vladimir

Privalov Vladimir

More from Medium

Powershell Scripting Guide to Python

Intro to Python SSH Client Paramiko

Send files to slack from python

Regex Matching URL