Project Installation

Version 7 (Etienne Pallier, 03/24/2016 12:51 pm) → Version 8/374 (Etienne Pallier, 03/24/2016 12:52 pm)

h1. Project Installation

HOWTO Format Redmine Wiki : http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting

{{>toc}}

---

h2. %{margin-left:0px; font-weight:bold; font-size:25px; display:block; color:red;}LIENS UTILES%

* Liens vers web local :

* homepage: http://localhost:8000
* admin: http://localhost:8000/admin

* Django:

* Coding style: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/

* Git docs:

* https://git-scm.com/docs
* https://git-scm.com/book/fr/v1/Les-bases-de-Git-Travailler-avec-des-d%C3%A9p%C3%B4ts-distants
* les workflows: https://aresu.dsi.cnrs.fr/spip.php?article219
* Git for Eclipse users : http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users

* CADOR web interface: http://cador.obs-hp.fr/ros/manual/cador_actions.html

* pylint (analyse de code) : https://www.pylint.org

* pyreverse (uml diagrams generation, inclus dans pylint) : https://www.logilab.org/blogentry/6883

* tox (a generic virtualenv management and test command line tool) : https://testrun.org/tox/latest/index.html

---

h2. %{margin-left:0px; font-weight:bold; font-size:25px; display:block;
color:red;}I - DATABASE SCHEMA (v0.2.1)%

{{thumbnail(PYROS_PDM_v021.png, size=300, title=Pyros data model)}}

---

h2. %{margin-left:0px; font-weight:bold; font-size:25px; display:block; color:red;}II - Get the project (from gitlab)%

h3. Gitlab management interface

https://gitlab.irap.omp.eu/epallier/pyros

https://gitlab.irap.omp.eu/epallier/pyros/team

Browse the code: https://gitlab.irap.omp.eu/epallier/pyros/tree/master

h3. Project structure

Once you have fetched the project, you should obtain this structure:

<pre>

PYROS/
├── install/
│ └── REQUIREMENTS.txt
│ └── INSTALLATION.txt
├── public/
│ └── static/
├── src/
│ ├── manage.py
│ ├── pyros/
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ ├── settings.py
│ │ ├── urls.py
│ │ └── wsgi.py
│ └── pyrosapp/
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── migrations
│ ├── models.py
│ ├── tests.py
│ └── views.py

</pre>

h3. From the terminal

<pre>
git clone https://gitlab.irap.omp.eu/epallier/pyros.git PYROS
(or also : git clone git@gitlab.irap.omp.eu:epallier/pyros.git PYROS)
</pre>

This creates a PYROS/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)

_If you just wanted a static copy of the project (without synchronization), just remove the .git/ folder:_
<pre>
$ rm -r .git/
</pre>

h3. From Eclipse

1) Deactivate CA certificate verification

Window -> Preferences -> Team -> git -> configuration -> Add entry

Key = http.sslVerify
Value = false

2) Fetch the project

File/Import project from git

Select repository source: Clone URI: https://gitlab.irap.omp.eu/epallier/pyros.git

Directory:
par défaut, il propose : /Users/epallier/git/pyros
mais on peut le mettre ailleurs (c'est ce que j'ai fait)

initial branch: master
remote name: origin

Import as general project

Project name: PYROS

3) Configure the project

The project is created. Now, you have to set it as a «PyDev » and a « Django » project.

clic droit sur le projet / PyDev / set as a PyDev project

clic droit sur le projet / PyDev / set as a Django project

clic droit sur le projet : on doit maintenant avoir un sous-menu Django

clic droit sur le dossier src / PyDev / set as source folder (add to PYTHONPATH)

clic droit sur projet / Properties / Pydev-Django :
- Django manage.py : src/manage.py
- Django settings module : pyros.settings

4) Set Code style

Window/Preferences : Pydev / Editor
- Auto Imports : uncheck « Do auto import »
- Code style:
- Locals … : camelCase
- Methods : camelCase() with first lower
- Code style / Code Formatter: activer « use autopep8.py for code formatting »
- Tabs : Tab length : 4

(il faudra aussi faire un peu plus loin : https://projects.irap.omp.eu/projects/pyros/wiki/Wiki#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter)