| author | durandn |
| Tue, 31 Mar 2015 15:04:40 +0200 | |
| changeset 60 | 6c19ea70f056 |
| parent 12 | 8ca7be41e3ca |
| child 61 | 018094c40453 |
| permissions | -rw-r--r-- |
|
10
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
1 |
# Catedit |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
2 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
3 |
This document will present the structure of the project and dev environment, the different steps to setup a CatEdit server, and what is needed to run it. |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
4 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
5 |
### The dev environment |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
6 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
7 |
** Vagrant + Puppet : ** |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
8 |
After cloning the project repository, you will find a [readme](dev/Puppet_Readme.md) file for Vagrant and Puppet in the /dev folder. Most of the setup of CatEdit dev environment happens in the /dev folder with the exception of the python plugin list located in /virtualenv/requirements.txt |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
9 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
10 |
** Project structure : ** |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
11 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
12 |
Here is the structure of the project directory: |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
13 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
14 |
* /dev/ has all the puppet/vagrant files and scripts to set up dev environment |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
15 |
* /src/catedit/ contains the source files |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
16 |
* /src/catedit/static/ contains the static files (js, css ...) |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
17 |
* /src/catedit/template/ contains the html templates |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
18 |
* /virtualenv/ contains the list of python packages |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
19 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
20 |
### How to setup a server |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
21 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
22 |
** Github config : ** You need a working github repository to use the application. The best way to do this is to have an app admin Github account that will handle all the repository administration. Aside from a working repository, you also need to register the app on github. To do this, you just have to go to your Github settings/applications and register a new application. You will need the "client ID" and "client secret" Github will generate for setting up the config.py file later. |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
23 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
24 |
As this app works using the Github API, all the users must have a Github account to edit categories. The users must also be added as collaborators to the categories repository by the repository owner you defined. |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
25 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
26 |
** Setting up config.py : ** |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
27 |
In the /src/catedit/ folder, you will find a config.py.tmpl. This file is the template of a mandatory config.py file that is used to set up the config of the application. Here are the values you can change in it: |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
28 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
29 |
* HOST : The host on which the app will run, default is "0.0.0.0" for development purpose as "localhost" won't work with vagrant and windows. |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
30 |
* LOGGING : Wether or not the app write log files |
|
12
8ca7be41e3ca
Pylint + pep8 + adapted code to Python 3 + added support for authentication when persistence is set to PersistenceToFile + cleaning up settings.py/config.py.tmpl and updated readme
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
10
diff
changeset
|
31 |
* LOGGING_LEVEL : if LOGGING is True, indicates what logging level will be used |
|
10
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
32 |
* DEBUG : Wether or not the app is on debug mode. If True, then each modification of a given file will restart the server allowing for easy development. |
|
12
8ca7be41e3ca
Pylint + pep8 + adapted code to Python 3 + added support for authentication when persistence is set to PersistenceToFile + cleaning up settings.py/config.py.tmpl and updated readme
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
10
diff
changeset
|
33 |
* SECRET_KEY : Secret key to secure WTForms |
|
8ca7be41e3ca
Pylint + pep8 + adapted code to Python 3 + added support for authentication when persistence is set to PersistenceToFile + cleaning up settings.py/config.py.tmpl and updated readme
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
10
diff
changeset
|
34 |
* PERSISTENCE_METHOD : What Persistence method will be used. Currently, either "PersistenceToFile" or "PersistenceToGithub" |
|
8ca7be41e3ca
Pylint + pep8 + adapted code to Python 3 + added support for authentication when persistence is set to PersistenceToFile + cleaning up settings.py/config.py.tmpl and updated readme
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
10
diff
changeset
|
35 |
* FILE_SAVE_DIRECTORY : If using PersistenceToFile, directory where the turtle files will be saved locally |
|
10
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
36 |
* REPOSITORY_NAME : The name of the repository your app will use to store categories |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
37 |
* REPOSITORY_OWNER : The name of the owner of the repository (typically a "admin" user) |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
38 |
* CATEGORIES_PATH : Where on the repository categories will be stored. Default to /categories |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
39 |
* GITHUB_CLIENT_ID : The client ID Github gave you when you registered the app |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
40 |
* GITHUB_CLIENT_SECRET : The client secret Github gave you when you registered the app |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
41 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
42 |
Once you have set up all the constants you need, save the file as config.py in the /src/catedit folder. |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
43 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
44 |
** Starting up the server ** |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
45 |
: Once you have a config.py file ready, you can start the server by running the following command from the /src/catedit folder: |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
46 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
47 |
python main.py |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
48 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
49 |
## Additional/Advanced informations ## |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
50 |
|
|
12
8ca7be41e3ca
Pylint + pep8 + adapted code to Python 3 + added support for authentication when persistence is set to PersistenceToFile + cleaning up settings.py/config.py.tmpl and updated readme
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
10
diff
changeset
|
51 |
** Changing the property list : ** If you want to change the property list available to users editing/creating categories, you have to edit the following entry in config.py |
|
10
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
52 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
53 |
* PROPERTY_LIST : My list of properties ... |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
54 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
55 |
The list of property has a fixed structure. The property list is a dict of python dicts, each following the fixed structure: |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
56 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
57 |
"propertyKey" : { |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
58 |
"descriptive_label_fr" : "mylabelfr", |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
59 |
"descriptive_label_en" : "mylabelen", |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
60 |
"object_type": "my-object-type", |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
61 |
"rdflib_class": some-RDFLib-concept, |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
62 |
"object_rdflib_class": some-RDFLib-class, |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
63 |
} |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
64 |
|
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
65 |
* "object_type" : "my-object-type", -> either "literal", "uriref-category" or "uriref-link" at the moment |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
66 |
* "rdflib_class" : some-RDFLib-concept, -> a rdflib class of some sort with its namespace, examples: SKOS.related or RDF.Type representing the predicate |
|
7d016d52be36
Added Readme.md, cleaned up config.py.tmpl and settings.py, started working on comparing categories (unfinished) in utils.py
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff
changeset
|
67 |
* "object_rdflib_class" : some-RDFLib-class: -> a rdflib class representing the object, either Literal or URIRef |