Consider the diagram , where weight of the door acts along negative y-axis.
A force can produce torque only a direction normal to itself as `tau=rxxF` so when the door is in the xy -plane the torque by gravity can only be along `+-` z direction never about an axis passing through y- direction .
Hence , the weight will not produce any torque about y-axis.