logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).


L'icône rouge permet de télécharger chaque page du wiki visitée au format PDF et la grise au format ODT → ODT PDF Export

Ceci est une ancienne révision du document !


Développer en Python3 avec Django

  • Objet : Installer un environnement virtuel avec python3 pour utiliser Django
    essayer un mini projet avec chacune des différentes bases de données supportées par ORM de Django.
  • Niveau requis :

Avant de commencer

Sur Jessie python et python 3 sont tous deux installés.

Installer les outils et bibliothèques pour développer en python ou python 3

  • Fichiers d'en-tête de Python
apt-get install python-dev python3-dev
  • Pour l'algèbre avec scipy
apt-get install libblas3 libblas-dev liblapack3 liblapack-dev
  • Bibliothèques FreeType nécessaire par matplotlib
apt-get install libfreetype6 libfreetype6-dev
  • Dépendances nécessaire pour la cryptographie
apt-get install libffi-dev libssl-dev
  • Les paquets Core Python
apt-get install python-pip python3-pip
apt-get install python-virtualenv
À savoir sur Jessie, il est inutile de lancer :

apt-get install python3-virtualenv

En effet, avec la commande apt-get install python-virtualenv a installé python3-virtualenv et python-virtualenv

  1. python3-pip (ou python-pip) : installateur de paquets python, Pip permet d'installer aisément des modules Python, à la manière dont on installe des paquets dans une distribution linux;
  2. python3-dev (ou python-dev ): permet d'utiliser des outils de développement pour la construction des modules Python, non pris en charge par pip, en particulier pour utiliser des bibliothèques avec des extensions en C
  3. virtualenv : permet de créer un environnement cloisonné Python
  • Installer la documentation python
apt-get install python-doc python3-doc
  • pour utiliser pyenv
apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev
  • Sans rapport avec le développement mais utilisé plus bas
apt-get install tree

Préparer son système pour travailler avec python2 et python3

Utiliser update-alternatives pour choisir l'une ou l'autre des versions:

  • Charger les différentes versions de Python :
update-alternatives --list python
update-alternatives: error: no alternatives for python
  • Pour voir où sont les exécutables des deux versions disponibles de python :
 ls /usr/bin/python*
/usr/bin/python            /usr/bin/python3            /usr/bin/python3-config
/usr/bin/python2           /usr/bin/python3.4          /usr/bin/python3m
/usr/bin/python2.7         /usr/bin/python3.4-config   /usr/bin/python3m-config
/usr/bin/python2.7-config  /usr/bin/python3.4m         /usr/bin/python-config
/usr/bin/python2-config    /usr/bin/python3.4m-config
  • Pour ajouter à la liste de update-alternatives les deux versions de python disponibles :

(ici par exemple; “/usr/bin/python2.7” et “/usr/bin/python3.4 ”)

update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2

- Pour voir la nouvelle liste de update-alternatives :

update-alternatives --list python
 /usr/bin/python2.7
 /usr/bin/python3.4

- On va laisser tout le système configurer avec python3 dans un premier temps :

update-alternatives --config python
Il existe 2 choix pour l'alternative python (qui fournit /usr/bin/python).
 
  Sélection   Chemin              Priorité  État
------------------------------------------------------------
* 0            /usr/bin/python3.4   2         mode automatique
  1            /usr/bin/python2.7   1         mode manuel
  2            /usr/bin/python3.4   2         mode manuel
 
Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le num

On choisit la sélection correspondante à python2.7 pour tout le système. Ici c'est le choix n°1.

  • À savoir pour supprimer l'un des choix de la liste :
update-alternatives --remove python /usr/bin/python2.7
  • Ne jamais désinstaller les versions inférieures à python 3 !
    De nombreux logiciels ne fonctionneraient plus.

apt-get purge python

  • Pour vérifier
python --version
Python 2.7.9
L'idée suivie ici sera de conserver python2 pour tout le système, et de mettre en place python3 dans un environnement virtuel consacré aux projets django.

Pour installer Django avec python3 y compris dans un environnement virtuel on n'utilisera pas virtualenv, afin de s'éviter quelque conflits lors de l'installation de django.

En effet :

python --version
Python 3.4.2
virtualenv MonPy3Django -p /usr/bin/python3.4
cd MonPy3Django/
source bin/activate 1.8-3.4
Downloading/unpacking django
  Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
