Heroku worked great for us, although it became pricy as soon as traffic picked up. Before long we needed more control over autoscaling and health checks, as our sizeable machine learning models took a while to load. That, coupled with the desire to break our monolith up into smaller microservices, led to us migrating to Google Cloud Platform, specifically Google Kubernetes Engine. Coming from Heroku, this was a huge step, so be advised you only want to do this if you have enough staff with the right expertise. Heroku may become pricy, just remember to compare this with fulltime engineering salaries.

Lukas Batteau
Since the course is in Python, a Python web framework seems like a logical choice. Django is a good option, but Flask and FastAPI are far more lightweight than Django, and great for quickly adding an API on top of your ML/NLP code. Django has its merits, especially the generated admin interface, but requires a lot of boilerplate code.
If you want framework-agnostic code, Django is really not the right framework for you. Its large ORM layer, heavy use of middleware, and reliance on class inheritance, will make migrating to another framework very painful. For more freedom and control I would recommend Flask, or even better FastAPI.
At the same time, it seems DDD has nothing to do with using other libraries or not.
Either way, whatever framework you choose, remember the golden rule: Don’t Fight The Framework.