Depression can cause you to gain weight. Just like you have indicated, depression keeps you from doing the things you usually do to keep yourself active, i.e exercising. Further, it also makes many people do things that are not healthy for your body i.e. over eat and being inactive. However, even though it is much more difficult for someone in your shoes to build up the motivation to go out and exercise it is essential for your physical and emotional health to stay active. The physical health can improve the emotional and mental health. Likewise, physical ailments can do the opposite to your emotional and mental health. These different facets of health are obviously interconnected, and the state of health is reflected in the balance of these three aspects.
Often, a visit to your PCP or psychiatrist
/psychologist for counseling is all that one needs. But sometimes, medications are needed and antidepressive medications can work very well. You'll have to consult with a PCP or psychiatrist who will determine the types you may need. In general antidepressants take 4-6 weeks to kick in so don't expect seeing any miraculous changes over-night. They all have different side effects so you'll have discuss this with your doctor
so that you don't get surprised. Again, please discuss this issue with your primary care doctor
or with a psychiatrist. Take care.