Although it took years for the so-called "Hays Code" to be finalized, the Code did set certain standards for movies from the very beginning, including a ban on any reference to drug use.
Although it took time to implement, the Hays Code initially set rules for movies, including a prohibition against mentioning drugs.