Hearts will visit nearby Livingston in Scottish Challenge Cup round two.
The winner of Rangers' home first-round tie against Hibernian will host Clyde while Falkirk will visit either Dunfermline or Raith Rovers.
Brora Rangers, who stunned Stenhousemuir in round one, will entertain East Fife.
Peterhead visit Brechin City, Stirling Albion host Alloa Athletic, Berwick Rangers are Morton's visitors and Stranraer welcome Albion Rovers.
The ties will be played on the evenings of Tuesday 19 and Wednesday 20 August.
Rangers' first-round tie had been postponed due to Ibrox Stadium's use as a Commonwealth Games while Dunfermline v Raith Rovers was postponed due to a waterlogged pitch.
Petrofac Training Challenge Cup second round
Dunfermline Athletic or Raith Rovers v Falkirk
Brora Rangers v East Fife
Brechin City v Peterhead
Stirling Albion v Alloa Athletic
Livingston v Heart of Midlothian
Rangers or Hibernian v Clyde
Morton v Berwick Rangers
Stranraer v Albion Rovers