Preheat oven to 160C/Gas 3.
1) In a medium saucepan, melt the butter over medium heat. Add the onions and saute until lightly browned.
2) Put the pie pan on a baking tray. Line the bottom of pie crust with the onions.
3) In a small bowl, beat the eggs and the flour together to combine. Add the milk, sour cream and salt. Mix well and pour over the onions. Garnish with the bacon and bake until firm in the centre, about 30 minutes. Transfer to a serving platter and serve.