Understanding python imports

后端 未结 3 1740
有刺的猬
有刺的猬 2021-01-06 21:10

In the process of learning Django and Python. I can\'t make sense of this.

(Example Notes:\'helloworld\' is the name of my project. It has 1 app called \'app\'.)

3条回答
  •  抹茶落季
    2021-01-06 22:10

    As sykora alluded, helloworld is not in-and-of-itself a package, so #2 won't work. You would need a helloworld.py, appropriately set up.

    I asked about import a couple of days ago, this might help: Lay out import pathing in Python, straight and simple?

提交回复
热议问题