input: Write a function to create a task management application with a Python Flask backend and a React frontend. The application should allow users to create a list of tasks. The backend should handle task creation via an API endpoint, and the frontend should display the list of tasks. If the title is not provided during task creation, the API should return a 400 error with a message. If the title is provided, the task should be added to the database and returned as a JSON response. The frontend should fetch tasks from the backend and display them with checkboxes indicating task completion status.
  
  def create_task_management_application():
    # Python Backend
    from flask import Flask, request, jsonify
    from flask_sqlalchemy import SQLAlchemy
  
    app = Flask(__name__)
    db = SQLAlchemy(app)
  
    class Task(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String(80), unique=True, nullable=False)
      is_completed = db.Column(db.Boolean, default=False)
  
      def serialize(self):
        return {'id': self.id, 'title': self.title, 'is_completed': self.is_completed}
  
    @app.route('/tasks', methods=['POST'])
    def create_task():
      request_data = request.get_json()
      title = request_data.get('title')
      if not title:
        return jsonify({'error': 'Title must be provided.'}), 400
  
      task = Task(title=title)
      db.session.add(task)
      db.session.commit()
  
      return jsonify(task.serialize())
  
    # React Frontend
    import React, { useState, useEffect } from 'react'
    import axios from 'axios'
  
    export const TaskList = () => {
      const [tasks, setTasks] = useState([])
  
      useEffect(() => {
        getTasks()
      }, [])
  
      const getTasks = async () => {
        const response = await axios.get('http://localhost:3000/tasks')
        setTasks(response.data)
      }
  
      return (
        <div>
          {tasks.map(task => (
            <div key={task.id}>
              <input type="checkbox" checked={task.is_completed} />
              <label>{task.title}</label>
            </div>
          ))}
        </div>
      )
    }
  
    return app
  
  assert create_task_management_application().endpoint('/tasks', methods=['POST'])(None)=='{\n  "error": "Title must be provided."\n}\n'
output: 
  def create_task_management_application():
    from flask import Flask, request, jsonify
    from flask_sqlalchemy import SQLAlchemy
  
    app = Flask(__name__)
    db = SQLAlchemy(app)
  
    class Task(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String(80), unique=True, nullable=False)
      is_completed = db.Column(db.Boolean, default=False)
  
      def serialize(self):
        return {'id': self.id, 'title': self.title, 'is_completed': self.is_completed}
  
    @app.route('/tasks', methods=['POST'])
    def create_task():
      request_data = request.get_json()
      title = request_data.get('title')
      if not title:
        return jsonify({'error': 'Title must be provided.'}), 400
  
      task = Task(title=title)
      db.session.add(task)
      db.session.commit()
  
      return jsonify(task.serialize())
  
    return app
  