#### This Page

# `lektor.environment.``Environment`

This class holds all the relevant information for building a Lektor Project. It can be reused between builds and only holds state that is immutable after initialization. For instance it will hold all loaded plugins, the configuration for the Jinja 2 template engine and more.

Plugins have access to the environment at any point by accessing `self.env`.

## Example

    from lektor.project import Project

    project = Project.discover()
    env = project.make_env()

#### add_build_program()

Registers a build program for a source object.

#### add_publisher()

Registers a publisher class with the environment.

#### add_type()

Adds a new field type to the environment.

#### generator()

Registers a custom generator function.

#### jinja_env

The configured Jinja 2 Environment.

#### load_config()

Loads the current config from the project file.

#### load_plugins()

Loads the available plugins for the environment.

#### new_pad()

Creates a brand new database pad.

#### render_template()

Renders a template from the template folder.

#### urlresolver()

Registers a custom URL resolver function.

#### virtualpathresolver()

Registers a virtual path resolver with the environment.

## Comments