current position:Home>Solve the problem that Django cannot access the local server( http://127.0.0.1:8000/ )Or the problem that the command line execution (Python 3 manage.py runserver 0.0.0.0:8000) does not respond
Solve the problem that Django cannot access the local server( http://127.0.0.1:8000/ )Or the problem that the command line execution (Python 3 manage.py runserver 0.0.0.0:8000) does not respond
2022-04-29 06:22:07【Terry_ Neuer】
List of articles
1、 What happened
I perform python3 manage.py runserver 0.0.0.0:8000
The statement command line did not respond . Online deletion manage.py First line of code for #!/usr/bin/env python
, But it didn't work . The meaning of this sentence should be to tell the operating system to execute this manage.py When , Call this path :/usr/bin Under the Python Interpreter . But if you can't find it , The default is to use the one we created for the project Python Environmental Science . So I think , Deleting this should be useless .
2、 A turnaround
I put python3 manage.py runserver 0.0.0.0:8000
Change the sentence to python manage.py runserver 0.0.0.0:8000
, There was an immediate response . below , I'll go from beginning to end , I'll show you the process in the form of a screenshot . To configure :Window10、Pycharm、Python3.7、 Default installation Python3.7 Corresponding to version Django Latest version .
3、 technological process
pytorch It's me. anconada The environment created for this project , The default interpreter in this project . Because I'm directly in pycharm Use the command line , So I don't think it's necessary for Django Configure virtual environment .
3.1 Install well Django package
The installed version is 3.2.13.
3.2 adopt cmd The operation enters the target directory
Enter my project for Django Created Directory , establish Django project ——HelloWorld.
Run the following code , We can find out Django With our HelloWorld project , Enter this directory . Bear in mind ,cmd When running commands, be sure to pay attention to whether your path is correct .
django-admin startproject HelloWorld
3.3 perform python manage.py runserver 0.0.0.0:8000
python manage.py runserver 0.0.0.0:8000
Wrong report , No problem , Because at least there was a reaction . Read the wrong content carefully , The prompt requires us to perform cmd command :
python manage.py migrate
3.4 perform python manage.py migrate
If you don't report an error, ignore this step .
python manage.py migrate
3.5 display , Successful connection
perform :
python manage.py runserver 0.0.0.0:8000
success ! Shortcut key ctrl+c You can exit the current command line .
Access the default address of the local host server :http://127.0.0.1:8000/
4、 summary
I also have some knowledge points here , Know what it is and don't know why it is , Welcome to discuss 、 To criticize and correct . I will also supplement from time to time , Share what you know and hear .
If you read a lot of blogs, it's useless , See me this works . My pleasure .
Because it's my channel , I want to express my private opinion . Because a lot of technology has been used recently , I especially want to contribute to open source coder Thank you , I firmly Support knowledge payment also Love open source . however , No one has an obligation to serve you for nothing , be neither relative nor friend , There is no truth in the world . Some coders on the Internet don't know the spirit of open source at all, so they burst out , This can only appear Your dish And incompetence rage . Besides , Stop plagiarism , It is also the bottom line of open source and knowledge sharing .
As a small blogger , Only pay attention to one 's own moral uplift without thought of others , I just hope this blog can help you .
copyright notice
author[Terry_ Neuer],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/116/202204260949094314.html
The sidebar is recommended
- Singleton mode - front end design mode
- QT sets that child elements do not inherit the parent style
- Using react to realize comment function
- Front end Vue template
- Front end vuejs set sail
- Front end Vue data binding and MVVM
- Vue data proxy and hijacking in front end
- Vue style of front end
- Front end Vue event handling
- Principle of Vue monitoring data change in front end
guess what you like
Vue calculation attribute and monitoring attribute of the front end
Front end Vue conditional rendering and list rendering
The front-end Vue collects form data
Vue built-in instruction of front end
Unknown HttpClient factory netty at org. openqa. selenium. remote...
Where is the user information obtained by the front end
What is the gutter principle of Ant Design Vue a-row
Element form account password
CSS to add horizontal lines around the text
Solution to vscode Vue project always reporting space or semicolon warning
Random recommended
- [entry DIARY 7 - ref of react]
- React - higher order functions and controlled components
- Calling setcookie in Ajax fails without any error in the IDE
- Differences, advantages and disadvantages between Ajax and Axios
- Choose Java or front-end for training and learning
- Simple sorting of JavaScript deep copy and shallow copy
- Analysis of event loop mechanism in JavaScript
- Epidemic prevention and control system of front and rear end separation based on Vue + nodejs
- Implementation of enterprise personnel management system by separating the front and back ends of springboot + Vue
- Vue difference between two arrays
- Vue openlayer add wind farm effect
- How to get child nodes of elements in HTML
- The file code with HTML suffix of vscode is not highlighted
- Use the table in Vue element admin in Vue admin template?
- [JavaScript] convert numerical value to numerical value
- Differences, advantages and disadvantages between Ajax and Axios
- Quietly tell you: the wrong place in react18 document
- The new smart spirit 1 starts in Asia! Breaking 100 in 6.7 seconds + frameless door, 190000 pre-sale
- Analysis of event loop mechanism in JavaScript
- Error occurred when installing vant on webstorm
- With the blessing of tinnove system, Changan uni-v does not have its own table
- Judging the application direction of small flat wire motor from SM 4x4 driverless technology verification vehicle
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- React bread crumbs
- HTTP network protocol
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Use of vuex
- Element UI El table modify input value view not updated
- Getsnapshotbeforeupdate example of react
- Recently, the MySQL server on the cloud was hacked. It took 20 minutes to modify the password after being mercilessly encrypted. This time I'll be hacked with your last name
- Java project: sporting goods Mall (java + springboot + jsp + HTML + Maven + MySQL)
- Java project: shared study room reservation management system (java + springboot + thymeleaf + HTML + Maven + MySQL)
- Java project: sporting goods Mall (java + springboot + jsp + HTML + Maven + MySQL)
- Java project: shared study room reservation management system (java + springboot + thymeleaf + HTML + Maven + MySQL)
- Sennheiser momentum true wireless 3 true wireless headphones will be available on May 10
- Coffeescript 2.7.0 release, JavaScript translation language
- Im instant messaging development: load balancing of high-performance HTTP server