Question: Python Package Paths :: Finding Directories that Should Be .py Files


Python Package Paths :: Finding Directories that Should Be .py Files

Answers 1
Added at 2016-12-29 05:12

As I work through the Django tutorials, I like to see with my own eyes the module and class/attribute that I am inheriting via import by going to the source code at Github.

However, and I have attached pics to illustrate that I (think) I went to the right place, but the files seem to be missing.

  1. For example, in Django tutorial Part 1:

from django.conf.urls import include, url

So I go to Github django code and I find:


What I find is that urls is a directory with only files :, and

There is no file which might have url() or include() methods.

Same with models.Models.

  1. from django.db import models

On django Github site I follow the directories...

django/django/db/models  models is a directory, not a file with a class Model()

So, what am I missing here?

Looking forward to a few bread crumbs :)

nr: #1 dodano: 2016-12-29 06:12

If you're looking for the source of module, it can be one of the two:

  • foo/
  • foo/bar/

Also note that often upper-level modules re-export selected names imported from deeper-down modules: a name may be merely imported, not otherwise defined; e.g. django.db does a lot of this.

Source Show
◀ Wstecz