简体   繁体   中英

How do I properly set up a django project in OSx?

I have a background in programming with python but I really would like to start playing around with django but I have had difficulty setting up a project.

I know that I have django installed but the command django-admin is not recognized. I believe this has something to do with the way my path is set up. I still feel clumsy about setting up correct paths, so a clear explanation of this would be greatly appreciated.

I also understand that it is advisable to set everything up within a virtual environment. I believe that I have pip installed which should enable virtualenv to be recognized, unfortunately the virtualenv command is also not recognized. I feel like I'm missing something very basic. Any help on setting up these basics would be very greatly appreciated.

You shouldn't do anything with paths at all, other than setting up a virtualenv. If you have pip, you can install virtualenv with sudo pip install virtualenv (and note that this is the last thing you should install with sudo pip ; everything else after that should be inside an activated virtualenv).

I suggest you use virtualenv - look here: Python - Virtualenv , python 3?

Then after you source the env you simply do a pip install Django .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM