Let's create a graph with source($$$S$$$), sink($$$T$$$), vertices representing vertices of the original graph($$$v$$$), and vertices representing edges of the original graph($$$e_{uv}$$$). Let's connect $$$S$$$ with every vertex $$$e_{uv}$$$ with an edge of capacity $$$1$$$, connect $$$e_{uv}$$$ with $$$u$$$ and $$$v$$$ with edges of capacity $$$1$$$, and finally connect $$$v$$$ with $$$T$$$ with an edge of capacity $$$d_v$$$. Claim is that now we need to check that maxflow in this network equals to the number of edges.
The trick with these vertices representing edges works in a way that one unit of liquid which came to $$$e_{uv}$$$ goes to either $$$u$$$ or $$$v$$$ (because in a network with integer capacities there's a maxflow with integer flows through each edge), so that's how we pick an orientation of an edge. Edges to sink with capacities $$$d_v$$$ guarantee that every out degree does not exceed $$$d_v$$$, so, to check that we succesfully oriented all edges, we may check that maxflow in this network equals to the number of edges.