Example output
Creating a fully functional task management and collaboration tool requires a significant amount of code, and it's beyond the scope of a single response. However, I can provide you with a simplified example using Python and Flask for the backend, and HTML with JavaScript for the frontend. This example won't include real-time collaboration features due to its complexity, but you can later integrate tools like Socket.IO or Django Channels for that purpose.
Let's start with a basic setup using Flask:
1. **Install Flask:**
```bash
pip install flask
```
2. **Create a file named `app.py` for the backend:**
```python
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
tasks = []
@app.route('/')
def index():
return render_template('index.html', tasks=tasks)
@app.route('/add_task', methods=['POST'])
def add_task():
task = request.form.get('task')
if task:
tasks.append(task)
return redirect(url_for('index'))
@app.route('/delete_task/<int:task_id>')
def delete_task(task_id):
if 0 <= task_id < len(tasks):
del tasks[task_id]
return redirect(url_for('index'))
if __name__ == '__main__':
app.run(debug=True)
```
3. **Create a `templates` folder in the same directory as `app.py` and add `index.html`:**
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task Manager</title>
</head>
<body>
<h1>Task Manager</h1>
<ul>
{% for task in tasks %}
<li>{{ task }} <a href="{{ url_for('delete_task', task_id=loop.index-1) }}">Delete</a></li>
{% endfor %}
</ul>
<form action="{{ url_for('add_task') }}" method="post">
<label for="task">New Task:</label>
<input type="text" id="task" name="task" required>
<button type="submit">Add Task</button>
</form>
</body>
</html>
```
4. **Run the application:**
```bash
python app.py
```
Visit `http://127.0.0.1:5000/` in your web browser to access the task management tool. You can add and delete tasks.
For real-time collaboration, you would need to integrate technologies like WebSockets. Flask-SocketIO is a popular choice for Flask applications. This would involve more complex server-side and client-side code. If you decide to pursue real-time collaboration, consider looking into Flask-SocketIO or similar libraries.