The cause of diabetes may be related to heredity, and may also be related to autoimmunity. In addition, environmental factors may also be involved in the onset of some diabetes. The main types of diabetes are type I, type II, special type, and gestational diabetes. Generally, type I is mainly due to autoimmunity. Type II has both genetic factors and environmental factors. There are many special types of diabetes, some of which are caused by gene mutation. Other endocrine diseases, even exocrine diseases of the pancreas, may also lead to diabetes. Gestational diabetes is caused by the hormone secreted by the placenta against insulin during pregnancy.