Adapter used to connect the Value-Added Services and expose them to the VICINITY neighborhood.
Before running this adapter, ensure that you have the following in place:
-
Python 3.6.5+
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.6
comes with a pre-installed 3.6, use
python3
to invoke itDownload binary from: https://www.python.org/downloads/
Make sure to update your Environment Variables -
PostgreSQL 9.6+
$ sudo apt-get install postgresql-9.6
-
RabbitMQ server for message passing between the worker and the adapter
$ sudo apt-get install rabbitmq-server
-
Configured and working VICINITY Client Node
-
Clone this repository using
git clone
-
Inside the project directory run
pip install -r requirements.txt
to install the necessary requirements -
Update your database connection settings in
vas-adapter-hits/vas_adapter/settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432',
}
}
Inside the project directory run
$ python manage.py makemigrations
$ python manage.py migrate
Run the adapter on a port of your choice
$ python manage.py runserver <your_host>:<your_port>
Example:
$ python manage.py runserver 127.0.0.1:9000
Celery worker (make sure rabbit-mq server is up and running on your machine)
$ celery -A proj worker
to execute tasks
$ celery -A proj beat
to schedule tasks
In order to access the admin page, you must first create an admin user by python manage.py createsuperuser
, then fill out the username and password (feel free to leave other fields blank).
You may then access the page at http://<your_host>:<your_port>/admin
- Log in to your admin page
- Under the API table, click Add next to "Parking Lots"
- Fill out the parking lot information
- Under the API table, click Add next to "Parking Spaces"
- Fill out the sensor information. Make sure that the sensor is
- Under the API table, click Add next to "Parking Reservations"
- Fill out the reservation information