In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to install django, I hope you will get something after reading this article. Let's discuss it together.
To install the python installation tool pip, you can first check to see if django is installed.
Sudo apt-get install python-pip
two。 Installing a virtual python environment will not affect the current python environment.
Sudo apt-get install python-virtualenvmkdir ~ / django # create a separate directory for working python (arbitrary name) virtualenv env # run the command virtualenv env to create a pyhton independent environment called env (arbitrary name), which does not interact with the native python environment. Source env/bin/activate # enables the env environment. Pip install-I http://mirrors.aliyuncs.com/pypi/simple django==1.4 # installs version 1.4 of django
3. Check the installation of Django
Enter the python environment > import django > django.VERSION
Create a project (project)
Django's project is an example of Django, including a series of settings, such as database settings, Django-specific options, and some configurations for your program. If you are using Django for the first time, you need to do some initialization work.
Create a new working directory:
Mkdir ~ / work go to the directory you just created django-admin.py startproject mysite # this command will create a mysite subdirectory under the current directory tree ~ / work # observe the structure of the work directory
Running the development server
Cd mysitepython manage.py runserver this way, you have a listening port 8000 on your computer that accepts only servers that send local connections from your own computer. With the server, you can now use a browser to access http://127.0.0.1:8000/python manage.py runserver 8080 # and modify the port. After reading this article, I believe you have a certain understanding of "how to install django". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.