The QGIS Training Manual, at section 1.2.3, says:

"Having created your localised dataset, the final step is to replace the tokens in the conf.py file so that the appropriate names will appear in your localised version of the Training Manual."

Where and what is the conf.py file? I used "Finder" but it does not appear to be on this computer.

I am using QGIS 2.12 on Macbook Pro which runs on Mac OS X Yosemite 10.10.5.

  • The QGIS Training Manual, by the way, seems to be written with QGIS version 2.2 in mind, and I am using QGIS 2.12. Perhaps in version 2.12, the need for "conf.py" files has been eliminated or automated. Could that be the case?
    – Catlike
    Nov 1 '15 at 16:27

The conf.py is in the source code of QGIS-Documentation:


The general idea is for people to create their own localized version of the trainning manual.

Changing the conf.py and following the README.rst file instructions for compiling the Documents, will build a new PDF with the changes.


First off, sincere thanks to whoever created the training manual (and the gentle intro). Very much appreciated. (below is a minor issue....)

I too can't find conf.py on a Windows install, nor is there any documentation that I can find how to create one, what the syntax is, or where to place it? I see there is a config.py (not just conf.py) deep in the system that contains quite a bit of script.

I'm new to QGIS and to python so I don't know exactly what they mean by "tokens". I understand four tokens are reported needed in the training. (more below. Its easy to search on those words in the Training PDF).

Looks to me like the PDF may have a typo? conf.py should have been config.py? If so it still needs syntax info and where to place the new, modified config.py file. Is there a hierarchy of reading various config.py files? Do you put the "user modifed" config.py file near the QGIS project file so you don't mess up other python based programs on the system? None python experts would like to know...

At any rate, here are the 4 "tokens" mentioned in the PDF and the default values for the shipped sample files.

  • majorUrbanName "Swellendam"
  • largeLandUseArea "Bontebok National Park"
  • srtmFileName srtm_41_19.tif [not sure if these need " ?]
  • localCRS WGS 84 / UTM 34S

I'm only up to Ch 5 so I've only encountered one "token" so far.

  • "name" = ’ |majorUrbanName| ’

Minor issue - the apostrophe is "irregular" in the PDF - so replaced those ’ with the standard straight down (ASCII) '.

In the above "majorUrbanName" is set off in pipes and is assumed to be a "token" somehow set up in the conf.py file? Initially (not having read the intro material on using a custom data training set) I speculated the pipes stood for a some type of enumerated list, way off the mark.

If you are following the default data set, vs using your own custom one, its easy to just perform your own manual "token substitution" on the PDF tutorial side. Just convert the PDF to read:

  • "name" = "Swellendam"

Enter that into the expression editor and the tutorial works fine. I assume this will also work going forward after ch 5.

BTW - I have no ideal if double quotes (") are different from single ones (') in QGIS / Python so it would be great to cover that in the docs. Also, I'm feeling a bit "naked" in terms of understanding the nuances of the expression editor itself and how that may differ from other, traditional RDBMS / SQL syntax? Hopefully covered in a future chapter, or in the User Manual. Very appreciative of the Test function! Perhaps a very brief python syntax as it relates to QGIS up front would be helpful (especially as it relates to token substitution, single and double quotes, capitalization, use in the expression editor, etc.)

Speculating there was perhaps supposed to be a config.py file shipped with the sample data? However no reference in the README of it, or where it would need to be moved to to enable it to be read properly on startup.

Or... perhaps all this "token" substitution was to occur in producing a customized PDF for students?

  • 2
    Is this an answer? It looks like a series of questions. Jan 22 '16 at 15:10
  • Its a workaround, so yes, for now its a viable answer.
    – rjlabs
    Jan 22 '16 at 15:48
  • You have lots of '?' question marks in the answer, if you have a question please ask as a new question.
    – Mapperz
    Jan 22 '16 at 16:21
  • Thanks very much for encouraging questions. I'm totally new to QGIS and Python. Is this the appropriate place for QGIS Q&A?, Python Q&A? I'm embarrassed I don't know what specific RDBMS QGIS uses at its base, does this forum support those questions too? Or are there other, more focused for questions (QGIS, Python, RDBMS
    – rjlabs
    Jan 22 '16 at 16:54
  • (just learned the 5 min rule - scratch the above) Thanks very much for encouraging questions. I'm so new I don't even know where to ask different types of questions. I just stumbled on this forum based on a search for conf.py Is this the right / best forum for 1. QGIS questions 2. Python questions 3. RDBMS / attribute tables questions in QGIS (3.a is PostGIS / PostgreSQL the native database? 3.b If so do I ask those questions in a PostGIS / PostgreSQL forum? 3.c if PostGIS/ProgreSQL is the native database where can I go to learn the nuances of Expression String Builder in QGIS)
    – rjlabs
    Jan 22 '16 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.