2014-06-23 4 views
0

J'ai installé qpydjango sur mon téléphone Android et l'exemple de projet fonctionne parfaitement. J'ai essayé de démarrer un nouveau projet (site Web django) mais je n'ai pas réussi. J'ai essayé de courir "django-admin.py startproject monsite" mais je reçois cette erreurDémarrage d'un nouveau projet django sur qpython

syntax error or django is not defined.

+0

est-il ou la syntaxe SINTAX? – Idris

+0

Salut Idris, merci pour la réponse rapide. C'est la syntaxe – njmwas

+0

Si c'est sur votre téléphone Android, peut-être vérifier l'échange [Android] (http://android.stackexchange.com/) – Idris

Répondre

1

Puisque je n'ai reçu aucune réponse de quelqu'un, je trouve ce qui suit au cas où quelqu'un aurait la même question.

#qpy:console 
import os 
import os.path 

projectname=raw_input("Enter project name: ") 
projectdir="/mnt/sdcard/com.hipipal.qpyplus/projects/"+projectname 

if os.path.exists(projectdir): 
    print "sorry project '"+projectname+"' already exists" 
else: 
    print "Starting django project '"+projectname+"'" 
    os.makedirs(projectdir) 
    os.system("cd /mnt/sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages/django/bin && python django-admin.py startproject "+projectname+" "+projectdir) 

    appname=raw_input("Enter your first app name: ") 
    print "Starting the first django app '"+appname+"'" 
    os.system("cd "+projectdir+" && python manage.py startapp "+appname) 

    print "You project and first app started successfully" 
    print "Find the project here '"+projectdir+"'" 
    print " and edit settings.py as necessory" 
    print " then run python manage.py runserver to start" 

Merci

0

télécharger cette version de django à l'aide de pépin.

pip install django==1.8.16 

Il fonctionne pour moi

Questions connexes