Reputation: 814
I am new to Django, and am trying to get the server set up.
I have created my project folder (containing manage.py) and after running
python manage.py runserver
it gets stuck after these messages
System check identified no issues (0 silenced).
You have 15 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.
November 11, 2018 - 18:17:53
Django version 2.1.3, using settings 'MyProject.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
There is a minute or so pause and then these show up.
[11/Nov/2018 18:18:46] "GET / HTTP/1.1" 200 16348
[11/Nov/2018 18:18:47] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
[11/Nov/2018 18:18:47] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348
[11/Nov/2018 18:18:47] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
After that it just stays there, I cannot type anything or do anything.
Upvotes: 2
Views: 4464
Reputation: 993
First of all don't forget the Django documentation is your friend (even if it's a bit unfriendly).
You are doing everything correctly and the terminal is out putting any requests made to the application:
[11/Nov/2018 18:18:46] "GET / HTTP/1.1" 200 16348
[11/Nov/2018 18:18:47] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
[11/Nov/2018 18:18:47] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348
[11/Nov/2018 18:18:47] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
That means you connected to http://127.0.0.1:8000/ at the root domain, with which 3 fonts also got sent to the requesting browser/connection.
I would highly suggest you follow a simple tutorial like this one, step by step, then follow other tutorials and find what works best for you.
I have tried long and hard to enjoy using Django and for over 6 months I was unhappy working and struggling to get it to work flawlessly. So I found Flask to be a much better alternative and much easier to learn and continue to work with. I recently came across Quart, which is an asynchronous fork of Flask, and have not looked back since. We can literally build a fully functioning web application shell in a matter of minutes with the help of various Flask extensions.
Upvotes: 2
Reputation: 1750
To clarify the behaviour of the runserver
command, you should use the doc
Starts a lightweight development Web server on the local machine.
Since a server continously listen for connections, it's fine that you don't get the prompt back. If needed, you could use python manage.py runserver &
to run the server in the background of your shell, or just open another window/tab.
Remember that, to test your website, you have to keep the server open.
Upvotes: 3