1

I am working on Python rest framework and after setting up python 3.8.12 on my mac, when I tried to up the server with python manage.py runserver command for Django, it takes around 2 minutes and in-between it gives some connectionpool logs described as below.

2021-11-26 11:24:04,249 DEBUG    urllib3.connectionpool : Starting new HTTP connection (1): 169.254.169.254:80
2021-11-26 11:24:05,252 DEBUG    urllib3.connectionpool : Starting new HTTP connection (2): 169.254.169.254:80
2021-11-26 11:24:06,586 DEBUG    urllib3.connectionpool : Starting new HTTP connection (3): 169.254.169.254:80
2021-11-26 11:24:07,590 DEBUG    urllib3.connectionpool : Starting new HTTP connection (4): 169.254.169.254:80
2021-11-26 11:24:09,527 DEBUG    urllib3.connectionpool : Starting new HTTP connection (1): 169.254.169.254:80
2021-11-26 11:24:09,528 DEBUG    urllib3.connectionpool : Starting new HTTP connection (2): 169.254.169.254:80
2021-11-26 11:24:09,821 DEBUG    urllib3.connectionpool : Starting new HTTP connection (3): 169.254.169.254:80
2021-11-26 11:24:09,822 DEBUG    urllib3.connectionpool : Starting new HTTP connection (4): 169.254.169.254:80
2021-11-26 11:24:10,154 DEBUG    urllib3.connectionpool : Starting new HTTP connection (5): 169.254.169.254:80
2021-11-26 11:24:10,155 DEBUG    urllib3.connectionpool : Starting new HTTP connection (6): 169.254.169.254:80

Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

This is a headache because every time it takes this much time for any change. I can't find any solution over web. Please Help. All solutions are welcomed. Thanks in advance ;)

  • Without any code provided, we have no idea what is causing any issues you may have. – BuhtanDingDing Nov 29 '21 at 05:45
  • 1
    Have you debugged which apps or modules are causing this issue? You most likely have some DB queries being executed at start-up – Iain Shelvington Nov 29 '21 at 05:46
  • how many apps do you have? – Pranava Mohan Nov 29 '21 at 05:48
  • @PranavaMohan Only one app. – Khantil Sanghani Nov 29 '21 at 08:59
  • @BuhtanDingDing Which code do you want to see? – Khantil Sanghani Nov 29 '21 at 09:01
  • @IainShelvington I tried to dubugged but I could not find anything from it, as I am new to Django framework. – Khantil Sanghani Nov 29 '21 at 09:06
  • 1
    @KhantilSanghani You might have some query being run where it shouldn't be. If you only have a single app try posting the models, views and forms as the issue is probably somewhere in those files – Iain Shelvington Nov 29 '21 at 09:09
  • @IainShelvington I tried to debug and I found these interesting things that, after performing in virtual environment by `set -a && source local.env && set +a` connectionpool logs occur and after Any commands which includes `manage.py` connectionpool logs occur. – Khantil Sanghani Nov 29 '21 at 11:54
  • @KhantilSanghani The fact that your app is connecting to the DB on startup indicates that you have an issue with your configuration or are running queries where you shouldn't be. Unless you post your code there is not much that can be done to help – Iain Shelvington Nov 29 '21 at 12:04
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 03 '21 at 11:01

0 Answers0