English 中文(简体)
Python Pyramid - Cookiecutter
  • 时间:2024-12-22

Python Pyramid - Cookiecutter


Previous Page Next Page  

We have so far built the Pyramid apppcation by manually performing the route configuration, adding the views and using the templates. Cookiecutter offers a convenient alternative to generate a Pyramid project structure. It is a command-pne utipty that uses certain predefined project templates. The project can then be fine-tuned to accommodate specific requirements that the user may have.

The Python project created by Cookiecutter is a Python package. The default apppcation logic can be further customized. The project structure so created is extremely extensible and is easy to distribute.

The Cookiecutter utipty is developed by Audrey Feldroy. It works on Python versions >=3.7. The project templates in Python, JavaScript, Ruby, CoffeeScript, languages or RST, Markdown, CSS, HTML scripts can be used to generate a project. Github hosts a number of pre-built project templates, any of which can be used.

The project built from cookiecutter template is a cross-platform package. Cookiecutter project generation is completely automated and you don t have to write any code for it. Once the cookiecutter command is invoked, it reads the template being used and prompts the user to choose appropriate values for the settings parameters. To begin with, install Cookiecutter with PIP installer.


pip install cookiecutter

To verify if Cookiecutter is correctly installed, run


>>> import cookiecutter
>>> cookiecutter.__version__
 1.7.3 
Advertisements