Issue
I am learning Python web development. After installing Django and starting the server by running the comment python manage.py runserver in the integrated terminal. I got a message in red letters about unapplied migration(s) and the project may not work properly because of this.
$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
July 18, 2019 - 04:47:07
Django version 2.2.3, using settings 'web_project.settings'
Starting development server at
Quit the server with CONTROL-C.
To fix this issue, I tried running the comment python manage.py migrate in the same integrated terminal. But nothing happened. Then I realized that I have to stop the Django server before running the migration comment.
Solution for unapplied migration(s)
To run the migrate comment:
- First, stop the Django server by pressing the keys CONTROL-C.
- Then run the comment python manage.py migrate in the same integrated terminal or a new one. Now you can see all the required migrations applied to the apps.
Tools & Technologies Involved
- Python (3.7.3)
- Django (2.2.3)
- Visual Studio Code (1.36.0)
- macOS Mojave (10.14.5)
Reference
- About Django migrate comment at Django Docs.
—————————————-
Exception happened during processing of request from (‘127.0.0.1’, 52587)
Traceback (most recent call last):
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py”, line 650, in process_request_thread
self.finish_request(request, client_address)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py”, line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py”, line 720, in __init__
self.handle()
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py”, line 171, in handle
self.handle_one_request()
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py”, line 179, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
[17/Sep/2019 16:40:30] “GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1” 200 86184
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\socket.py”, line 589, in readinto
return self._sock.recv_into(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
—————————————-
[17/Sep/2019 16:40:30] “GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1” 200 85692
[17/Sep/2019 16:40:30] “GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1” 200 85876
[17/Sep/2019 16:40:33] “GET / HTTP/1.1” 200 16348
[17/Sep/2019 16:40:33] “GET /static/admin/css/fonts.css HTTP/1.1” 304 0
/////////////////////////HELP ME PLEASE/////////////////////