1
votes

I used to work with django and I didn't face this problem in the past, Then I shifted for a while to Laravel ( and sure I changed a lot of things in the windows which I don't remember ).

and now when I hit python manage.py runserver .. nothing happen and the shell seems as it hanged . hover once I hit crt + C .the normal window suddenly appear that says :

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. January 08, 2019 - 14:16:30 Django version 2.1.1, using settings 'django_project.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK.

However I am able to go to http://127.0.0.1:8000/ and I have the welcome page of django with this line added enter image description here

It sounds crazy I know , please excuse me cause I am a newbie and thanx in advance

3
What's not working for you ? At what point of time http://127.0.0.1:8000 is working ? Did you tried applying migrations ? - Umair Mohammad
No, I didn't apply migration yet , but as I know that once I hit python manage.py runserver .. the shell window appear whch says 'django_project.settings' Starting development server at 127.0.0.1:8000 Quit the server with CTRL-BREAK. and what about the debug part in the welcome page - Mostafa Gafer
What's not working for you ? - Umair Mohammad
Are you using different database? - Jagjeet Singh
I faced many problems since then and I figured a solution for it . is to add winpty before any order on the shell .. it is confusing but do you know why even for winpty python manage.py createsuperuser – - Mostafa Gafer

3 Answers

2
votes

The first line in manage.py breaks the file on windows. The first line should look like this:

#!/usr/bin/env python

Removing it will fix the issue

1
votes

Looks like you've to apply migrations.

You've just to run what he says:

python manage.py migrate

I think it's better to look at the documentation before you proceed: you've to understand how models work in Django. Take a look to the documentation first. And my advice is to follow the "first app" tutorial. Go here

1
votes

To apply migrations run:

python manage.py makemigrations
python manage.py migrate

Seems like you've just installed django and every time you do so, you should apply the migrations. This synchronizes the database state with your current set of models and migrations.

More about migrations