Yes, but with a small twist on what you are saying: Depression lies at the intersection of the external world and the internal. It's influenced both by it's contact with the external world and by the content of our thoughts.
It can be caused both by external factors and our internal mental life.