« Previous -
Version 42/177
(diff) -
Next » -
Current version
Etienne Pallier, 03/25/2016 06:55 pm
Project Development¶
Project Installation page : Project Installation
HOWTO Format Redmine Wiki : http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting
- Project Development
TODO¶
- Interface admin (http://localhost:8000/admin):
- Impossible d'ajouter un pays dans Country depuis admin (erreur sur pyrosuser.name)
- Impossible d'ajouter un telescope (erreur sur device.name)
- champs booleans: représenter en case à cocher (cf requests.is_alert) : is_alert = models.BooleanField()
- Fix plurals:
- Country : plural "countries" and not "countrys"
- NrtAnalysiss
- Historys
- ...
- Models: bien définir les valeurs par défaut
- ex: request.is_alert = False par défaut
- Preload some data for some tables:
- country => France, Mexico, ...
- sequencetype => 0=routine, 1=alert, ...
- userlevel => 0=normal, 1=expert, 2=admin, ...
- ...
- updated et created : champs automatiques Django
- readonly admin interface : https://gist.github.com/aaugustin/1388243
- Ecrire quelques premiers petits tests
- Tester install eclipse from scratch (vérifier qu'on n'a plus besoin de faire "set as pydev" et "set as django" et set DJANGO_MANAGE_LOCATION et set DJANGO_SETTINGS_MODULE)
- Séparation des BD Django et Pyros
- Intégration des modules Django déjà développés
- Intégration continue avec Jenkins (+ run des tests sur une VM Windows)
- Planifier la suite...
- Doc pour le meeting de mai
- pyrossu : pyrossu!
LIENS UTILES¶
- Liens vers web local :
- homepage: http://localhost:8000
- admin: http://localhost:8000/admin
- Eclipse:
- Shift-Ctrl-f (ou Shift-Cmd-f) : reformatage du fichier selon PEP8
- Shift-Ctrl-1 : make doc string ...
- Django:
- Git docs:
- Permissions gitlab: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/permissions/permissions.md
- 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
- Git sur sourcesup (avec jenkins) : https://services.renater.fr/sourcesup/formation/chap04#gestion_d_un_projet_avec_git_jenkins_sonar_et_nexus
- 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
I - DATABASE SCHEMA (v0.2.1)¶
II - Get the project (from gitlab)¶
Gitlab management interface¶
https://gitlab.irap.omp.eu/epallier/pyros
https://gitlab.irap.omp.eu/epallier/pyros/team
Get the project¶
https://projects.irap.omp.eu/projects/pyros/wiki/Project_Installation#II-Get-the-project-from-gitlab
III - INSTALLATION¶
https://projects.irap.omp.eu/projects/pyros/wiki/Project_Installation#III-INSTALLATION
IV - CONFIGURATION of the Django Back Office (administration interface)¶
Configuration of the Django Back office (admin)
VI - EVOLUTION OF THE PROJECT¶
./manage.py runserver
if DEBUG=False, we have errors, missing static files :
Not Found: /static/admin/css/base.css Not Found: /static/admin/css/login.css Not Found: /admin/login Not Found: /static/admin/css/base.css Not Found: /static/admin/css/login.css Not Found: /static/admin/css/base.css Not Found: /static/admin/css/login.css Not Found: /static/admin/css/base.css Not Found: /static/admin/css/dashboard.css Not Found: /static/admin/css/base.css Not Found: /static/admin/css/base.css …
=> We have to activate the static files management
(see https://docs.djangoproject.com/en/1.9/howto/static-files)
In pyros/urls.py, add this:
from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^admin/', admin.site.urls), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
STATIC_ROOT must be defined in settings and says where is the root of all static files
Edit settings.py, add:
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'public', 'static')
./manage.py collectstatic
=> 56 static files copied to '.../PYROS/public/static'
(in fact it is in public/static/admin/)
Cette commande copie tous les fichiers statiques de toutes les applis
dans public/static
Apache viendra lire ce dossier unique
A chq changement d’un fichier statique d’une appli, exécuter « collectstatic » pour mettre à jour le dossier final public/static (auquel on ne doit pas toucher manuellement, c’est un dossier « final »)