tsliang / astroplant-server

The back-end and website of the AstroPlant system

Home Page:http://astroplant.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AstroPlant server

This repository contains the code for the back-end and website of the AstroPlant system.

The AstroPlant kits communicate with the back-end to push data. The website allows users to view the data.

The server is built using the Django framework.

Documentation

Full documentation can be found here.

Configure AstroPlant

The server requires a database to function. It has only been tested with MySQL/MariaDB.

Edit server/settings.py.

Prepare static resources

The static JavaScript and CSS resources have to be prepared prior to running the server.

To do this, ensure npm is installed. Now install the project dependencies. In the root directory of the project, run:

npm install

Next, build the assets to static files:

npm run-script build

Prepare the database

Prepare the database by running:

python manage.py migrate

Note that for development versions (non-release) it might be necessary to perform an additional makemigrations step:

python manage.py makemigrations
python manage.py migrate

If you would like to include some default data provided by AstroPlant, such as measurement types and official peripheral device definitions, load the AstroPlant fixture.

python manage.py loaddata astroplant

Run the server

It is recommended to host the server through a webserver using server/WSGI.py, such as Nginx with uWGSI. See also the AstroPlant server deployment repository.

Alternatively, for development, run the server using:

python manage.py runserver

About

The back-end and website of the AstroPlant system

http://astroplant.io


Languages

Language:Python 50.6%Language:HTML 44.1%Language:CSS 3.2%Language:JavaScript 2.0%