2014-10-21 10:33:21 +02:00
|
|
|
Passerelle provides an uniform access to multiple data sources and services.
|
|
|
|
|
|
|
|
Quickstart
|
|
|
|
==========
|
|
|
|
|
|
|
|
Setting up an environment (virtualenv)
|
|
|
|
--------------------------------------
|
|
|
|
|
|
|
|
The first thing you'll need is the Python virtualenv package. You probably
|
|
|
|
already have this, but if not, you can install it with:
|
|
|
|
|
|
|
|
$ easy_install -UZ virtualenv
|
|
|
|
|
|
|
|
Once that's done, choose a location for the environment, and create it with the
|
|
|
|
virtualenv command. For our guide, we're going to choose "venv" in the current
|
|
|
|
directory:
|
|
|
|
|
|
|
|
$ virtualenv venv
|
|
|
|
$ source venv/bin/activate
|
|
|
|
|
2018-01-12 07:46:45 +01:00
|
|
|
From Passerelle source directory install required Python packages:
|
2014-10-21 10:33:21 +02:00
|
|
|
|
2017-12-14 17:10:18 +01:00
|
|
|
$ pip install -e .
|
2014-10-21 10:33:21 +02:00
|
|
|
|
|
|
|
Initializing the database (quickstart: sqlite3)
|
|
|
|
-----------------------------------------------
|
2014-10-02 09:54:39 +02:00
|
|
|
|
|
|
|
To create the database, execute the following line:
|
|
|
|
|
2017-12-14 17:10:18 +01:00
|
|
|
$ python manage.py migrate
|
2014-10-02 09:54:39 +02:00
|
|
|
|
2014-10-21 10:33:21 +02:00
|
|
|
The new database is created inside `passerelle.sqlite3` in the current
|
|
|
|
directory.
|
2014-10-02 09:54:39 +02:00
|
|
|
|
2018-01-12 07:46:45 +01:00
|
|
|
Create a first user with administrative rights:
|
|
|
|
|
|
|
|
$ python manage.py createsuperuser
|
|
|
|
|
|
|
|
|
2014-10-02 09:54:39 +02:00
|
|
|
Running
|
|
|
|
-------
|
|
|
|
|
|
|
|
The command line for starting is:
|
|
|
|
|
2014-10-21 10:33:21 +02:00
|
|
|
$ python manage.py runserver
|
2014-10-02 09:54:39 +02:00
|
|
|
|
2014-10-21 10:33:21 +02:00
|
|
|
Passerelle is available on http://127.0.0.1:8000/
|
2014-10-02 09:54:39 +02:00
|
|
|
|
|
|
|
|
2015-02-10 13:06:55 +01:00
|
|
|
Settings
|
|
|
|
--------
|
2014-10-02 09:54:39 +02:00
|
|
|
|
2015-02-10 13:06:55 +01:00
|
|
|
Default settings are loaded from settings.py, they can be overloaded by a
|
|
|
|
local_settings.py file set in the same directory, or by a file referenced
|
|
|
|
in the PASSERELLE_SETTINGS_FILE environment variable.
|
2014-10-02 09:54:39 +02:00
|
|
|
|
2014-10-24 10:04:43 +02:00
|
|
|
|
2021-02-20 16:26:50 +01:00
|
|
|
Code Style
|
|
|
|
----------
|
|
|
|
|
|
|
|
black is used to format the code, using thoses parameters:
|
|
|
|
|
|
|
|
black --target-version py37 --skip-string-normalization --line-length 110
|
|
|
|
|
|
|
|
There is .pre-commit-config.yaml to use pre-commit to automatically run black
|
|
|
|
before commits. (execute `pre-commit install` to install the git hook.)
|
|
|
|
|
|
|
|
|
2015-04-03 22:05:57 +02:00
|
|
|
Tests
|
|
|
|
-----
|
|
|
|
|
2016-03-10 14:08:18 +01:00
|
|
|
Unit tests are written using py.test, and its pytest-django support library and
|
|
|
|
run using tox.
|
2015-04-03 22:05:57 +02:00
|
|
|
|
2016-03-10 14:08:18 +01:00
|
|
|
tox
|
|
|
|
|
|
|
|
To run a specific test under a specific environment.
|
|
|
|
|
2020-06-13 00:34:09 +02:00
|
|
|
tox -e py3-django111 -- -vv tests/test_csv_datasource.py
|
2015-04-03 22:05:57 +02:00
|
|
|
|
2014-10-24 10:04:43 +02:00
|
|
|
LICENSES
|
|
|
|
========
|
|
|
|
|
|
|
|
Passerelle
|
|
|
|
Copyright (C) 2013-2014 Entr'ouvert <info@entrouvert.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
Software Foundation, either version 3 of the License, or (at your option) any
|
|
|
|
later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License along
|
|
|
|
with this program (LICENSE file). If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2016-03-14 12:32:53 +01:00
|
|
|
Copyright
|
|
|
|
---------
|
|
|
|
|
|
|
|
django-jsonresponse (https://github.com/jjay/django-jsonresponse)
|
|
|
|
# Files: passerelle/utils/jsonresponse.py
|
|
|
|
# Copyright (c) 2012 Yasha Borevich <j.borevich@gmail.com>
|
|
|
|
# Licensed under the BSD license
|