Jeet Patel
Jeet Patel

Reputation: 1241

Unable to see the Django default page on command "python manage.py runserver"

I first created a virtual environment of python in user directory. Then I navigated to desktop and run a command to start a project django-admin startproject eitan. This command created a folder called eitan on desktop.

Below is the tree structure of directory eitan -

.
├── a
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── app_users
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── db.sqlite3
├── eitan
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
└── manage.py

I also create two Django application called a and app_users inside the eitan directory.

Then I executed command python manage.py runserver 0.0.0.0:8080 which started the Django server on http://127.0.0.1:8080/.

The server URL http://127.0.0.1:8080/ was not showing the default landing page (the launching rocket icon) of Django application. Instead it was asking me to start Django appication.

Below is the screenshot of the result I have received.enter image description here

As recommended I also tried to run both the Django application but it returned an error stated below.

`CommandError: 'a' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.`
`CommandError: 'app_users' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.`

Application Versions -

PIP Version

pip -V

pip 20.0.2 from /Users/jeetpatel/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)

Django Version -

python -m django --version

1.11.25

Python Version -

python --version

Python 2.7.16

Upvotes: 0

Views: 408

Answers (2)

Amir big
Amir big

Reputation: 102

your django version is 1.11, the launching rocket icon is for django version 2 or above

Upvotes: 0

John
John

Reputation: 770

As general note, you must include your applications to the INSTALLED_APPS list inside settings.py.

settings.py

... 
INSTALLED_APPS = [
    ...
    'a',
    'app_users',
]
...

You also have to create the relevant url and views to show the template you want.

Upvotes: 1

Related Questions