Skip to content

Useful Shell Commands

mariamoritz edited this page Nov 5, 2014 · 6 revisions

Useful Commands for Neo4j

Start and Stop Neo4j

Assuming your Neo4j Database Data is in /var/lib/neo4j/

stop the service

cd /var/lib/neo4j/data
sudo /etc/init.d/neo4j-service stop`

start the service

cd /var/lib/neo4j/data
sudo /etc/init.d/neo4j-service start

Remove the Database (assuming you are in your project root)

fab destroy_neo4j

Neo4j Database

Neo4j is running on

http://localhost:7474

The Webadmin

http://localhost:7474/webadmin

The Browser

http://localhost:7474/browser

The Neo4j REST Client

http://localhost:7474/db/data/

Indices on Labels

The easiest Way to create indices on your Database, is via the Browser, type e.g.:

CREATE INDEX ON :Person(name)

Useful Commands for the Application (project root)

Virtual Env

Assuming you are in /opt/phaidra:

Activate the Virtual Environment

source env/bin/activate

(Re)starting the application (Uwsgi & Nginx)

fab restart

Deactivate the Virtual Environment

deactivate

Start the Python Shell

python manage.py shell

Pip Commands

Install (or update) the Requirements

(sudo) pip install (-U) -r requirements.txt

Save your own System's State into the Requirements

pip freeze > requirements.txt

Postgres Commands

Login to the Postgres Shell

psql -U databaseuser -h localhost databasepassword

Postgres Migration

If you wanna adapt Changes others made (after you pulled from GitHub)

python manage.py migrate app

If you made Changes and wanna adapt them

python manage.py makemigrations app
python manage.py migrate app

Developer Guide

Backend

Frontend

Content Guide

What did you break?

  • Postgres Database
  • Neo4j
  • Django
  • "The server"
  • Git
  • UI
Clone this wiki locally