Get started with the DjangoLDP server

What is behind the DjangoLDP server ?

Our solution is based on Django and named DjangoLDP, adapted to be compatible with Linked Datas convention.

Go to Server Architecture to know more about it.

And check the References guide to know all the details.

Requirements

The DjangoLDP server requires:

  • python 3.6

  • postgresql database (for production)

Note

If you’re working on many project in Python, we advice you to use a virtual environement.

From a fresh environment, get the last version of DjangoLDP:

python -m pip install djangoldp

Initiate a new server

Create a server workdir:

djangoldp initserver sibserver
cd sibserver

All the command must be issued from this working directory.

Add a package to your settings.yml file, let’s start with djangoldp_account:

dependencies
  - djangoldp-account

ldppackages:
  - djangoldp_account

The server section should work out of the box. Check the reference guide for details on the settings file.

Install the dependencies you just added:

djangoldp install

This downloads the djangoldp-account distribution from pypi.org.

Configure your backend to support the new package:

djangoldp configure --with-dummy-admin

This will also create a local admin user (not suited for production use).

Then launch the server:

djangoldp runserver

Then go to http://localhost:8000/admin/ to acces to your Django administration with the admin user and admin password.

You should be able to get you api at http://localhost:8000/abc/ where abc is the model of data you want to get.

Start your own DjangoLDP package

Note

A bug in with the local package loading breaks the Django migrations directory recognition. To workaround it, you need to start or move your DjangoLDP package outside the server workdir and make a symlink inside the working directory.

Start a new package in the server workdir parent directory:

djangoldp startpackage mypkg

From the server workdir create a symlink to the package python module:

cd sibserver
ln -s ../mypkg/mypkg mypkg

Then reference your new package in the ldppackages section:

ldppackages:
  - mypkg

Don’t forget to run the configure command if your package load django migrations.