3 ms·
Ok , so I created a folder called "Weiqi" in my home directory. (named after the game I am best at!) Then I typed the command $ cd Weiqi in the "Terminal" Cai
by CaiGengYang 11y ago
Ok , so I created a folder called "Weiqi" in my home directory. (named after the game I am best at!)
Then I typed the command $ cd Weiqi in the "Terminal"
CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd Weiqi --- input
and got this output :
CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ --- output
Then I ran the following command in the Terminal :
$ django-admin startproject mysite.
This created a mysite folder which appeared inside the original Weiqi folder in my home directory.
When I clicked on the mysite folder, there is a manage.py file and another mysite folder inside the original mysite folder.
When I click on the mysite folder, there are 4 files in it : __init__.py , settings.py , urls.py and wsgi.py.
The next chapter of the tutorial says this :
"Where should this code live?
If your background is in plain old PHP (with no use of modern frameworks), you’re probably used to putting code under the Web server’s document root (in a place such as /var/www). With Django, you don’t do that. It’s not a good idea to put any of this Python code within your Web server’s document root, because it risks the possibility that people may be able to view your code over the Web. That’s not good for security.
Put your code in some directory outside of the document root, such as /home/mycode."
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" ?