Skip to main content

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

  1. Add "urlid_graph" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
    ...
    "urlid_graph",
]
  1. 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"]
  1. Include the urlid_graph URLconf in your project's urls.py like this:
    path('v1/', include("urlid_graph.urls")),
  1. Run python manage.py migrate to create the needed models, triggers etc.

  2. Populate the database:

python manage.py create_brasilio_entities
python manage.py import_config /data/config.csv  # must create this file before
python manage.py import_data /data/graph-data/  # must have this folder with data
python manage.py remove_duplicates
python manage.py update_search_data

Done! :)

Importing data

(docs to be done)

Project details


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.1.2.tar.gz (26.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page