I want to automatically read and write settings of my QGIS-project with Pyqgis. Especially i want to do this for the QGIS Server Service Properties (Top of QGIS-Server Tab).

I found this Link but i cant solve my problem with it...

I also found this thread, but i want more Variables and i cant find the names of them. Someone have a full list?


1 Answer 1


I found a very simple solution:

The variables are stored in the Project-File and i can see them, if its stored as .qgs. I will copy and paste them and set the variables with the following syntax:

settings = {
    'WMSServiceCapabilities': True,
    'WMSRootName': 'Testproject',
    'WMSServiceTitle': 'Tesproject',
    'WMSContactOrganization': 'Its me'

for setting in settings:
    QgsProject.instance().writeEntry(setting , "/" , settings[setting])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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