*** Error compiling '/tmp/pip-build-c20d1nfa/django/django/conf/app_template/apps.py'...
  File "/tmp/pip-build-c20d1nfa/django/django/conf/app_template/apps.py", line 4
    class {{ camel_case_app_name }}Config(AppConfig):
          ^
SyntaxError: invalid syntax
 
*** Error compiling '/tmp/pip-build-c20d1nfa/django/django/conf/app_template/models.py'...
  File "/tmp/pip-build-c20d1nfa/django/django/conf/app_template/models.py", line 1
    {{ unicode_literals }}from django.db import models
                             ^
SyntaxError: invalid syntax
 
Successfully installed django
Cleaning up...

Configurer son système avec Python3 pour l'utilisateur courant :

  • On édite le fichier “~/bashrc” :
vim ~/.bashrc
  • On ajoute cet alias :
alias python='/usr/bin/python3.4'
  • On enregistre puis on actualise l'environnement de l'utilisateur courant :
. ~/.bashrc
python --version
Python 3.4.2

Configurations et installation de Django avec SQLite3

Installer Django dans un environnement virtuel avec pyenv

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL
pyenv
pyenv 20151124-16-g132179d
Usage: pyenv <command> [<args>]
 
Some useful pyenv commands are:
   commands    List all available pyenv commands
   local       Set or show the local application-specific Python version
   global      Set or show the global Python version
   shell       Set or show the shell-specific Python version
   install     Install a Python version using python-build
   uninstall   Uninstall a specific Python version
   rehash      Rehash pyenv shims (run this after installing executables)
   version     Show the current Python version and its origin
   versions    List all Python versions available to pyenv
   which       Display the full path to an executable
   whence      List all Python versions that contain the given executable
 
