Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 1 of 2

error on making helloworld webpage on django

Solved! Go to Solution.

i kinda started it today and was creating a helloworld bebpage by reading in a book 

so after doing all kind of work i mean you all know what kind of work i am talking about then 

when i typed the command in power shell "python manage.py runserver"

it shows like this

------------------------------------------------------------------------------------------------------------------------------

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000027210AC3A60>
Traceback (most recent call last):
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception
raise _exception[1]
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\core\management\__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\site-packages\django\apps\config.py", line 123, in create
import_module(entry)
File "C:\Users\A\.virtualenvs\helloworld-PwcuqGam\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pages.apps.pagesconfig'; 'pages.apps' is not a package

------------------------------------------------------------------------------------------------------------------------------

i dont understand what kind of error is this plz help me about this thx in advance

1 Reply
Solution
Commander Lvl 2
Message 2 of 2

Re: error on making helloworld webpage on django

Django is looking for a set of files for an app called 'pages'. That is, you presumably added the line

    'pages.apps.pagesconfig',

to your settings.py file. But Django cannot 'find' it, and thus the error.

 

There are a bunch of different reasons why Django might not be able to "find" it.

1. Did you check that the case is correct? Any sample I see where the app "pages" is being created, the line to put in settings.py is 

'pages.apps.PagesConfig',

Note that PagesConfig has different case from what you probably entered.

2. Did you create an app called "pages"? I.e. did you do:

$ django-admin startproject pages_project .
$ python manage.py startapp pages

If you called your app something else, you have to put the appropriate line in settings.py.

 

You might try looking at this or this for some more details on the pages app. This should give you some more background on your error.

 

Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!