Julio Cesar
Julio Cesar

Reputation: 265

ngrok doesn't lift my local django web server

I have problems with negrok, it does not raise my local django web server, a few days ago everything worked correctly but a normal day, without having touched anything, it stopped working.

Run the following:

python manage.py runserver

Everything works normally and correctly.


Now I execute the following, in order to raise the local django server:

./ngrok http 8000

ngrok runs correctly without any problem but when accessing the ngrok link, the page is loading and everything is blank and does not work ....

This appears in ngrok:

ngrok by @inconshreveable                                                                                (Ctrl+C to quit)

Session Status                online                                                                                     
Account                       Julio (Plan: Free)                                                                         
Version                       2.3.34                                                                                     
Region                        United States (us)                                                                         
Web Interface                 http://127.0.0.1:4040                                                                      
Forwarding                    http://33822c5a.ngrok.io -> http://localhost:8000                                          
Forwarding                    https://33822c5a.ngrok.io -> http://localhost:8000                                         

Connections                   ttl     opn     rt1     rt5     p50     p90                                                
                              2       0       0.03    0.01    0.20    0.21                                               

HTTP Requests                                                                                                            
-------------                                                                                                            

GET /                          400 Bad Request                                                                           
GET /                          400 Bad Request

And this appears in django:

Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
September 25, 2019 - 17:23:19
Django version 2.2.2, using settings 'ibme_proyect.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '33822c5a.ngrok.io'. You may need to add '33822c5a.ngrok.io' to ALLOWED_HOSTS.
Bad Request: /
[25/Sep/2019 17:25:30] "GET / HTTP/1.1" 400 68119
Invalid HTTP_HOST header: '33822c5a.ngrok.io'. You may need to add '33822c5a.ngrok.io' to ALLOWED_HOSTS.
Bad Request: /
[25/Sep/2019 17:25:38] "GET / HTTP/1.1" 400 68254

I add the ngrok host (33822c5a.ngrok.io) in ALLOWED_HOSTS and stop giving django error, and access the ngrok link and I know that it loads again, it doesn't load the HTML, nothing, everything blank ...

Any solution? :(

Upvotes: 0

Views: 1983

Answers (1)

Shri Harri Priya R
Shri Harri Priya R

Reputation: 9

try ALLOWED_HOSTS = ["*"] this will allow tunneling every ngrok run :)

Upvotes: 0

Related Questions