creating project in Django

115 views
Skip to first unread message

Mariusz Wilk

unread,
Aug 9, 2014, 12:21:14 PM8/9/14
to django...@googlegroups.com
according to the official tutorial I need to type the following to the cmd in the directory where I want to create my project.:
django-admin.py startproject mysite
I created a folder named "site" on my desktop, cd into it and typed the obove command. Nothing appeared in "site". Instead, Python authomatically opened with the following:


#!C:\Python27\python.exe
from django.core import management

if __name__ == "__main__":
    management.execute_from_command_line()


Do you know what's going on?

Collin Anderson

unread,
Aug 9, 2014, 12:27:22 PM8/9/14
to django...@googlegroups.com
Try this:

python django-admin.py startproject mysite


Collin Anderson

unread,
Aug 9, 2014, 12:29:56 PM8/9/14
to django...@googlegroups.com
This might also work, without the .py:

django-admin startproject mysite

Mariusz Wilk

unread,
Aug 9, 2014, 1:03:26 PM8/9/14
to django...@googlegroups.com
the first one returns: No such file or directory
the second one: Not recognised as a command (my translation from Polish)


This worked before (a week ago):
django-admin.py startproject mysite
But then I deleted the whole mysite folder (cause of some problems) and started all over again. Now I can't even start a new project.  

Mariusz Wilk

unread,
Aug 10, 2014, 7:45:53 AM8/10/14
to django...@googlegroups.com
I even uninstalled Django and installed it again. But the problem (from the first post) remains.

Kelly Nicholes

unread,
Aug 10, 2014, 9:59:06 AM8/10/14
to django...@googlegroups.com
Django-admin has to be on your environments path. Find where your Django-admin.oh file is and do the whole path. python c:\...\Django-admin.python startproject myproject. Maybe you forgot to activate your virtualenv?

Sorry about random capitalization. Typed on my phone.

Collin Anderson

unread,
Aug 11, 2014, 9:38:58 AM8/11/14
to django...@googlegroups.com
my guess is your python installation is messed up, which is why it's opening IDLE instead of running your program. reinstalling python might fix it.
Reply all
Reply to author
Forward
0 new messages