A basic Python server so you don’t start from scratch
View Demo
·
Report Bug
·
Request Feature
Table of Contents
The simplicity of this project makes it perfect for beginners, and for those who want to learn the basics of an HTTP server.
This is a basic HTTP Server with a HTTP Request Handler, and some features:
- Cookies
- Retrieve CGI Forms
- User authentication
- Custom Database
- Build-in home, authentication, registration and 404 error HTML pages (with Bootstrap)
Start with this server, and build yours more faster!.
You can find the full creation of the project on YouTube:
Start from here, and set up your local project correctly.
-
pipenv
pip install --user pipenv
-
git
with Homebrew package
brew install git
Install correctly the project.
-
Clone the repo
git clone https://github.com/andreaaazo/http-server-python.git
-
Open a terminal in the main folder, and start the env
pipenv shell
-
Start the server
python main.py
This is a Python Request Handler and Server.
Initially, the website is presented with an introductory page, where you can choose to register or access a profile already registered. Once you have successfully logged in, the server will redirect you to a user page, where will be shown 3 tests that you can take. Below you can find the grade assigned to the test and the number of questions answered correctly.
The server works through cookies, which allow you to keep the session active. So even if you open a new window on your browser and want to access your account, the server will log in automatically, without having to re-enter your credentials in a totally reactive way.
To facilitate the proper execution of the code I took the liberty of adding a virtual python environment.
- Finish Project
- Refine code
- Modify cookies auth to avoid cookies injections
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Andrea Zorzi - @andreaaa.zo - zorzi.andrea@outlook.com
Project Link: https://github.com/andreaaazo/http-server-python
A list of some useful Python libraries:
I suggest you to try to replicate this project from scratch, and add your custom features.