This repository shows the CSV-IATI Model Editor, which will help you to create a model to map your spreadsheet of aid data to the IATI format.
Clone the repository
$ git clone git://github.com/markbrough/CSV-IATI-Converter.modeleditor.git
Change into the directory and create a virtual environment (virtualenv
)
$ cd CSV-IATI-Converter.modeleditor
$ virtualenv --no-site-packages ./pyenv
Now activate the environment:
$ source ./pyenv/bin/activate
Install dependencies:
$ pip install -r requirements.txt
Copy the configuration templates (must be installed in /usr/sites
):
$ cp csviatimodeleditor/icconfig.ini.tmpl /usr/sites/icconfig.ini
Edit the configuration files and make sure that you have set a valid database URL. In production mode, remember to set the absolute path to the database.
Then run the application. In a local instance you can just do:
$ cd csviatimodeleditor
$ python __init__.py
Install mod_wsgi
$ apt-get install libapache2-mod-wsgi
Copy wsgi.py from the main directory to the appropriate folder in your web server directory, e.g. /var/www/csviatimodel
$ cp wsgi.py /var/www/csviatimodel/wsgi.py
Edit the file to make sure the paths are correct for your web server
Create a symlink from this folder to the static files folder in your installation directory, so that they can be accessed by the web server:
$ ln -s /PATH_TO_YOUR_MODELEDITOR_FILES/CSV-IATI-Converter.modeleditor/csviatimodeleditor/static /var/www/csviatimodel/static
Set up your Apache configuration files. You can do this easily by copying the default file:
$ cd /etc/apache2/sites-available/
$ cp default csviati
Then edit the configuration to something like:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog /var/log/apache2/access.log combined
WSGIDaemonProcess csviatimodel user=user__www group=group1 threads=5
WSGIScriptAlias /csviatimodel /var/www/csviatimodel/wsgi.py
Alias /csviatimodel/static/ "/var/www/csviatimodel/static/"
<Directory /var/www/csviatimodel>
Options Indexes FollowSymLinks Multiviews
WSGIProcessGroup csviatimodel
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Disable the default site and enable your new site
$ sudo a2dissite default && a2ensite csviati
Reload Apache:
$ sudo /etc/init.d/apache2 reload
- Make sure you have given permission to the upload folder to the server user.
Forked from http://github.com/nickstenning/openspending.modeleditor with thanks :)
The CSV-IATI model editor code is released under the MIT license, a copy
of which can be found in LICENSE
.