title: How to change a Kivy App's configuration file default directory?
body: <p>I am trying to change the directory where my Kivy App's <code>'%(appname)s.ini'</code> file is saved.</p>
  
  <p>I can get the current directory with <code>get_application_config()</code>, but even if I change the <code>defaultpath</code> attribute nothing happens.  I also tried to set the <code>'KIVY_HOME'</code> environment variable but I must be doing something wrong.</p>
  
  <h3>Code</h3>
  
  <pre><code>#These are the three methods I tried
  #Method 1 change KIVY_HOME environment at beginning before importing App class
  import kivy
  import os, plyer
  con_change = plyer.storagepath.get_documents_dir()
  os.environ['KIVY_HOME'] = con_change + '/'
  
  #Method 2 change KIVY_HOME environment within App class
  import kivy
  import os, plyer
  from kivy.app import App
  from kivy.properties import ConfigParserProperty
  
  class LoginApp(App):
      title = 'Login'
      us_er = ConfigParserProperty('', 
                      'mylog', 'uname', 'app')
      p_wd = ConfigParserProperty('', 
                      'mylog', 'pwd', 'app')
      con_change = plyer.storagepath.get_documents_dir()
      def build(self):
          self.config.export KIVY_HOME = self.con_change + '/%(appname)s.ini' #gives invalid syntax
          up = self.config.items('mylog')
          return TheLogger()
      def build_config(self, config):
          config.setdefaults('mylog', {
              'uname': '',
              'pwd': ''})
  
  #Method 3 try to set defaultpath with get_application_path function
  import kivy
  import os, plyer
  from kivy.app import App
  
  class LoginApp(App):
      title = 'Login'
      us_er = ConfigParserProperty('', 
                      'mylog', 'uname', 'app')
      p_wd = ConfigParserProperty('', 
                      'mylog', 'pwd', 'app')
      con_change = plyer.storagepath.get_documents_dir()
      def build(self):
          self.get_application_config(defaultpath= self.con_change + '/%(appname)s.ini')
  
          up = self.config.items('mylog')
          return TheLogger()
      def build_config(self, config):
          config.setdefaults('mylog', {
              'uname': '',
              'pwd': ''})
  </code></pre>
  
  <p>I want to be able to set the directory for the <code>'%(appname)s.ini'</code> file outside the <code>'KIVY_HOME'</code> directory tree?</p>