Quelques outils utiles pour django sous Ubuntu - "Debugging"
Par Samuel MARTIN le mercredi, 20 janvier 2010, 12:43 - Programmation - Lien permanent
Travaillant désormais depuis plus de neuf mois avec le framework django sur le prochain logiciel Opquast, je me permets, aujourd'hui, de fournir très modestement quelques retours d'expérience. Naturellement, toutes les étapes, les logiciels présentés ci-dessous sont compatibles avec la distribution Ubuntu. Pour MacOsX de simples adaptations semblent suffisantes, enfin pour Windows je vous laisse canoter. Cet article présente l'ensemble des outils me permettant de "débugger", tester plus rapidement du code "django / python".
Attention, l'ensemble des manipulations qui vont suivre peuvent rendre votre système d'exploitation Ubuntu instable. L'utilisation du compte admistrateur (commande sudo...) suscitent des risques pour lequel je décline toute responsabilité.
Le terminal python de base
De base, Django fournit un outil, certes basique mais ô combien utile, le "TERMINAL". Ce dernier se lance via la commande python manage.py shell, uniquement si django est installé . Via l'interpréteur intéractif, le shell ou terminal, vous pouvez tout tester, instanciation de classe, concaténation de chaine, boucle for, conditions... Très rapidement on se rend compte qu'il manque : la coloration syntaxique pour s'y retrouver, un historique des commandes précédemment tapées, les bons imports initiaux, l'indentation automatique, la complétion. Bref on est face au bon vieux terminal type MS-DOS (allez, ...en un peu mieux).
Installation ipython
Il manque l'indentation automatique, l'historique, la complétion des objets, la coloration, aucun problème installez ipython via synaptic ou via la bonne vieille commande habituelle sudo aptitude install ipython. Aucune configuration supplémentaire l'interpréteur python est automatiquement "amélioré" tout comme l'interpréteur django, en effet ce dernier repose sur celui de python.
Mise à jour de django shell vers django shell_plus
- Télécharger le pack contenant shell_plus à l'adresse django-command-extensions
- Dézipper l'archive précédemment récupérés
- Via un terminal, tapez la commande
sudo python setup.py install(cela fonctionne si django a été installé de la même manière, ou est situé dans/usr/local/lib/python2.6/dist-packages/)

Au lancement de la commande l'ensemble des modules déclarés dans votre fichier de configuration settings.py sont automatiquement chargés, voir screenshot ci-dessus. On gagne un temps incroyable
Connaître les attributs et les méthodes d'un objet
Cette solution est très simple, mais pour l'instant je n'ai pas trouvé mieux.
- Démarrez un terminal django : python manage.py shell_plus
- Instancier votre objet : article = Article()
- Saisissez article. puis appuyer sur la touche "Tabulation de votre clavier", le terminal liste ainsi l'ensemble des attributs, méthodes disponibles

