Install Django in Python and Run a Project

Hello guys! Recently, I got some requirements that pieces of people in the university are going to do a joint project using python. For your guys quickly setting up, here are some tips to install and use Django step by step.

Pre-required:  
1. Pycharm Community
2. Python interpreter
3. pip >= 19.0.x (package management tool)
4. setuptools >= 40.8.x
5. Usable python environment

Django Install

  1. Turn on Pycharm and create a new folder with any name you want to store your project.

  2. At the bottom, click Terminal.

  3. Input command pip install Django (NOTICE: python is case-sensitive).

  4. After installing sucessfully, you will get these in your Package. (Using pip list to check you package) Install_Django_in_Python_and_Run_a_Project_1.png

  5. And then, start your first project. Here is command django-admin startproject xxxx(project name). (I use DjangoTest as an example) Install_Django_in_Python_and_Run_a_Project_2.png

  6. Next, change your directory to “DjangoTest” using cd DjangoTest.

  7. Now it’s time to run your initial project. In terminal, input following command python manage.py runserver 127.0.0.1:8000 (If you do not have special requirements or preference, just do as I suggest).

  8. After you get the following picture, you have started your first Django project. Install_Django_in_Python_and_Run_a_Project_3.png

So far, you have run a new Django project on your local server successfully. Hopefully, it helps.

猜你喜欢

转载自blog.csdn.net/Moses_SU/article/details/127594903