docs: Moved the Mopidy settings file
This commit is contained in:
parent
79b5942831
commit
9a09692e99
@ -7,11 +7,11 @@ Changing settings
|
||||
=================
|
||||
|
||||
For any Mopidy installation you will need to change at least a couple of
|
||||
settings. To do this, create a new file in the ``mopidy/settings/`` directory
|
||||
named ``local.py`` and add settings you need to change from their defaults
|
||||
settings. To do this, create a new file in the ``~/.mopidy/`` directory
|
||||
named ``settings.py`` and add settings you need to change from their defaults
|
||||
there.
|
||||
|
||||
A complete ``mopidy/settings/local.py`` may look like this::
|
||||
A complete ``~/.mopidy/settings.py`` may look like this::
|
||||
|
||||
MPD_SERVER_HOSTNAME = u'0.0.0.0'
|
||||
SPOTIFY_USERNAME = u'alice'
|
||||
|
||||
@ -55,7 +55,7 @@ And on OS X, assuming you allready got git installed, e.g. from Homebrew::
|
||||
Spotify settings
|
||||
================
|
||||
|
||||
Create a file named ``local.py`` in the directory ``mopidy/settings/``. Enter
|
||||
Create a file named ``settings.py`` in the directory ``~/.mopidy/``. Enter
|
||||
your Spotify Premium account's username and password into the file, like this::
|
||||
|
||||
SPOTIFY_USERNAME = u'myusername'
|
||||
@ -68,7 +68,7 @@ Switching backend
|
||||
Currently the despotify backend is the default. If you want to use the
|
||||
libspotify backend instead, copy the Spotify application key to
|
||||
``mopidy/spotify_appkey.key``, and add the following to
|
||||
``mopidy/mopidy/settings/local.py``::
|
||||
``~/.mopidy/settings.py``::
|
||||
|
||||
BACKENDS = (u'mopidy.backends.libspotify.LibspotifyBackend',)
|
||||
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
from mopidy.settings.default import *
|
||||
import os
|
||||
|
||||
try:
|
||||
from mopidy.settings.local import *
|
||||
except ImportError:
|
||||
pass
|
||||
from mopidy.settings.default import *
|
||||
from mopidy.utils import get_or_create_dotdir
|
||||
|
||||
dotdir = get_or_create_dotdir()
|
||||
settings_file = os.path.join(dotdir, u'settings.py')
|
||||
if not os.path.isfile(settings_file):
|
||||
logger.warning(u'Settings not found: %s', settings_file)
|
||||
else:
|
||||
sys.path.insert(0, dotdir)
|
||||
from settings import *
|
||||
|
||||
@ -4,7 +4,7 @@ Available settings and their default values.
|
||||
.. warning::
|
||||
|
||||
Do *not* change settings in ``mopidy/settings/default.py``. Instead, add a
|
||||
file called ``mopidy/settings/local.py`` and redefine settings there.
|
||||
file called ``~/.mopidy/settings.py`` and redefine settings there.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
Loading…
Reference in New Issue
Block a user