Guake : Un terminal toujours sous la main
Enfin pour aller plus loin, je vous renvoie à l'installation de l'excellent terminal guake via sudo apt-get install guake. Guake via le raccourci "F12" est disponible depuis n'importe quel bureau, hautement pratique, surtout si comme moi, vous utilisez plusieurs bureaux.
Commentaires
merci je ne connaissais pas shell_plus
ton lien vers celui-ci ne fonctionne pas
Oui, merci c'est corrigé
bpython > ipython...
si tu veux un shell qui pète j'ai bien essayé les deux... bpython avec la coloration temps réel, l'export pastebin, la possibilité de revenir à la ligne précédente, et une complétion "agressive" (dans le sens ou elle est permanante et sans avoir à appuyer sur tab).
http://bpython-interpreter.org/scre...
amusez vous bien ^^.
Some students pass the responsibility to qualified resume writers because they don't have the skill to write a satisfactory resume so the cause why customers
need to <a href="http://www.prime-resume.com">buy resume</a>, but such guys like writer don't do that. Thanks a lot for the knowledge. A kind of perfect knowledge about this good topic.
AMAZING! Great post! Thank you for sharing!
merci je ne connaissais pas shell_plus
ton lien vers celui-ci ne fonctionne pas
Thanks a lot for the knowledge.
I like this stuff!
En fait, j'aime la lecture court texte en français. D'une certaine manière je apprendre à parler la langue.
Je viens de découvrir django et je trouvais qu'il manquait d'outils de debug.
Alors : Merci!
There are some specific things that are not mentioned here. I will look for more details because I didn't hear about it before.
I dissagree with some comments. They talk about different things, looks like they didn't even read your article.
looks like they didn't even read your article.
J'adore votre solution! La simplicité est génial!
http://www.uggsboot.us
Unlike the boots
Très bon article, merci beaucoup !!
Thanks for sharing this.
Keep up the good work.
Je viens de découvrir django et je trouvais qu'il manquait d'outils de debug.
Alors : Merci!
Thanks for sharing the information , It is useful, i like it!I hope you do better and better on your website, And popular more and more!
merci je ne connaissais pas shell_plus
ton lien vers celui-ci ne fonctionne pas
I didn't use this tools before.. but let me try atleast one time for Django
Truly impressive post about "Quelques outils utiles pour django sous Ubuntu - "Debugging"
I propose not to hold off until you get enough amount of money to order all you need! You should just take the home loans or just consolidation loans and feel yourself free
Simple, clever. and very useful.
I just found django and I thought it lacked debug tools.
So: Thanks!
When I have rationalized the realistic way to solve that over time that it starts to blend three years ago. Yes, it will be evaluated with a presentation
http://www.8800siroccogold.com
http://www.a520cellphone.com
http://www.acircuitbyeaker.com
http://www.accountingshenzhen.com
http://www.computerpowersupplier.co...
http://www.arizonacardicals.com
http://www.arizonacardicalsjerseys....
http://www.artificiallimbcompany.co...
http://www.artificialprosthetics.co...
Thanks for sharing the information , It is useful, i like it!I hope you do better and better on your website, And popular more and more!
The post has been excellent and I have referred it to many of my friends.
http://shirtsdress.com - http://chenillebedspreads.org
merci
I appreciate your effort in posting this very informative article , thanks a lot !
The successful scholars will learn your idea close to this good topic and order the doctoral thesis from the <a href="http://www.master-dissertations.com">thesis service</a>.
Now, a lot of college students are assured that the <a href="http://primeessays.com/index.php?mo...">custom write</a> service would be the best point to purchase academic essay at. Furthermore, it's really good way to save time and money!
To my mind, it's a good idea to mobilize students for short-term missions, as they can understand their role in society.
Are willing to save yourself from going to summer shool? The papers a brilliant <a href="http://primeessays.co.uk">essays uk</a> service is able to compose would impress your tutor.
It seems to be difficult to create premium quality course papers, particularly when you're the first year student. However, it is not the end of your career because you can always order <a href="http://essaysprofessors.com/coursew...">coursework online</a>. Moreover, custom writing organizations can be always available to help you.
This takes lots of work and time to create the thesis topic close to this topic, hence, we like better to look for the <a href="http://www.exclusivethesis.com">thesis</a> service to have the good grade.
Very oft it happens that you stay only one with your writing problems. Nevertheless, you're not alone just because you can turn to professional papers writing corporation and buy essay. It is much better to take exterts' support than to try to cope with writing assignments yourself.
Hello, I found your blog in a new directory of blogs. I dont know how your blog came up, must have been a typo, Your blog looks good. Have a nice day.
Wonderful post about "La voiture, l'emploi et l'argent", thanks for putting this together! "This is obviously one great post.
This is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the good work.
One of my friends told me to read through your release and it used to be fantastic. I wondered if that used to be possible to buy <a href="http://www.exclusivepapers.com">custom essay</a> of the same quality at the <a href="http://www.exclusivepapers.com">term papers</a> composing companies. Just because, this was usually great to get customized essays.
Thanks a lot for this sharing this codes. I look forward to see more of this in the future.
Your blog looks good. Have a nice day.The blog was absolutely fantastic!
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
she went to that music establishment to purchase some chips
I dissagree with some comments. They talk about different things, looks like they didn't even read your article.
An online career service for a freelance writers and researchers. It goals is to provide writing jobs in any skilled writers. If you are a freelance writer having an edge of academic writing jobs then Prospect solution is fit and right for you!
It's great that your site gives worthy info for your visitors. As it seems to me, you are a real expert in that you’re discussing. As a constant visitor of your blog it must be confessed that your writing skills are actually improving.
When you are frustrated and do not know the best way to compose the <a href="http://www.supremeessays.com/academ...">academic custom essay service</a> papers, you would to <a href="http://www.supremeessays.com/order-...">order essay</a> in the progressive research paper writing service. That will save free time.
Thanks for share a such a nice information..
Thank you for taking time to share this information with us.
if you want a shell that fart I tried both ... bpython staining with real time, export pastebin the opportunity to return to the previous line, and completion "aggressive" (in the sense that it is permanante and without having to press tab).
It is good to read your post. I thank you to help making people more aware of possible issues. Great stuff as usual.
It was good to read your post and I will be coming here frequently to read more of your post. Thank you very much for your post once more.
Thanks for sharing.
yeah, i have to agree this is a good post that is very informative. going forward, i will check your post regularly
I'm very happy to find this blog, I couldn't discover any valuable info on this issue before. Thumbs up! How good of you! It's perfect, very useful information and nice design you've got here! Tons of valuable info, nice and pleasant design.
Great blog to follow and read for us
Good post Buddy!!!!