Skip to content

Simple HTTP Server made with Python. It has a custom HTTPRequestHandler, user authentication, custom cookies and much more.

License

Notifications You must be signed in to change notification settings

andreaaazo/http-server-python

Repository files navigation

Contributors Forks Stargazers Issues MIT License


HTTP Server Python

A basic Python server so you don’t start from scratch

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

❔ About The Project

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:

Watch the video

(back to top)

Built With

Bootstrap

(back to top)

📥 Getting Started

Start from here, and set up your local project correctly.

Prerequisites

  • pipenv

    pip install --user pipenv
  • git

    with Homebrew package

    brew install git

Installation

Install correctly the project.

  1. Clone the repo

    git clone https://github.com/andreaaazo/http-server-python.git
  2. Open a terminal in the main folder, and start the env

    pipenv shell
  3. Start the server

    python main.py

(back to top)

🔨 Usage

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.

(back to top)

📍 Roadmap

  • 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).

(back to top)

🤝 Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

📝 License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

📞 Contact

Andrea Zorzi - @andreaaa.zo - zorzi.andrea@outlook.com

Project Link: https://github.com/andreaaazo/http-server-python

(back to top)

📑 Acknowledgments

A list of some useful Python libraries:

I suggest you to try to replicate this project from scratch, and add your custom features.

(back to top)

About

Simple HTTP Server made with Python. It has a custom HTTPRequestHandler, user authentication, custom cookies and much more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published