README.md
author Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
Fri, 01 Jul 2016 11:15:37 +0200
changeset 44 6730ec4d7e37
parent 33 f9d4c9a63e4e
child 46 86608f92ebed
permissions -rw-r--r--
fixing js dependencies
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     1
# How to start?
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     2
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     3
1. Make sure PIP is installed then install Django and others dependencies with 
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     4
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     5
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     6
pip install -r requirements.txt
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     7
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     8
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
     9
44
6730ec4d7e37 fixing js dependencies
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 33
diff changeset
    10
2. Move to src/iconolab/static/js/iconolab-bundle to install js dependencies.
25
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    11
Make sure your have installed nodejs then run the command bellow
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    12
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    13
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    14
npm install
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    15
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    16
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    17
3. To recreate the bundle file that lives in dist/
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    18
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    19
```
44
6730ec4d7e37 fixing js dependencies
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 33
diff changeset
    20
npm run sbuild
25
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    21
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    22
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    23
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    24
4. To add a new js module, you can add it to the js/components folder and then run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    25
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    26
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    27
npm start
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    28
```
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    29
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    30
## ICONOLAB ##
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    31
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    32
### 1. Configuration and setup
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    33
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    34
### virtualenv
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    35
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    36
- Install pip
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    37
- Create a virtualenv for the project (using virtualenvwrapper is a good idea if possible). Python version is 3.5.1
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    38
- Run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    39
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    40
	pip install -r requirements.txt
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    41
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    42
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    43
### node.js
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    44
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    45
- Make sure nodejs is installed
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    46
- cd into iconolab/src/iconolab/static/iconolab/js and run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    47
	
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    48
	npm install
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    49
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    50
- To recreate the bundle file that lives in dist/
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    51
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    52
	npm build
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    53
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    54
- To add a new js module, you can add it to the js/components folder and then run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    55
	
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    56
	npm start
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    57
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    58
### Django project setup
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    59
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    60
- Copy iconolab/src/settings/dev.py.tmpl into iconolab/src/settings/dev.py, adapt content to configuration
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    61
- cd into iconolab/src folder and run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    62
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    63
    python manage.py migrate
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    64
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    65
to create database tables
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    66
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    67
- Run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    68
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    69
    python manage.py createsuperuser
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    70
    
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    71
to create an admin user
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    72
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    73
- Run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    74
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    75
    python manage.py loaddata dev_initial_data
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    76
    
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    77
to load the provided data fixture. This fixture will create at least one of each object used in the app. Details on the fixture data below.
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    78
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    79
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    80
### 2. Development server
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    81
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    82
- cd into the iconolab/src folder and run
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    83
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    84
	python manage.py runserver
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    85
	
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    86
By default, the app is accessible through http://127.0.0.1:8000/home
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    87
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    88
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    89
### 3. Fixture loaded data
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    90
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    91
* User: contributeur1, password: firstuser
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    92
* User: contributeur2, password: seconduser
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    93
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    94
* Collection (name): ingres
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    95
* Image (ref): 1234567890 # You will need to move napoleon.jpg into web/media/uploads in order for the app to load the image properly
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    96
* Annotation (guid): 34ae39ae-a9a2-4736-bc59-ba6f00e37f52
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    97
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    98
To access the loaded annotation, follow:
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
    99
33
f9d4c9a63e4e Backend work on tags (needs testing) + model changes (image_guid, Tag)
durandn
parents: 25
diff changeset
   100
	/collections/ingres/images/26aec320-dcfe-4cbc-b912-6a6c13e8916e/annotations/34ae39ae-a9a2-4736-bc59-ba6f00e37f52/detail
f9d4c9a63e4e Backend work on tags (needs testing) + model changes (image_guid, Tag)
durandn
parents: 25
diff changeset
   101
	/collections/ingres/images/26aec320-dcfe-4cbc-b912-6a6c13e8916e/annotations/34ae39ae-a9a2-4736-bc59-ba6f00e37f52/edit
25
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
   102
	
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
   103
The annotation owner is contributeur1, if you try to edit it as another user, it will create the revision but will not publish it in the current state of the project.
843863132ac9 Readme edit and initial data fixture
durandn
parents: 15
diff changeset
   104