Skip to content

(OUTDATED) API for the Final Degree Project of Informatic Engineering Degree on Barcelona School of Informatics (UPC)

License

Notifications You must be signed in to change notification settings

AlbertWayne/toopath-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TooPath v3 (Outdated)

Code coverage Requirements MIT licensed Last stable version

This repository is outdated. The new versions are deployed on this repository.

TooPath v3 is an API that let you manage tracks and locations related to a device. This API is protected with JWT authentication and follows the GeoJSON RFC 7946.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • Install python 3.6.1.
  • Install OSGeo4W following the steps in GeoDjango Tutorial (make sure to install the same bit version of python and OSGeo4W.
  • Install PyCharm (optional, recommended for windows users).

Windows

Linux

Environment setup

This environment setup can be done via console and also, via PyCharm console (if you have installed this IDE). First of all, create a virtual environment:

mkvirtualenv [virtual_environment_name]

If the virtual environment is not automatically activated, then use:

workon [virtual_environment_name]

Install all the python requirements:

pip install -r requirements.txt

As it is recommended on this settings tutorial, this project has production and local separate settings. To use the local settings setup your DJANGO_SETTINGS_MODULE environment variable to TooPath3.settings.local.

For windows users, follow this Getting started of Vagrant to create a virtual machine with PostgreSQL and PostGIS (use the versions on Linux section).

For linux users, you can create the database with the PostgreSQL and PostGIS previously installed.

Apply all the migrations with:

python manage.py migrate

PyCharm setup

  1. Go to File>Settings>Project:"name">Project interpreter>Add local
  2. Select python.exe from [virtual_environment_name] folder
  3. Mark Associate this virtual environment with current project
  4. Configure the settings INSTALLED_APPS and DATABASES following the steps in Configure settings.py

Running the API

Use python manage.py runserver x.x.x.x:aaaa where x.x.x.x is the address and aaaa is the port. For local example:

python manage.py runserver 127.0.0.1:8080 

Running the tests

Once you’ve written tests, run them using the test command of your project’s manage.py utility:

python manage.py test

If you wanna run a concrete test you can do it specifying the package. For example, to run the devices test:

python manage.py test TooPath3.devices.tests

Deployment (production)

To apply the migrations on the production environment use:

python manage.py migrate --settings=TooPath3.settings.production

To start the API on the production enviroment use:

python manage.py runserver x.x.x.x:aaaa --settings=TooPath3.settings.production

Youn can also setup the DJANGO_SETTINGS_MODULE environment variable to TooPath3.settings.production.

Built With

Authors

  • Albert Díaz Benitez - First stable version - AlbertWayne

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

About

(OUTDATED) API for the Final Degree Project of Informatic Engineering Degree on Barcelona School of Informatics (UPC)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages