A fully functional, web-based command terminal application built with Python and the Django framework. This project provides a browser-based interface to execute common system commands securely on the server.
- Web-Based Interface: A clean, responsive terminal interface that runs directly in your browser.
- Command Execution: Supports a whitelist of common commands for file and directory operations:
ls
/dir
: List directory contents.cd
: Change directory.pwd
: Print working directory.mkdir
: Create a new directory.
- System Monitoring: Integrated with
psutil
to provide real-time system stats:cpu
: Displays current CPU usage.mem
: Displays current memory usage.
- Dynamic Prompt: The command prompt dynamically updates to show the current working directory, providing an intuitive user experience.
- Secure & Robust: Uses a command whitelist and Python's
os
module instead of direct shell execution to prevent security vulnerabilities. - Error Handling: Gracefully handles invalid or non-whitelisted commands with clear error messages.
- Backend: Python, Django
- System Interaction:
os
,psutil
libraries - Frontend: HTML, CSS, JavaScript (Fetch API)
- Communication: REST API with JSON
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.8 or higher
- pip (Python package installer)
-
Install project dependencies:
pip install django psutil
-
Apply database migrations: (This sets up the initial database required by Django.)
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Open the application: Open your web browser and navigate to
http://127.0.0.1:8000/
. You should now see the web terminal interface, ready to accept commands.