1 how to Install Django Mac Os X ?

Опубликовано: 01 Октябрь 2024
на канале: tutorials for beginner Adobe photoshop, Javascript
23
1

Www.djangoproject.com. This class will introduce you to Django version 110. Hopefully. To get there. I hope you'll be able to use this to make money. Go to www.djangoproject.com. This class will introduce you to Django version 110. Django is a framework that is written in the Python programming language. Remember, programming is about rolling with the punches. If you get an error, Google it. The first couple links will normally solve the problem. Let's get started with giant and go 1.10. Open your terminal to list out folders in your current directory type LS. To change into the desktop directory Type CD desktop. CD stands for Change directory, allowing the user to navigate the desktop. We want to install a virtual environment. Virtual environment allows us to keep our project dependencies separate before we can install our virtual environment. We first have to install PIP. It is a tool for installing and managing Python packages. To install PIP type. Sudo easy under score install. When you use the sudo command, you may need to type in your administrator password. We can now use PIP to install our virtual environment. Type sudo pip install virtual EN B to create a new virtual environment. Run virtual envy. Triten. I've named this virtual environment tritent, although you can name your virtual environment anything you want. My virtual environment has been created. I can now see it on my desktop. Go back to your terminal. Change into that right end directory by typing CD tritent. Activate the virtual environment on OS X type source bin Slash activate. Windows activate virtual environment type. Back slash scripts back slash activate. I know my virtual environment is running because I can see the directory name in brackets whenever you work on this project. Make sure your virtual environment is active. Running the command Pip freeze will allow me to see what packages are installed on my virtual environment, so type PIP freeze. We currently don't have any project dependencies installed to list out all the folders and files in this directory LS. Inside of that right end directory I have three folders, then include and live. I also have one file hip self check dot Jason. Go to your desktop and click on the try 10 folder. These are the same files that I just listed out in our terminal, so that's how we use terminal to navigate through our directories. So now I'm going to install Django, run Pip install Django. Equal equal 1.10. Django is now downloading and installing. You can use any text editor you like. However for this project I will be using sublime text. Open up your browser and go to www.sublimetext.com. I'll be downloading the free OSX version of the sublime text. In your terminal, type it freeze. Django version 1.10 was installed. You can use another version of Django, but you may need to read that version documentation to see any differences. Django 2 should be coming out around December 2017 when Django 2 is launched. I'll fully update this course. I'm going to create a new Django project type Django slash admin dot PY, start project tritent. I called this project right N. You name it, whatever you want, I'm gonna navigate into the tritent directory. Alex. You can see the new Django project called Tritent. Navigate into the Django project Type CD, try 10. List out all of the folders and files and tritent type LS. The project is the directory that contains manage dot PY in that right end directory I see manage PY. Therefore I know I'm in the root of the project. In Django 1.10 to sync the database type Python manage dot PY. Migraine. I'll discuss migration more in detail later. The first time you run migrate, a prompt will appear asking if a superuser should be created. Type yes. Taking the username. Email and a password twice. You aren't prompted to create a Django superuser type Python manage dot PY create superuser, then fill out your details. From your desktop, open the virtual environment tritent folder with Vine. Click on the Django application folder tritent. The database is synced. A file called DB dot SQ Lite 3 automatically created. Launch.