Use the full model line
When this happens, I usually resort to what is called the full category of the model, a fancy term for what is important is a line representing the model and containing the application in the format 'app_label.ModelName'
eg. if your model is Order , then the name of the model string will be the string 'Order'
So you can already do:
order = models.ForeignKey('Order', on_delete=models.CASCADE)
With the above, Django will search for the 'Order' model in the same application. This is normal if you have not defined it yet, if it is defined.
If this model comes from another application, it will be:
order = models.ForeignKey('appname.Order', on_delete=models.CASCADE)
Constant feedback requests
Since Order points to OrderItems and OrderItems points to Order , you are faced with related queries that Django generates for you. You can disable them with related_name='+' :
order = models.ForeignKey('Order', on_delete=models.CASCADE, related_name='+')
Best modeling
Since a OrderedItem already "belongs" to Order , there is no point in having a ForeignKey from Order to OrderedItem , you can simply remove it, instead of dealing with the above collision.
So you would have looked like this
Item Order OrderedItem + FK(Item) + FK(Order)
A design that would not include a reference to a model that is not yet defined :)