Django (Python Web Framework) Tutorial

Cai Gengyang gengyangcai at gmail.com
Sun Sep 27 06:12:21 CEST 2015


On Sunday, September 27, 2015 at 11:46:13 AM UTC+8, John Gordon wrote:
> In <1421a34f-d8cc-4367-adab-2c2b46504d72 at googlegroups.com> Cai Gengyang <gengyangcai at gmail.com> writes:
> 
> > Question : I am a little confused about the last paragraph : What exactly
> > is a "directory outside of the document root, such as /home/mycode." and
> > how do you "Put your code in this directory" ?
> 
> Django is a web application framework.  So, you have to use it together with
> a web server.  The "document root" is the directory where the web server
> expects to find files to be served as web pages.
> 
> You said you put the Django project code in a subdirectory of your home
> directory.  That should be fine.
> 
> -- 
> John Gordon                   A is for Amy, who fell down the stairs
> gordon at panix.com              B is for Basil, assaulted by bears
>                                 -- Edward Gorey, "The Gashlycrumb Tinies"


Ok.

As for the next chapter(Database setup), I opened up mysite/settings.py as per the instructions on the Django tutorial.

However, when I try to run the following command : $ python manage.py migrate to create the tables in the database,

CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate ---- input

I get the following error message :

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'manage.py': [Errno 2] No such file or directory ---- output

Any idea how to solve this issue?

Thanks a lot !

Gengyang


More information about the Python-list mailing list