See `pyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/yyuu/pyenv#readme
pyenv install 2.7.9
pyenv install 3.4.3
L'exécution des deux commandes précédentes est longue. Patience…
pyenv versions
* system (set by /home/hypathie/.pyenv/version)
  2.7.9
  3.4.3
* les commandes pyenv
pyenv +lacommande
  • Avoir une liste des commandes pyenv
pyenv
Some useful pyenv commands are:
   commands    List all available pyenv commands
   local       Set or show the local application-specific Python version
   global      Set or show the global Python version
   shell       Set or show the shell-specific Python version
   install     Install a Python version using python-build
   uninstall   Uninstall a specific Python version
   rehash      Rehash pyenv shims (run this after installing executables)
   version     Show the current Python version and its origin
   versions    List all Python versions available to pyenv
   which       Display the full path to an executable
   whence      List all Python versions that contain the given executable
  • Configurer la version du shell pyenv pour choisir sa version de python

- Pour que le shell utilise la version 2 installée plutôt

pyenv shell 2.7.9

- Pour savoir quelle est la version de son shell

pyenv shell
2.7.9

- version de python utilisée

python --version
Python 2.7.9

- Depuis où ?

 which python
/home/hypathie/.pyenv/shims/python

- Pour changer de version de python pour l'environnement virtuel, on fait la même chose avec la version

pyenv shell 3.4.3
python --version
Python 3.4.3
  • Utiliser virtualenv avec pyenv
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
exec $SHELL
  • Créer un répertoire pour django
mkdir MonPython3Django
cd MonPython3Django/
pyenv shell 3.4.3
python --version
Python 3.4.3
pyenv virtualenv 1.8-3.4
Ignoring indexes: https://pypi.python.org/simple
Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/hypathie/.pyenv/versions/3.4.3/envs/1.8-3.4/lib/python3.4/site-packages
Requirement already satisfied (use --upgrade to upgrade): pip in /home/hypathie/.pyenv/versions/3.4.3/envs/1.8-3.4/lib/python3.4/site-packages
pyenv activate 1.8-3.4
pip install django
You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting django
  Downloading Django-1.9-py2.py3-none-any.whl (6.6MB)
    100% |################################| 6.6MB 88kB/s 
Installing collected packages: django
 
Successfully installed django-1.9
(1.8-3.4) hypathie@debian:~/MonPython3Django$ pip install django

Pas d'erreur cette fois 8-)

django-admin.py --version
1.9
pyenv deactivate
 
 

Installer Django dans un environnement python virtuel

On créer un répertoire

virtualenv MonPy3Django -p /usr/bin/python3.4

Cela a crée une dossier nommé “PremiersProjetsDjango” dans le répertoire de l'utilisateur courant

on se place dans le dossier "PremiersProjetsDjango"

cd ~/MonPy3Django/ && ls

Il contient trois dossiers permettant d'utiliser python :

bin  include  lib

Les outils sont dans bin/

tree bin/
bin/
├── activate
├── activate.csh
├── activate.fish
├── activate_this.py
├── easy_install
├── easy_install-3.4
├── pip
├── pip3
├── pip3.4
├── python -> python3.4
├── python3 -> python3.4
└── python3.4

On voit que tout l'environnement pointe vers python3.4

On active l'environnement virtuel python

Pour sortir de l'environnement virtuel python :
deactivate

On installe Django

pip3 install django
  • Et pour vérifier tout en prenant connaissance de la version de django installée :

(selon la méthode proposer par la doc officielle de Django : https://docs.djangoproject.com/fr/1.8/intro/tutorial01/)

python3 -c "import django; print(django.get_version())"
1.9
  • Tout est bien clair ?
deactivate
python3 -c "import django; print(django.get_version())"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'django'
source bin/activate
python3 -c "import django; print(django.get_version())"
1.9
  • Pour avoir la liste de tous les modules python installés dans son environnement :
pip freeze
Django==1.9
wheel==0.24.0

Création d'un premier projet Django

Un petit rappel ?
  1. On a crée un dossier par exemple sur son bureau pour l'environnement virtuel python “virtualenv PremiersProjetsDjango”;
  2. Dans ce dossier on a activé python “source bin/activate” ;
  3. On a installé Django.

À partir de là pour créer un projet Django, il faut aller dans le dossier de l'environnement virtuel python et activer python :

cd ~/Bureau/PremiersProjetsDjango/
source bin/activate
python3 -c "import django; print(django.get_version())"
  • Le contenu de son dossier avant création d'un nouveau projet:
pwd
/home/hypathie/Bureau/PremiersProjetsDjango
ls
bin  include  lib
  • Pour créer un nouveau projet nommé par exemple “premierProjet”:
django-admin.py startproject premierProjet
ls
bin  include  lib  premierProjet
  • Architecture du dossier premierProjet :
cd premierProjet/
manage.py  premierProjet
cd premierProjet/
__init__.py  settings.py  urls.py  wsgi.py
  • Avec la commande tree :
tree premierProjet/
premierProjet/
├── manage.py
└── premierProjet
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

Ces fichiers sont :

  • premierProjet/ c'est le répertoire racine qui est le contenant du projet nouvellement créé.
  • manage.py est un utilitaire en ligne de commande qui vous permet d’interagir avec ce projet Django de différentes façons. Vous trouverez toutes les informations nécessaires sur manage.py dans django-admin et manage.py.
  • Le sous-répertoire premierProjet/ correspond au paquet Python effectif de votre projet. C’est le nom du paquet Python que vous devrez utiliser pour importer ce qu’il contient.
  • premierProjet/init.py : un fichier vide qui indique à Python que ce répertoire doit être considéré comme un paquet (lisez informations sur les paquets (en) dans la documentation officielle de Python si vous êtes débutant avec ce langage).
  • premierProjet/settings.py : réglages et configuration de ce projet Django. Les réglages de Django vous apprendra tout sur le fonctionnement des réglages.
  • premierProjet/urls.py : les déclarations des URL de ce projet Django, une sorte de « table des matières » de votre site Django. Vous pouvez en lire plus sur les URL dans Distribution des URL.
  • premierProjet/wsgi.py : un point d’entrée pour les serveurs Web compatibles WSGI pour déployer votre projet. Voir Comment déployer avec WSGI pour plus de détails.

Pour plus de détails voir la doc officielle de Django : https://docs.djangoproject.com/fr/1.8/intro/tutorial01/

Premier test

  • On se place à la racine du nouveau projet :
cd ~/Bureau/PremiersProjetsDjango/premierProjet/
python3 manage.py runserver
Performing system checks...
 
System check identified no issues (0 silenced).
 
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
 
December 03, 2015 - 12:43:53
Django version 1.9, using settings 'premierProjet.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Rien de grave dans ce retour. Django prévient qu'aucune base de données n'a été migrée. Ce n'est pas important pour ce premier test.

On obtient :


Premier projet avec la base de données sqlite3

  • Par défaut, Django utilise la base de donnée sqlite3 :
~/Bureau/PremiersProjetsDjango/premierProjet/premierProjet
vim settings.py
...
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}
...
  • ENGINE – Par défaut avec sqlite3 : 'django.db.backends.sqlite3'.
    D’autres moteurs sont également disponibles :
    Pour utiliser PoesgreSql : 'django.db.backends.postgresql_psycopg2' ;
    Pour utiliser MySql: 'django.db.backends.mysql';
    Pour utiliser Oracle : 'django.db.backends.oracle'.
  • NAME – Le nom de votre base de données. Avec SQLite, la base de données est un fichier sur votre ordinateur.
    Dans ce cas, NAME doit être le chemin absolu complet de celui-ci, y compris le nom de fichier.
    La valeur par défaut, os.path.join(BASE_DIR, 'db.sqlite3'), stocke ce fichier dans le répertoire de votre projet.

Modifier le fichier settings.py et Générer le fichier de base de données SQLite

  • Modifier les paramètres :
LANGUAGE_CODE = 'fr-fr'

TIME_ZONE = 'Europe/Paris'
  • Avant migration :
tree 
.
├── manage.py
└── premierProjet
    ├── __init__.py
    ├── __pycache__
    │   ├── __init__.cpython-34.pyc
    │   ├── settings.cpython-34.pyc
    │   ├── urls.cpython-34.pyc
    │   └── wsgi.cpython-34.pyc
    ├── settings.py
    ├── urls.py
    └── wsgi.py
  • On lance la commande de migration :
python3 manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying sessions.0001_initial... OK
  • Après migration :
tree 
.
├── db.sqlite3
├── manage.py
└── premierProjet
    ├── __init__.py
    ├── __pycache__
    │   ├── __init__.cpython-34.pyc
    │   ├── settings.cpython-34.pyc
    │   ├── urls.cpython-34.pyc
    │   └── wsgi.cpython-34.pyc
    ├── settings.py
    ├── urls.py
    └── wsgi.py
L'exécution de la commande “manage.py migrate” a permis :
  • de créer à la racine le fichier de base de données nommé par défaut “db.sqlite3”;
  • elle a ajouté au fichier “settings.py ” dans la section “INSTALLED_APPS” la ligne : 'polls',
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'polls',
)
  • À savoir : La commande “makemigrations” permet de mettre à jour les polls (sorte de script SQL), à partir d'un modèle s'il en existe (voir plus bas).
python3 manage.py makemigrations
No changes detected

Création de Modèle (c'est presque du code first !)

  • On se place dans le répertoire “~/Bureau/PremiersProjetsDjango/premierProjet” :
cd ~/Bureau/PremiersProjetsDjango/premierProjet
  • On utilise manage.py pour créé l'arborescence nécessaire à l'utilisation de Modèle :
python3 manage.py startapp polls

Cela a crée le répertoire polls à la racine du dossier consacré au projet django :

pwd
/home/hypathie/Bureau/PremiersProjetsDjango/premierProjet
tree
.
├── db.sqlite3
├── manage.py
├── polls
│   ├── admin.py
│   ├── apps.py
│   ├── __init__.py
│   ├── migrations
│   │   ├── 0001_initial.py
│   │   ├── __init__.py
│   │   └── __pycache__
│   │       ├── 0001_initial.cpython-34.pyc
│   │       └── __init__.cpython-34.pyc
│   ├── models.py
│   ├── __pycache__
│   │   ├── admin.cpython-34.pyc
│   │   ├── __init__.cpython-34.pyc
│   │   └── models.cpython-34.pyc
│   ├── tests.py
│   └── views.py
└── premierProjet
    ├── __init__.py
    ├── __pycache__
    │   ├── __init__.cpython-34.pyc
    │   ├── settings.cpython-34.pyc
    │   ├── urls.cpython-34.pyc
    │   └── wsgi.cpython-34.pyc
    ├── settings.py
    ├── urls.py
    └── wsgi.py
  • On crée des Modèles dans le fichier models.py :
vim polls/models.py
import datetime

from django.db import models
from django.utils import timezone

# Create your models here.

class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')
    def __str__(self):
        return self.question_text
    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days=1)


class Choice(models.Model):
    question = models.ForeignKey(Question)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)
    def __str__(self):
        return self.choice_text
  • Cette fois la commande “makemigrations” ci-dessous, va créer un script de type SQL de creation et/ou mise à jour de la base de données associées au projet, par défaut ce script est le fichier “polls/migrations/0001_initial.py” :
python3 manage.py makemigrations polls
Migrations for 'polls':
  0001_initial.py:
    - Create model Choice
    - Create model Question
    - Add field question to choice
  • L'ORM de Django permet de générer un script de création de base de données avec tables, noms et types des champs, clés primaires et cardinalités…
    Pour voir le script créé à partir des Modèles python (classe):
python3 manage.py sqlmigrate polls 0001
  • Mais c'est la commande suivante qui applique les changements apportés aux Models dans la base de données :
python3 manage.py migrate
  • Pour utiliser l'API Django depuis un shell python :
python3 manage.py shell

Création d'un administrateur Django

  • On se place de le dossier de son projet Django :
cd ~/Bureau/PremiersProjetsDjango/premierProjet/
  • On crée un administrateur :
python3 manage.py createsuperuser
Username (leave blank to use 'hypathie'): Hypathie
Email address: hypathie@gmx.fr
Password: 
Password (again): 
Superuser created successfully.
  • Et maintenant on peut accéder à la gestion de son projet depuis son navigateur :
python3 manage.py runserver 192.168.0.26:8000
Modifier 192.168.0.26 par l'ip de la machine sur laquelle le projet est installé.

Pour le savoir :

ifconfig
  • remarques :
  1. On peut aussi taper dans son navigateur :
    localhost:8000 ou 0.0.0.0:8000 si l'on a lancé :
    python3 manage.py runserver 0.0.0.0:8000
  2. L'avantage de l'ip de la machine c'est de pouvoir se connecter à son application depuis son navigateur depuis une machine distante.
  • On tape dans son navigateur par exemple :
192.168.0.26:8000/admin

Configurer Vim pour Python

  • On installe curl
apt-get install curl
  • On installe git :
apt-get install git-core
  • On installe pathogen

Voir : https://github.com/search?utf8=%E2%9C%93&q=pathogen

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
  • On crée et édite un fichier caché ~/.vimrc :
vim ~/.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on

pathogen va chercher dans le répertoire bundle les plugin qu'on lui a installé et les utiliser comme si on les avait installé dans le fichier .vimrc

  • On installe le module nerdtree :

Voir : https://github.com/scrooloose/nerdtree

git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
Principales commandes de NERD Tree :
  t: Ouvrir le fichier sélectionné dans un nouvel onglet
  i: Ouvrez le fichier sélectionné dans une fenêtre fissure verticale
  s: Open the selected file in a vertical split window
  I: Commutation de fichiers cachés
  m: Pour faire apparaître un menu qui vous permettra d'ajouter rapidement, déplacer(=renomer), copier et supprimer des nœuds (ou fichiers).
  R: Actualiser l'arbre, utile si les fichiers ont changés en dehors de Vim
  ?: Commutation entre l'aide rapide et l'explorateur NERD Tree 
  Ctrl +w puis w: Passer de l'explorateur NERD Tree à la fenêtre d'édition des fichiers
  • On installe vim-airLine améliorer le statusline.
git clone https://github.com/bling/vim-airline.git ~/.vim/bundle/vim-airline

On ajoute la ligne suivante dans ~./vimrc :

let g:airline#extensions#tabline#enabled = 1
  • Après avoir ouvert plusieurs fichiers, pour passer d'un fichier à l'autre, le curseur entant placé dans l'encadré d'édition d'un fichier:
  1. On peut utiliser la commande vim :register puis on choisit son buffer ;
  2. On peut faire :bn (pour Buffer Next) ou :bp (pour Buffer Prevous) ;
  • On peut se faire un racourcit :
  1. On édite ~/.vimrc
  2. on ajoute :
nmap <C-n> :bn<CR>
nmap <C-p> :bp<CR>
  • Pour utiliser la souris
set mouse=a
  • Utilisation de la souris pour naviger entre les fenêtres, et sélectionner dans une seule fenêtre (i.e mode visuel de vim)

On édite ~/.vimrc

On ajoute :

set mouse=a
  • On ajoute le plugin syntastic

Voir : https://github.com/scrooloose/syntastic

git clone https://github.com/scrooloose/syntastic.git ~/.vim/bundle/syntastic
  • On ajoute le plugin tagbar
git clone https://github.com/majutsushi/tagbar.git ~/.vim/bundle/tagbar
Ajout dans ~/.vimrc
"Racourci clavier pour basculer avec Tagbar
nmap <F2> :TagbarToggle<CR>
  • Ajout de l'autocomplétion :
Ajout dans ~/.vimrc
"Pour utiliser un plugin d'autocomplétion
set omnifunc=syntaxComplet#Complete

Configurations et installation de Django avec PostgreSQL

utilisateurs/hypathie/tutos/developpement-pyhon-utiliser-django.1449572665.txt.gz · Dernière modification: 08/12/2015 12:04 par Hypathie

Pied de page des forums

Propulsé par FluxBB