kopia lustrzana https://github.com/glidernet/ogn-python
commit
e82ca08288
|
@ -43,6 +43,10 @@ It requires [PostgreSQL](http://www.postgresql.org/) and [PostGIS](http://www.po
|
||||||
./manage.py db.init
|
./manage.py db.init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
There is also a [Vagrant](https://www.vagrantup.com/) environment for the development of ogn-python.
|
||||||
|
You can create and start this virtual machine with `vagrant up` and login with `vagrant ssh`.
|
||||||
|
The code of ogn-python will be available in the shared folder `/vagrant`.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
### Running the aprs client and task server
|
### Running the aprs client and task server
|
||||||
To schedule tasks like takeoff/landing-detection (`logbook.compute`),
|
To schedule tasks like takeoff/landing-detection (`logbook.compute`),
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
$script = <<SCRIPT
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# install PostgreSQL and PostGIS
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends postgresql-9.4-postgis-2.1 libpq-dev
|
||||||
|
|
||||||
|
# create PostGIS database
|
||||||
|
sudo sudo -u postgres createuser -s vagrant
|
||||||
|
|
||||||
|
sudo sudo -u postgres createdb ogn -O vagrant
|
||||||
|
sudo sudo -u postgres psql -d ogn -c 'CREATE EXTENSION postgis;'
|
||||||
|
|
||||||
|
# install python requirements
|
||||||
|
cd /vagrant
|
||||||
|
sudo apt-get install -y --no-install-recommends redis-server build-essential python3 python3-pip python3-dev libpq-dev libgeos-dev
|
||||||
|
sudo -H pip3 install -r requirements.txt
|
||||||
|
|
||||||
|
# # initialize database
|
||||||
|
./manage.py db.init
|
||||||
|
|
||||||
|
# # import registered devices from ddb
|
||||||
|
./manage.py db.import_ddb
|
||||||
|
|
||||||
|
SCRIPT
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.box = 'debian/jessie64'
|
||||||
|
|
||||||
|
# Current version is broken
|
||||||
|
config.vm.box_version = '8.5.2'
|
||||||
|
|
||||||
|
config.vm.provision 'shell', inline: $script, privileged: false
|
||||||
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres@localhost:5432/ogn'
|
SQLALCHEMY_DATABASE_URI = 'postgresql:///ogn'
|
||||||
|
|
||||||
BROKER_URL = 'redis://localhost:6379/0'
|
BROKER_URL = 'redis://localhost:6379/0'
|
||||||
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
|
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
|
||||||
|
|
Ładowanie…
Reference in New Issue