kopia lustrzana https://github.com/hholzgra/maposmatic/
Rework configuration templates
Use the more traditional '.dist' extension for configuration templates that are part of the MapOSMatic distribution. Update the installation instructions accordingly. Includes some style fixes in the INSTALL and template files, as well as a fix to the wrapper script to correctly allow for an undefined log location (defaults to stderr). Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>stable
rodzic
04e0bf747d
commit
a6f61af513
25
INSTALL
25
INSTALL
|
@ -6,16 +6,20 @@ Dependencies
|
|||
|
||||
MapOSMatic depends on :
|
||||
|
||||
* Python, the programming language
|
||||
* Python, the programming language.
|
||||
|
||||
* Django, the Web framework used to develop the Web front-end, but
|
||||
also used for the maposmaticd daemon to conveniently access the
|
||||
database through Django's ORM
|
||||
database through Django's ORM.
|
||||
|
||||
* python-psycopg2, to let Django access the PostgreSQL database
|
||||
* OCitySMap, the rendering pipeline for MapOSMatic. See OCitySMap's
|
||||
install file for installation instructions and OCitySMap's
|
||||
dependencies.
|
||||
|
||||
* python-psycopg2, to let Django access the PostgreSQL database.
|
||||
|
||||
* python-feedparser, to parse the MapOSMatic blog feed and display
|
||||
the latest entries on the main MapOSMatic website
|
||||
the latest entries on the main MapOSMatic website.
|
||||
|
||||
* python-imaging, to render PNG maps.
|
||||
|
||||
|
@ -23,13 +27,12 @@ MapOSMatic depends on :
|
|||
|
||||
* JSON (any python-*json package should work).
|
||||
|
||||
* ImageMagick, for rendering the thumbnails of multi-page maps
|
||||
* ImageMagick, for rendering the thumbnails of multi-page maps.
|
||||
|
||||
On an debian/ubuntu installation, the following should be enough:
|
||||
|
||||
sudo aptitude install python-django python-psycopg2 \
|
||||
python-feedparser python-imaging gettext \
|
||||
imagemagick
|
||||
python-feedparser python-imaging gettext imagemagick
|
||||
|
||||
You will also most likely need a working PostGIS installation for the
|
||||
entire pipeline to run. See the INSTALL documentation of OcitySMap for
|
||||
|
@ -39,11 +42,11 @@ Setup
|
|||
-----
|
||||
|
||||
The www/ directory contains the Django web application. The file
|
||||
www/settings_local.py-template must be copied to www/settings_local.py
|
||||
and modified to match your installation configuration.
|
||||
www/settings_local.py.dist must be copied to www/settings_local.py and
|
||||
modified to match your installation configuration.
|
||||
|
||||
Likewise for www/maposmatic.wsgi-template and
|
||||
scripts/config.py-template.
|
||||
Likewise for www/maposmatic.wsgi.dist and scripts/config.py.dist,
|
||||
respectively as www/maposmatic.wsgi and scripts/config.py.
|
||||
|
||||
The database must then be initialized with the tables needed for MapOSMatic,
|
||||
using :
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
# Copy this file as 'config.py' and edit the following lines to match your
|
||||
# installation.
|
||||
|
||||
# Path to your OCitySMap installation
|
||||
OCITYSMAP_PATH = '/path/to/ocitysmap'
|
||||
|
||||
# Log file for MapOSMatic. Leave empty for stderr.
|
||||
MAPOSMATIC_LOG = '/tmp/maposmaticd.log'
|
||||
|
||||
# Log level (lower is more verbose)
|
||||
# 50: critical
|
||||
# 40: error
|
||||
# 30: warning
|
||||
# 20: info
|
||||
# 10: debug
|
||||
# 0: not set (discouraged)
|
||||
MAPOSMATIC_LVL = 20
|
||||
|
||||
###
|
||||
## Optional: if you need to extend the python search path, then write
|
||||
## something like the following:
|
||||
# import os
|
||||
# os.environ['PYTHONPATH'] = '%s:%s' % ('/path/to/lib/python/site-packages',
|
||||
# os.environ.get('PYTHONPATH', ''))
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
import os
|
||||
|
||||
# Optional: if you need to extend the Python search path, then write
|
||||
# something like the following:
|
||||
# os.environ['PYTHONPATH'] = ('%s:%s' %
|
||||
# ('/path/to/lib/python/site-packages',
|
||||
# os.environ.get('PYTHONPATH', '')))
|
||||
|
||||
# Path to your OCitySMap installation
|
||||
OCITYSMAP_PATH = '/path/to/ocitysmap'
|
||||
|
||||
# Log file for MapOSMatic. Leave empty for stderr.
|
||||
MAPOSMATIC_LOG = None
|
||||
|
||||
# Log level (lower is more verbose)
|
||||
# 50: critical
|
||||
# 40: error
|
||||
# 30: warning
|
||||
# 20: info
|
||||
# 10: debug
|
||||
# 0: not set (discouraged)
|
||||
MAPOSMATIC_LVL = 20
|
|
@ -34,7 +34,7 @@ if __name__ == '__main__':
|
|||
os.environ['PYTHONPATH'] = '%s:%s:%s' % (OCITYSMAP_PATH, root,
|
||||
os.environ.get('PYTHONPATH', ''))
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'www.settings'
|
||||
os.environ['MAPOSMATIC_LOG_FILE'] = MAPOSMATIC_LOG
|
||||
os.environ['MAPOSMATIC_LOG_FILE'] = MAPOSMATIC_LOG or ''
|
||||
os.environ['MAPOSMATIC_LOG_LEVEL'] = str(MAPOSMATIC_LVL)
|
||||
|
||||
os.execv(os.path.join(root, sys.argv[1]), sys.argv[1:])
|
||||
|
|
|
@ -22,8 +22,14 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Optional: if you need to extend the Python search path, for example to
|
||||
# include your OCitySMap installation, then write something like the following:
|
||||
# sys.path.append('/path/to/ocitysmap')
|
||||
# sys.path.append('/path/to/lib/python/site-packages')
|
||||
|
||||
DEBUG = True
|
||||
|
||||
|
@ -32,17 +38,31 @@ ADMINS = (
|
|||
)
|
||||
|
||||
DATABASES = {
|
||||
# For SQLite:
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'maposmatic',
|
||||
'USER': 'maposmatic',
|
||||
'PASSWORD': 'ereiamjh',
|
||||
'HOST': 'localhost',
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(os.path.dirname(__file__),
|
||||
'datastore.sqlite3'),
|
||||
'USER': '',
|
||||
'PASSWORD': '',
|
||||
'HOST': '',
|
||||
'PORT': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
# Path to ocitysmap's config file to use, or None for the default in ~/
|
||||
# For PostgreSQL:
|
||||
#'default': {
|
||||
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
# 'NAME': 'maposmatic',
|
||||
# 'USER': 'maposmatic',
|
||||
# 'PASSWORD': 'secret',
|
||||
# 'HOST': 'localhost',
|
||||
# 'PORT': '5432'
|
||||
# },
|
||||
|
||||
}
|
||||
|
||||
# Path to ocitysmap's config file to use, or None for the default
|
||||
# (~/.ocitysmap.conf)
|
||||
OCITYSMAP_CFG_PATH = None
|
||||
|
||||
# Path to the file containing the datetime of the state of the GIS
|
||||
|
@ -80,17 +100,10 @@ ITEMS_PER_PAGE = 25
|
|||
MAPOSMATIC_PID_FILE = '/var/run/maposmaticd.pid'
|
||||
|
||||
# Settings for exception emails: the from email address, and the list of
|
||||
# receipient email addresses. No emails are sent if the receipients list is
|
||||
# empty.
|
||||
DAEMON_ERRORS_SMTP_HOST = 'localhost'
|
||||
# receipient email addresses. No emails are sent if the SMTP host is not
|
||||
# defined.
|
||||
DAEMON_ERRORS_SMTP_HOST = None
|
||||
DAEMON_ERRORS_SMTP_PORT = 25
|
||||
DAEMON_ERRORS_EMAIL_FROM = 'daemon@domain.com'
|
||||
DAEMON_ERRORS_EMAIL_REPLY_TO = 'noreply@domain.com'
|
||||
DAEMON_ERRORS_JOB_URL = 'http://domain.com/jobs/%d'
|
||||
|
||||
###
|
||||
## Optional: if you need to extend the python search path, then write
|
||||
## something like the following:
|
||||
# import sys
|
||||
# sys.path.append('/path/to/ocitysmap')
|
||||
# sys.path.append('/path/to/lib/python/site-packages')
|
Ładowanie…
Reference in New Issue