To solve this optimization problem, we first need to define the decision variables, the objective function, and the constraints.

Let's denote:
- \(x\) as the number of bags of Drummondville blend produced.
- \(y\) as the number of bags of Victoriaville blend produced.

The profit from each bag of Drummondville sold is $5, and from each bag of Victoriaville is $7. Thus, the total profit can be represented by the objective function:
\[ \text{Maximize:} \quad 5x + 7y \]

Given that a bag of Drummondville contains 600 grams of arabica beans and a bag of Victoriaville contains 375 grams of arabica beans, and considering the total available stock of arabica beans is 24,000 grams, we have the constraint:
\[ 600x + 375y \leq 24000 \]

Similarly, for robusta beans, with 400 grams in each bag of Drummondville and 625 grams in each bag of Victoriaville, and a total available stock of 17,000 grams, we have:
\[ 400x + 625y \leq 17000 \]

Additionally, \(x\) and \(y\) must be non-negative since they represent the number of bags.

Now, let's formulate this problem in Gurobi Python code:

```python
from gurobipy import *

# Create a new model
m = Model("Coffee_Blend_Optimization")

# Decision variables
x = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="Drummondville_Bags")
y = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="Victoriaville_Bags")

# Objective function: Maximize profit
m.setObjective(5*x + 7*y, GRB.MAXIMIZE)

# Constraint 1: Arabica beans limit
m.addConstr(600*x + 375*y <= 24000, "Arabica_Limit")

# Constraint 2: Robusta beans limit
m.addConstr(400*x + 625*y <= 17000, "Robusta_Limit")

# Optimize the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print(f"Optimal solution found:")
    print(f"Drummondville bags: {x.x}")
    print(f"Victoriaville bags: {y.x}")
    print(f"Maximum profit: ${5*x.x + 7*y.x:.2f}")
else:
    print("No optimal solution found.")
```