Predefined template variables
PyCharm comes with a set of predefined template variables.
The available predefined file template variables are:
- ${PROJECT_NAME} - name of the current project.
- ${USER} - login name of the current user.
- ${NAME} - the name of the file that will be created.
- ${DATE} - the current system date.
- ${TIME} - the current system time.
- ${YEAR} - the current year.
- ${MONTH} - the current month.
- ${DAY} - the current day of the month.
- ${HOUR} - the current hour.
- ${MINUTE} - the current minute.
Custom template variables
In addition to the predefined template variables, it is possible to specify custom variables. If necessary, you can define the values of custom variables right in a template using the #set VTL directive.
For example, if you want to use your full name instead of login name, use the following construct:
#set( $MyName = "John Smith" )
If when applying a template, and the values of certain template variable are not known, PyCharm will ask you to specify those values.
