[Answer]-Starting a new django project on qpython

1👍

Since I haven’t gotten any answer from anyone I come up with the following in case anyone has the same 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"

Thank you

👤njmwas

0👍

download this version of django using pip.

pip install django==1.8.16

It works for me

👤Jerk

Leave a comment