#27139 closed Uncategorized (worksforme)

ImportError: No module named 'polls.apps.PollsConfig'

Reported by: Pierre Jimenez Owned by: nobody
Component: Documentation Version: 1.10
Severity: Normal Keywords: apps
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In tutorial 02, Writing your first Django app, part 2, typing in

INSTALLED_APPS = [
    'polls.apps.PollsConfig',
   ....

will cause an ImportError: No module named 'polls.apps.PollsConfig'; 'polls.apps' is not a package

This is resolved by instead putting

INSTALLED_APPS = [
    'polls',
   ....

Change History (1)

comment:1 Changed 22 months ago by Baptiste Mispelon

Resolution: worksforme
Status: newclosed

Hi,

Since Django 1.9, the startapp command will generate an apps.py file so the instructions should be correct.

Is it possible that you're using an older version of Django (python manage.py --version will tell you)? If so, you either need to update Django (1.10 is the latest version) or follow the documentation that corresponds to the version of Django you're using (you can switch versions at the bottom-right hand corner).

Thanks.

Note: See TracTickets for help on using tickets.
Back to Top