import os
import subprocess
import sys

project_name = sys.argv[1]
new_project = "django-admin.py startproject "
new_app = "python manage.py startapp "

class Chdir:
      def __init__( self, newPath ):
        self.savedPath = os.getcwd()
        os.chdir(newPath)

      def __del__( self ):
        os.chdir( self.savedPath )

print "installing django.."
subprocess.call("pip install django", shell=True)
print "Django installed"

print "creating project", project_name, "..."
subprocess.call(new_project+project_name, shell=True)

os.chdir(project_name)
print "project created"

is_app = raw_input("Do you want to create new app?(y/n):")

if is_app == ('y' or 'Y'):
	app_name = raw_input("Provide valid app name:")
	print "creating app..."
	subprocess.call(new_app+app_name, shell=True)
	print app_name, "created."

print "We're done!"

@@ -31,16 +31,28 @@
 port sys
+%0Aimport time
 %0A%0Aprojec
@@ -158,16 +158,62 @@
 tapp %22%0A%0A
+SETTINGS_FILE = project_name+%22/settings.py%22%0A%0A%0A
 class Ch
@@ -217,18 +217,17 @@
  Chdir:%0A
-  
+%0A
     def 
@@ -235,17 +235,16 @@
 _init__(
- 
 self, ne
@@ -248,17 +248,16 @@
  newPath
- 
 ):%0A     
@@ -319,18 +319,16 @@
 h)%0A%0A    
-  
 def __de
@@ -335,14 +335,12 @@
 l__(
- 
 self
- 
 ):%0A 
@@ -355,17 +355,16 @@
 s.chdir(
- 
 self.sav
@@ -373,10 +373,351 @@
 Path
- 
 )
+%0A%0A%0Adef add_installed_app(filein, fileout):%0A    f = open(filein, 'r')%0A    filedata = f.read()%0A    f.close()%0A    olddata = %22'django.contrib.staticfiles',%22%0A    newdata = %22'django.contrib.staticfiles',%5Cn%5Ct'%22+app_name+%22',%22%0A    replaced_data = filedata.replace(olddata, newdata)%0A%0A    f = open(fileout, 'w')%0A    f.write(replaced_data)%0A    f.close()%0A
 %0A%0Apr
@@ -1054,17 +1054,20 @@
 r 'Y'):%0A
-%09
+    
 app_name
@@ -1106,17 +1106,20 @@
 name:%22)%0A
-%09
+    
 print %22c
@@ -1134,17 +1134,20 @@
 app...%22%0A
-%09
+    
 subproce
@@ -1188,9 +1188,12 @@
 ue)%0A
-%09
+    
 prin
@@ -1214,16 +1214,68 @@
 reated.%22
+%0A    add_installed_app(SETTINGS_FILE, SETTINGS_FILE)
 %0A%0Aprint 

add app name in INSTALLED_APPS