--- layout: page title: Configuration settings --- # Configuration settings
You can control much of how FixMyStreet looks and behaves just by changing the config settings.
## The general configuration file/admin/config
.
FMS_DB_HOST
,
FMS_DB_PORT
,
FMS_DB_NAME
,
FMS_DB_USER
, and
FMS_DB_PASS
### Site settings and behaviour
* ALLOWED_COBRANDS
* RSS_LIMIT
* OPEN311_LIMIT
* ALL_REPORTS_PER_PAGE
* AREA_LINKS_FROM_PROBLEMS
* CACHE_TIMEOUT
### URLs and directories
* BASE_URL
* SECURE_PROXY_SSL_HEADER
* CONTENT_SECURITY_POLICY
* GEO_CACHE
* ADMIN_BASE_URL
### Photo storage
* PHOTO_STORAGE_BACKEND
* PHOTO_STORAGE_OPTIONS
* For local filesystem storage:
* UPLOAD_DIR
* SYMLINK_FULL_SIZE
* For Amazon S3 storage:
* BUCKET
* ACCESS_KEY
* SECRET_KEY
* PREFIX
* CREATE_BUCKET
* REGION
### Emailing
* EMAIL_DOMAIN
* CONTACT_EMAIL
* CONTACT_NAME
* DO_NOT_REPLY_EMAIL
* SMTP server settings: SMTP_SMARTHOST
,
SMTP_TYPE
,
SMTP_PORT
,
SMTP_USERNAME
,
and SMTP_PASSWORD
### Login methods, authentication
* Social login: FACEBOOK_APP_ID
,
FACEBOOK_APP_SECRET
,
TWITTER_KEY
, and
TWITTER_SECRET
* SMS text authentication: SMS_AUTHENTICATION
,
PHONE_COUNTRY
,
TWILIO_ACCOUNT_SID
,
TWILIO_AUTH_TOKEN
, and
TWILIO_FROM_PARAMETER
* LOGIN_REQUIRED
* SIGNUPS_DISABLED
### Staging site (not production) behaviour
* STAGING_SITE
* STAGING_FLAGS
### MapIt (admin boundary service)
* MAPIT_URL
* MAPIT_TYPES
* MAPIT_API_KEY
* MAPIT_ID_WHITELIST
* MAPIT_GENERATION
* MAPIT_TYPES_CHILDREN
### Localisation and maps
* LANGUAGES
* TIME_ZONE
* GEOCODER
* GEOCODING_DISAMBIGUATION
* EXAMPLE_PLACES
* MAP_TYPE
* GOOGLE_MAPS_API_KEY
* BING_MAPS_API_KEY
### Sundry external services
* GAZE_URL
* MESSAGE_MANAGER_URL
---
## All the general settings
FMS_DB_HOST
,
FMS_DB_PORT
,
FMS_DB_NAME
,
FMS_DB_USER
&
FMS_DB_PASS
Example:
FMS_DB_HOST: 'localhost'
FMS_DB_PORT: '5432'
FMS_DB_NAME: 'fms'
FMS_DB_USER: 'fmsuser'
FMS_DB_PASS: 'aSecretWord'
BASE_URL
Examples:
BASE_URL: 'http://www.example.org'
Use this if you're using the Catalyst development server:
BASE_URL: 'http://localhost:3000'
SECURE_PROXY_SSL_HEADER
Example:
SECURE_PROXY_SSL_HEADER: [ 'X-Forwarded-Proto', 'https' ]
CONTENT_SECURITY_POLICY
Example:
CONTENT_SECURITY_POLICY: 1
CONTENT_SECURITY_POLICY: 'www.example.org other.example.org'
CONTENT_SECURITY_POLICY: [ 'www.example.org', 'other.example.org' ]
EMAIL_DOMAIN
,
CONTACT_EMAIL
&
CONTACT_NAME
Example:
EMAIL_DOMAIN: 'example.org'
CONTACT_EMAIL: 'team@example.org'
CONTACT_NAME: 'FixMyStreet team'
DO_NOT_REPLY_EMAIL
CONTACT_EMAIL
, of course, if you don't have a special address.
Example:
DO_NOT_REPLY_EMAIL: 'do-not-reply@example.org'
STAGING_SITE
On a staging site, templates/CSS modified times aren't cached. Staging
sites also don't send reports to bodies unless explicitly configured to
(see STAGING_FLAGS
)
— this means you can easily test your site without really sending
emails to the bodies' contacts that may be in your database.
Example:
STAGING_SITE: 0
STAGING_SITE: 1
STAGING_FLAGS
A variety of flags that change the behaviour of a site when
STAGING_SITE
is 1
.
Setting send_reports
to 0
will
send
reports to the reporter instead of the relevant body's
contact address.
Setting skip_checks
to 1
will stop cobrands from
performing some checks such as the map pin location being within their
covered area, which makes testing multiple cobrands much easier.
Setting hide_staging_banner
to 1
will hide the
red “Staging site” banner in the top left corner of the site.
enable_appcache
lets you say whether the appcache should be
active or not.
Note that this setting is only relevant on a
staging
server.
On your
production
server (where
STAGING_SITE
is 0
)
it will be ignored.
Example:
STAGING_FLAGS: send_reports: 0 skip_checks: 1 hide_staging_banner: 1
Any reports created will now be sent to the email of the reporter and not the body's; and any location checks are skipped. Great for testing!
EXAMPLE_PLACES
You should ensure that the example places do return clear,
relevant results if they're entered in the font page text input
— this will probably depend on how you've set
GEOCODING_DISAMBIGUATION
.
Example:
EXAMPLE_PLACES: [ 'High Street', 'Main Street' ]
EXAMPLE_PLACES: [ 'Iffley Road', 'Park St, Woodstock' ]
LANGUAGES
<language code>,<pretty name>,<locale>
Some important things to note:
Just adding a language here does not necessarily mean FixMyStreet will always use it (for example, a language coded subdomain name or browser preference may be considered). See this page about languages and FixMyStreet for more information.
Example:
LANGUAGES: - 'en-gb,English,en_GB'
LANGUAGES: - 'de,German,de_DE' - 'en-gb,English,en_GB'
TIME_ZONE
Example:
TIME_ZONE: 'Asia/Manila'
TIME_ZONE: ''
GEO_CACHE
Example:
GEO_CACHE: '../cache/'
FACEBOOK_APP_ID
&
FACEBOOK_APP_SECRET
TWITTER_KEY
&
TWITTER_SECRET
SMS_AUTHENTICATION
PHONE_COUNTRY
TWILIO_ACCOUNT_SID
&
TWILIO_AUTH_TOKEN
TWILIO_FROM_PARAMETER
TWILIO_MESSAGING_SERVICE_SID
.
See the Twilio docs for more information.
TWILIO_MESSAGING_SERVICE_SID
TWILIO_FROM_PARAMETER
.
See the Twilio docs for more information.
LOGIN_REQUIRED
Example:
LOGIN_REQUIRED: 1
SIGNUPS_DISABLED
Example:
SIGNUPS_DISABLED: 1
MAPIT_URL
,
MAPIT_TYPES
,
MAPIT_API_KEY
You must provide the URL of a MapIt server, and nominate what types of area from it you want to use. If you leave this blank, a default area will be used everywhere (a URL needs to be given for non-web things, like sending of reports, to function). If the MapIt you are using requires an API key, you can provide one.
See also MAPIT_ID_WHITELIST
to
efficiently limit the areas you need (especially if you're using
global MapIt).
Example:
MAPIT_URL: 'http://localhost:3000/fakemapit/'
MAPIT_TYPES: [ 'ZZZ' ]
MAPIT_URL: 'https://mapit.mysociety.org/'
MAPIT_API_KEY: '12345'
MAPIT_TYPES: [ 'DIS', 'LBO', 'MTD', 'UTA', 'CTY', 'COI', 'LGD' ]
...but perhaps MAPIT_TYPES: [ 'WMC' ]
if you want to report on a per-constituency basis?
MAPIT_URL: 'http://global.mapit.mysociety.org/'
And then specify whichever type code have the boundaries you want:
MAPIT_TYPES: [ 'O06' ]
OSM type codes consist of the letter O followed by two digits indicating the type of boundary. Typically, the higher the number, the more specfic (localised) the boundary type.
MAPIT_ID_WHITELIST
MAPIT_URL
),
you might want to restrict FixMyStreet usage
to only one or more areas, rather than all areas of the
specified type (afer all, there are a lot of O04
boundaries
in the whole world, for example). Provide a list of all the MapIt
IDs that your FixMyStreet should recognise.
Note that you must still set MAPIT_TYPES
to match
the type or types of each of these areas. And we recommend you set
MAPIT_GENERATION
too.
We recommend you use this setting, because doing so can improves the efficiency of your site's calls to MapIt considerably.
Examples:
MAPIT_ID_WHITELIST: []
MAPIT_ID_WHITELIST: [ 240838, 246176, 246733 ]
MAPIT_GENERATION
MAPIT_ID_WHITELIST
, then you
should also specify the generation of MapIt data you are using, especially
if you are using our global MapIt service.
Global MapIt uses OpenStreetMap data. From time to time we import the latest
data in order to pull in newly-added boundaries, or reflect changes to existing
ones. When this happens, the area IDs may change, which means the values in your
MAPIT_ID_WHITELIST
might no longer
be correct (because, by default, MapIt returns values from the latest
generation of data). Use the MAPIT_GENERATION
setting to lock
the area IDs in your whitelist — and the geometry described by their boundary
data — to the specific generation they belong to. MapIt's generations
are numbered with an integer that we increment with each update.
To determine the generation of the data you're using, when you initially
identify the area IDs look at the generation-high
and
generation-low
values MapIt is returning. For example,
here's the global MapIt data for
a
point within Thailand — the national border for Thailand is the
top level returned ("OSM Administrative Boundary Level 2"). Look on
that page for "Exists in generations" (or "generation-
" in the
JSON data, available by changing MapIt's .html
URL to .json
)
to see the range of generations in which this area appears. You should
probably use the highest number (that is, the most recent update).
Examples:
4
for
Thailand's national border
(hence 507455
and
area type O02
):
MAPIT_URL: http://global.mapit.mysociety.org/ MAPIT_TYPES: ['O02'] MAPIT_ID_WHITELIST: [507455] MAPIT_ID_GENERATION: 4
MAPIT_ID_WHITELIST
you usually don't need to specify a MAPIT_ID_GENERATION
.
MAPIT_TYPES_CHILDREN
You can leave this blank if your jurisidction doesn't use subareas.
Example:
MAPIT_TYPES_CHILDREN: ''
MAPIT_TYPES_CHILDREN: [ 'DIW', 'LBW', 'MTW', 'UTE', 'UTW', 'CED', 'COP', 'LGW' ]
GEOCODER
Possible choices are
Google
, Bing
, or OSM
.
By default, FixMyStreet will use OSM
, the
OpenStreetMap
geocoder.
For more information, see the page about geocoding.
It's also possible to add a new geocoder (for example, if your jurisdiction provides a custom one). This requires some coding work, but you can see exampes of supported geocoders in the FixMyStreet repo.
Whichever geocoder you use, check the terms of use for it
— there may be restrictions. You may also need to provide an API
key to use it: see
GOOGLE_MAPS_API_KEY
and
BING_MAPS_API_KEY
.
See also GEOCODING_DISAMBIGUATION
for restricting geocoder service to specific places.
Example:
OSM
if you don't specify
a geocoder:
GEOCODER: ''
GEOCODER: 'Bing'
GOOGLE_MAPS_API_KEY
&
BING_MAPS_API_KEY
GEOCODER
setting.
Example:
GOOGLE_MAPS_API_KEY: ''
BING_MAPS_API_KEY: ''
GEOCODING_DISAMBIGUATION
Remember that you specify which geocoder you are using with the
GEOCODER
setting.
For OSM, which is the default, you can use:
GEOCODING_DISAMBIGUATION: bounds: [ <min lat>, <min lon>, <max lat>, <max lon> ] country: <country code to restrict results to> town: <string added to geocoding requests if not already there>
If using Bing, you can use town
and bounds
, plus any of:
centre: "<lat><lon>" bing_culture: <culture code: see Bing docs> bing_country: <country name: only accept results that match this>
If using Google, you can use:
bounds: [ <min lat>, <min lon>, <max lat>, <max lon> ] google_country: <.ccTLD to restrict results to> lang: <language for results>
Example:
GEOCODER: 'OSM' GEOCODING_DISAMBIGUATION: country: 'in' town: 'Mumbai'
MAP_TYPE
OSM
for
OpenStreetMap.
Other options are GoogleOL
for Google Open Layers,
and other UK-specific values, including FMS
for UK FixMyStreet.
Check the usage terms for the type of map you use — there may be restrictions.
Example:
MAP_TYPE: 'OSM'
ALLOWED_COBRANDS
moon
, then FixMyStreet will look for templates in the
templates/web/moon
directory and CSS in web/cobrands/moon
. To make this work, set:
ALLOWED_COBRANDS: - moon
If you specify only one cobrand in this way, your FixMyStreet site will simply run using that cobrand (so that would be moon
in the example above). This is probably all you need!
However, it is possible for a FixMyStreet site to support more than one cobrand at the same time. Most installations don't need this, but if yours does, it's very useful: the server decides which cobrand to use by inspecting the hostname of the incoming request.
If you wish to use multiple cobrands, specify them in a list, optionally with hostname-matching regular expressions if the name of the cobrand is not enough. If the hostname of the current request does not match with any in the list, FixMyStreet will use the Default cobrand. For example:
ALLOWED_COBRANDS: - moon - venus
Any hostname with "moon
" in it will use the moon cobrand
(for example, fixmymoon.org
), any with "venus
"
will use the venus cobrand. Anything else (such as
www.example.com
, which contains neither "moon
"
nor "venus
") will use the Default cobrand.
Instead of using the cobrand's name as the matching string, you can specify an alternative string to match on (in fact, the string can be a regular expression):
ALLOWED_COBRANDS: - moon: 'orbital' - venus
Here, any hostname with "orbital
" in it will use the moon
cobrand. Conversely, a request to www.fixmymoon.org
won't
match anything, so it would be served with the Default cobrand instead.
This also allows development servers to map to different cobrands if
needed, using DNS subdomains, for example.
If you're running a site with multiple cobrands, you'll never want to serve the Default cobrand on your production server, so make sure you've set ALLOWED_COBRANDS correctly.
Examples:
Note that specifying a single allowed cobrand is a
special, simple case: FixMyStreet will always use the
mycobrand
. This is probably all you need!
ALLOWED_COBRANDS: - mycobrand
If there's more than one allowed cobrand, FixMyStreet uses string matching (described above) on the hostname to determine which one to use:
ALLOWED_COBRANDS: - cobrand1 - cobrand2: 'hostname_substring2' - cobrand3
Make sure you've covered everything, because any requests to a hostname that don't match will be served using the Default cobrand, which isn't what you want.
ADMIN_BASE_URL
Example:
ADMIN_BASE_URL: ''
RSS_LIMIT
Example:
RSS_LIMIT: '20'
OPEN311_LIMIT
Example:
OPEN311_LIMIT: 100
ALL_REPORTS_PER_PAGE
Example:
ALL_REPORTS_PER_PAGE: 100
SMTP_SMARTHOST
localhost
, a mail server on the
same machine you are running FixMyStreet. If you wish to send email through
a SMTP server elsewhere, change this and the other SMTP settings.
Example:
SMTP_SMARTHOST: 'localhost'
SMTP_TYPE
SMTP_PORT
SMTP_USERNAME
SMTP_PASSWORD
AREA_LINKS_FROM_PROBLEMS
0
to disable, or 1
to enable.
Example:
AREA_LINKS_FROM_PROBLEMS: '0'
CACHE_TIMEOUT
/reports
. Defaults to 3600s (1 hour).
GAZE_URL
Example:
GAZE_URL: 'https://gaze.mysociety.org/gaze'
MESSAGE_MANAGER_URL
Providing a URL does not automatically enable the service — your cobrand must be explicitly coded to use it. Contact us if you need to use Message Manager with your FixMyStreet site.
Example:
MESSAGE_MANAGER_URL: ''
PHOTO_STORAGE_BACKEND
Possible choices are FileSystem
or S3
.
By default, FixMyStreet will use FileSystem
.
The chosen backend can be configured via the
PHOTO_STORAGE_OPTIONS
setting, see below.
PHOTO_STORAGE_OPTIONS
Contains backend-specific configuration options for photo storage.
For the FileSystem
backend, the following apply:
For the S3
backend, the following apply:
UPLOAD_DIR
The file location for uploaded photos. Normally you don't need to change this setting from the example.
Only applies when PHOTO_STORAGE_BACKEND
is FileSystem
.
Example:
PHOTO_STORAGE_OPTIONS: UPLOAD_DIR: '../upload/'
SYMLINK_FULL_SIZE
Defaults to false; if this is true, then requests for full size images will be symlinked from the photo cache, not copied there. You can use this if static files are being served by your web server.
Only applies when PHOTO_STORAGE_BACKEND
is FileSystem
.
BUCKET
The name of the S3 bucket to store photos in.
Required when PHOTO_STORAGE_BACKEND
is S3
.
Example:
PHOTO_STORAGE_OPTIONS: BUCKET: 'fixmystreet-photos'
ACCESS_KEY
&
SECRET_KEY
The AWS access & secret keys to use when connecting to S3. You should use a role with minimal privileges to manage objects in a specific S3 bucket, not your root keys.
Required when PHOTO_STORAGE_BACKEND
is S3
.
Example:
PHOTO_STORAGE_OPTIONS: ACCESS_KEY: 'AKIAMYSUPERCOOLKEY' SECRET_KEY: '12345/AbCdEFgHIJ98765'
PREFIX
An optional directory prefix to prepended to S3 filenames. Useful if, for example, you are using a bucket shared between other projects or FixMyStreet instances.
Optional. Only applies when PHOTO_STORAGE_BACKEND
is S3
.
Example:
PHOTO_STORAGE_OPTIONS: PREFIX: '/fixmystreet_photos/'
CREATE_BUCKET
Set to 1
(or true
) if FixMyStreet should create the S3 bucket specified in BUCKET
if it doesn't already exist.
Optional. Only applies when PHOTO_STORAGE_BACKEND
is S3
.
REGION
The AWS region to create the S3 bucket in.
Optional. Only applies when CREATE_BUCKET
is enabled.
Example:
PHOTO_STORAGE_OPTIONS: CREATE_BUCKET: 1 REGION: 'eu-west-2'