Django-based API to serve URLid + graph database
Project description
django-urlid-graph
Django-based API to serve URLid + graph database.
This repository hosts the app code and also a project structure so it's easier
to develop - only the urlid_graph
folder is packaged before going to
PyPI.
Installation and configuration
- Add "urlid_graph" to your
INSTALLED_APPS
setting like this:
INSTALLED_APPS = [
...
"urlid_graph",
]
- Change database configurations (this example uses python-decouple):
DATABASE_URL = config("DATABASE_URL") # must be set
GRAPH_DATABASE_URL = config("GRAPH_DATABASE_URL") # must be set
graph_config = config("GRAPH_DATABASE_URL", cast=db_url)
GRAPH_DATABASE = graph_config["NAME"] # must be set
DATABASES = {
"default": config("DATABASE_URL", cast=db_url),
GRAPH_DATABASE: graph_config, # must set this way
}
DATABASE_ROUTERS = ["urlid_graph.db_router.RelationAndGraphDBRouter"]
- Include the
urlid_graph
URLconf in your project'surls.py
like this:
path('v1/', include("urlid_graph.urls")),
-
Run
python manage.py migrate
to create the needed models, triggers etc. -
Populate the database:
# you may want to add entities to urlid_graph_entity model
python manage.py import_config data/config.csv # must create this file before
Importing data
python manage.py import_objects appname Model file.csv[.gz|.xz]
python manage.py import_relationship relname file.csv[.gz|.xz]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-urlid-graph-0.5.0.tar.gz
(30.1 kB
view hashes)