The hbuilder project and page run on the mobile phone | the vue project runs on the mobile phone | the django project runs on the mobile phone

The hbuilder project and page run on the mobile phone | the vue project runs on the mobile phone | the django project runs on the mobile phone

1. The HBuilder project or page runs on the mobile phone:

The running URL of the hbuilder project in the computer browser is generally:

http://127.0.0.1:8848/es6/index.html

Computer test chart:

image-20220126185601185

run on mobile

1. First of all, make sure that the mobile phone and the computer are in the same LAN, and close the computer firewall.

2. Check the computer IPv4 address, cmd–>ipconfig.

3. Mobile phone input

http://IPv4地址:hbuilder页面端口号和端口号后面的
http://192.168.0.107:8848/es6/index.html

Mobile browser test results:

image-20220126185525072

2. The vue project runs on the mobile phone

The running URL of the vue project in the computer browser is generally:

http://localhost:8080

run on mobile

1. First of all, make sure that the mobile phone and computer are in the same local area network.

2. Turn off the computer firewall

Right-click the lower left corner of the computer –> Search –> Firewall. Turn off all firewalls.

image-20220126181500009

3. After vue3 executes the running command, the localhost:8080 that appears is running on the computer, and the one with the ip below can be opened directly on the mobile browser.

image-20220126181906812

Mobile browser interface:

image-20220126182254643

3. The django project runs on the mobile phone

The running URL of the django project in the computer browser is generally:

http://127.0.0.1:8000

run on mobile

1. The mobile phone and computer are in the same LAN, and the computer firewall is turned off.

2. Modify settings.py line 28 ALLOWED_HOSTS.

ALLOWED_HOSTS = ['*',]

3. Enter the following code in the terminal to start the project.

python manage.py runserver 0.0.0.0:8000

image-20220126183608641

4. Enter ipconfig in cmd to view and copy the IPv4 address.

image-20220126183807734

5. Mobile phone input

http://IPv4地址:后端服务器端口号
http://192.168.0.107:8000

Mobile browser test results:

image-20220126183731822

Guess you like

Origin blog.csdn.net/yangyangdt/article/details/122707721