Skip to content
Snippets Groups Projects
Commit 4197fb36 authored by Yorgo EL MOUBAYED's avatar Yorgo EL MOUBAYED
Browse files

merge

parents b394893b 1c0c4bda
No related branches found
No related tags found
No related merge requests found
REST API created using Django, Neo4j and Neomodel.
### Clone the repository ### Clone the repository
~~~ ~~~
git clone https://git.embl.de/yelmoubayed/new-dp-service.git git clone https://git.embl.de/yelmoubayed/new-dp-service.git
...@@ -8,29 +10,43 @@ cd <repository> ...@@ -8,29 +10,43 @@ cd <repository>
~~~ ~~~
python3 -m venv env python3 -m venv env
~~~ ~~~
~~~ ~~~
source env/bin/activate # On Windows use `env\Scripts\activate` source env/bin/activate #On Linux and MacOS
~~~ ~~~
### Install Django, Django REST framework and neomodel into the virtual environment
~~~ ~~~
pip install django env\Scripts\activate #On Windows
~~~ ~~~
### Install requirements
~~~ ~~~
pip install djangorestframework pip install -r requirements.txt
~~~ ~~~
### To add new requirements if needed
~~~ ~~~
pip install neomodel pip freeze > requirements.txt
~~~ ~~~
### Django common command lines ### Django common command lines
#### Create constraintes
~~~
python manage.py install_labels
~~~
#### Track models changes
When you make changes to your models, your database needs to understand how these changes might affect the database. This command automatically makes files that document these changes. When you make changes to your models, your database needs to understand how these changes might affect the database. This command automatically makes files that document these changes.
~~~ ~~~
python manage.py makemigrations python manage.py makemigrations
~~~ ~~~
#### Run API server
This command you'll probably run the most of all commands. It means to run a emulated server on your local computer. This command you'll probably run the most of all commands. It means to run a emulated server on your local computer.
~~~ ~~~
python manage.py runserver python manage.py runserver
~~~ ~~~
#### Open Django's Python shell
~~~
python manage.py shell
~~~
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment