Are "Field" and "Fields" reserved words in Django or Python?
Question: I'm developing a django project for agriculture. I want to name an app
"fields" and inside the app "fields" I want to name a model "Field" (referring
to a farmer field).

I tried it and it works, so I assume that "fields" and "Field" are not
reserved words in Django or Python. But I was just wondering if using these
words can be problematic in the future or it's just fine?

And the general question: **Is there any way to check if a word is reserved in
Django or Python?**


Answer: Strictly speaking, "reserved word" is the wrong term here. Reserved words are
properties of a programming language, and Django is not a language.

There is a class called `Field` in Django in the `django.db.models.fields`
package, and another (similar but different) class with the same name in the
`django.forms.fields` package.

However, these `Field` classes are so low level classes that it's unlikely
that you will ever need to import them, so they won't interfere with your own
`Field` class.

In any case, and as you can see, within Django itself the same class can exist
in multiple packages with the same name. It's fine, because the package name
serves as a namespace, so you can always fully qualify a class by using its
complete package name.

Another useful thing in Python is importing classes with a different name:

    
    
    from django.db.models.fields import Field as DjangoField
    help(DjangoField)
    

Similarly, importing packages with a different name:

    
    
    from django.db.models import fields as djangofields
    help(djangofields.Field)
    

This way you can always avoid collisions in class and package names.

