# Django-admin

**URL:** <https://www.debian-fr.org/t/django-admin/57377>\
**Category:** Programmation\
**Created:** [Février 21, 2016, 2:41 UTC](https://www.debian-fr.org/t/django-admin/57377 "2016-02-21T14:41:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![confiance](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@confiance](https://www.debian-fr.org/u/confiance)\
**Post date:** [Février 21, 2016, 2:41 UTC](https://www.debian-fr.org/t/django-admin/57377/1 "2016-02-21T14:41:59Z")

</div>

Bonjour,  
Fraichement sorti de l’oeuf j’aurais aimé apprendre à programmer un peu, en python et notamment avec le framework django.  
Python v2.6  
J’ai installé django v1.2.3 depuis les dépôts avec apt-get, et je reste bloqué ici sur la [documentation](https://docs.djangoproject.com/en/dev/intro/tutorial01/)

[code]Creating a project  
If this is your first time using Django, you’ll have to take care of some initial setup. Namely, you’ll need to auto-generate some code that establishes a Django project – a collection of settings for an instance of Django, including database configuration, Django-specific options and application-specific settings.

From the command line, cd into a directory where you’d like to store your code, then run the following command:

django-admin.py startproject mysite  
This will create a mysite directory in your current directory. If it didn’t work, see Problems running django-admin.py.[/code]

Je vais donc ici [If it didn’t work, see Problems running django-admin.py.](https://docs.djangoproject.com/en/dev/faq/troubleshooting/#troubleshooting-django-admin-py)

voilà les messages d’erreur sur différentes commandes:

[code]\>\>\> import django

> > > django-admin startproject website  
> > > File «&nbsp;&nbsp;», line 1  
> > > django-admin startproject website  
> > > ^  
> > > SyntaxError: invalid syntax  
> > > django-admin.py startproject website  
> > > File «&nbsp;&nbsp;», line 1  
> > > django-admin.py startproject website  
> > > ^  
> > > SyntaxError: invalid syntax  
> > > django-admin.py  
> > > Traceback (most recent call last):  
> > > File «&nbsp;&nbsp;», line 1, in   
> > > NameError: name ‹&nbsp;admin&nbsp;› is not defined

[/code]  
le $path de mon terminal est /home/user et

[code]\>\>\> import sys

> > > from pprint import pprint as pp  
> > > pp(sys.path)  
> > > [‹&nbsp;&nbsp;›,  
> > > ‹&nbsp;/home/user&nbsp;›,  
> > > ‹&nbsp;/home/user/python&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/plat-linux2&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/lib-tk&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/lib-old&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/lib-dynload&nbsp;›,  
> > > ‹&nbsp;/usr/local/lib/python2.6/dist-packages&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/dist-packages&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/dist-packages/PIL&nbsp;›,  
> > > ‹&nbsp;/usr/lib/python2.6/dist-packages/gst-0.10&nbsp;›,  
> > > ‹&nbsp;/usr/lib/pymodules/python2.6&nbsp;›,  
> > > ‹&nbsp;/usr/lib/pymodules/python2.6/gtk-2.0&nbsp;›]  
> > > [/code]

J’attends votre aide. Merci

---

<div class="post-metadata">

**Author:** ![debianhadic](https://www.debian-fr.org/user_avatar/www.debian-fr.org/debianhadic/32/3870_2.png) [@debianhadic](https://www.debian-fr.org/u/debianhadic)\
**Post date:** [Février 21, 2016, 2:42 UTC](https://www.debian-fr.org/t/django-admin/57377/2 "2016-02-21T14:42:03Z")

</div>

Alors :  
1 - Résultat de : $\> which [django-admin.py](http://django-admin.py)  
2 - Résultat de : $\> which [manage.py](http://manage.py)  
3 - Si les résultats te parlent (fichier trouvé)  
4 - En ligne de commande : $\> [django-admin.py](http://django-admin.py) startwebproject MyFirstOne

ligne de commande = Sous Unix, pas dans l’interpréteur python !!

---

<div class="post-metadata">

**Author:** ![confiance](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@confiance](https://www.debian-fr.org/u/confiance)\
**Post date:** [Février 21, 2016, 2:42 UTC](https://www.debian-fr.org/t/django-admin/57377/3 "2016-02-21T14:42:12Z")

</div>

[quote=«&nbsp;debianhadic&nbsp;»]Alors :  
1 - Résultat de : $\> which django-admin.py  
2 - Résultat de : $\> which manage.py  
3 - Si les résultats te parlent (fichier trouvé)  
4 - En ligne de commande : $\> django-admin.py startwebproject MyFirstOne

ligne de commande = Sous Unix, pas dans l’interpréteur python !![/quote]

Merci de vous penchez sur mon cas.

which django-admin.py manage.py ne donne rien.  
en revanche which django-admin si. /usr/bin/django-admin  
Donc je devais passer par le terminal pour cette commande: django-admin startproject monprojet.

> [@](#):
>
> From the command line, cd into a directory where you’d like to store your code, then run the following command

Je reviendrais très certainement vous solicitez (ou alors j’irais acheter des lunettes)

Encore merci!

---

<div class="post-metadata">

**Author:** ![debianhadic](https://www.debian-fr.org/user_avatar/www.debian-fr.org/debianhadic/32/3870_2.png) [@debianhadic](https://www.debian-fr.org/u/debianhadic)\
**Post date:** [Février 21, 2016, 2:42 UTC](https://www.debian-fr.org/t/django-admin/57377/4 "2016-02-21T14:42:13Z")

</div>

Après ton startproject tu auras un fichier [manage.py](http://manage.py) et c’est celui-la que tu utiliseras pour ton projet.

---

<div class="post-metadata">

**Author:** ![M3t4linux](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@M3t4linux](https://www.debian-fr.org/u/M3t4linux)\
**Post date:** [Février 21, 2016, 2:42 UTC](https://www.debian-fr.org/t/django-admin/57377/5 "2016-02-21T14:42:15Z")

</div>

Apparemment, Django est LE framework web pour toi 😉 (tout du moins en python…)

---

<div class="post-metadata">

**Author:** ![debianhadic](https://www.debian-fr.org/user_avatar/www.debian-fr.org/debianhadic/32/3870_2.png) [@debianhadic](https://www.debian-fr.org/u/debianhadic)\
**Post date:** [Février 21, 2016, 2:42 UTC](https://www.debian-fr.org/t/django-admin/57377/6 "2016-02-21T14:42:15Z")

</div>

y’en a d’autres ? 😉

---

<div class="post-metadata">

**Author:** ![Keldath](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/k/f17d59/32.png) [@Keldath](https://www.debian-fr.org/u/Keldath)\
**Post date:** [Février 21, 2016, 2:42 UTC](https://www.debian-fr.org/t/django-admin/57377/7 "2016-02-21T14:42:19Z")

</div>

Bonsoir,

Juste une petite note, prends garde à utiliser la documentation en ligne de la version que tu utilises, ici la 1.2 :  
[https://docs.djangoproject.com/en/1.2/intro/tutorial01/](https://docs.djangoproject.com/en/1.2/intro/tutorial01/)  
Même si cela ne doit pas changer grand chose, ça peut éviter des surprises. Sinon installe le paquet python-django-doc (installée dans /usr/share/doc/python-django-doc/), l’avantage est que Debian y a effectué le renommage des scripts tel que [django-admin.py](http://django-admin.py) en django-admin.
