Error: No module named polls

2,296 views
Skip to first unread message

Baba Samu

unread,
Nov 29, 2009, 8:42:23 AM11/29/09
to Django users
Hi,

Following the tutorial when i have "python manage.py sql polls" i get
error message "No module named polls"

I have modified settijng.py to.....

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'mysite.polls'
)


any ideas?

thanks,
samu

Vardhan Varma

unread,
Nov 29, 2009, 11:17:10 AM11/29/09
to django...@googlegroups.com
did you named your project as 'mysite' and your app  as 'polls' ...
also make sure __init__.py exists inside directory polls (manage.py should create that ).

hope that helps,

--Vardhan





--

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Radhikavk

unread,
Nov 30, 2009, 6:29:29 AM11/30/09
to django...@googlegroups.com



Vardhan Varma-2 wrote:
>
> did you named your project as 'mysite' and your app as 'polls' ...
> also make sure __init__.py exists inside directory polls (manage.py should
> create that ).
>
> hope that helps,
>
> --Vardhan
>
>
>
>
> Have you given your projevt name as mysite and application name as polls
>
>
>
> On Sun, Nov 29, 2009 at 7:12 PM, Baba Samu
> <samuelb...@gmail.com>wrote:
>
>> Hi,
>>
>> Following the tutorial when i have "python manage.py sql polls" i get
>> error message "No module named polls"
>>
>> I have modified settijng.py to.....
>>
>> INSTALLED_APPS = (
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.sites',
>> 'mysite.polls'
>> )
>>
>>
>> any ideas?
>>
>> thanks,
>> samu
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users...@googlegroups.com<django-users%2Bunsu...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>

--
View this message in context: http://old.nabble.com/Error%3A-No-module-named-polls-tp26562161p26573185.html
Sent from the django-users mailing list archive at Nabble.com.

Baba Samu

unread,
Nov 30, 2009, 1:21:15 PM11/30/09
to Django users
first of all thank very much.

the problem was i named the folder 'POLLS', in stead of 'polls' it
seems to be case sensitive....

anyway, i changed it and now i get

Error: Django doesn't know which syntax to use for your SQL
statements,
because you haven't specified the DATABASE_ENGINE setting.
Edit your settings file and change DATABASE_ENGINE to something like
'postgresql
' or 'mysql'.

but when i enter settings.py to edit it i see it....

another issue i have is, copy/pasting from or into .py files from the
console doesnt work....

sorry im new :_(

thanks
samu





On Nov 29, 5:17 pm, Vardhan Varma <vardhanva...@gmail.com> wrote:
> did you named your project as 'mysite' and your app  as 'polls' ...
> also make sure __init__.py exists inside directory polls (manage.py should
> create that ).
>
> hope that helps,
>
> --Vardhan
>
> On Sun, Nov 29, 2009 at 7:12 PM, Baba Samu <samuelbarcel...@gmail.com>wrote:
>
> > Hi,
>
> > Following the tutorial when i have "python manage.py sql polls" i get
> > error message "No module named polls"
>
> > I have modified settijng.py to.....
>
> > INSTALLED_APPS = (
> >    'django.contrib.auth',
> >    'django.contrib.contenttypes',
> >    'django.contrib.sessions',
> >    'django.contrib.sites',
> >    'mysite.polls'
> > )
>
> > any ideas?
>
> > thanks,
> > samu
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users...@googlegroups.com<django-users%2Bunsu...@googlegroups.com>
> > .

Rafael Vieira

unread,
Nov 30, 2009, 1:27:03 PM11/30/09
to django...@googlegroups.com
Hi, do you have change file settings.py section DATABASE_ENGINE = 'sqlite3',
I recommend sqlite3 if you are new in django;
 
and in Section DATABASE_NAME use your name database .db for example
 
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'mybanco.db'
 
 
Sorry about my text but i am brazilian and my english  don't is good

2009/11/30 Baba Samu <samuelb...@gmail.com>
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.





--
Rafael Vieira
54-91575031

DGSpotman

unread,
Nov 30, 2009, 1:30:06 PM11/30/09
to Django users
I had a similar problem yesterday (I'm also new), and again, it was
because of capitalization. For some reason my settings.py file got
renamed to SETTINGS.py. Don't know how that happened, but when I reset
the filename to all lower case, things worked.

Hope this helps,

Michael

Baba Samu

unread,
Nov 30, 2009, 2:51:17 PM11/30/09
to Django users
thanks, but i have tried changing the database_name to DATABASE_ENGINE
= 'sqlite3' and database name to DATABASE_NAME = 'poll.db'

and i still get the same message.....

maybe i should delete n start again since im just following the
tutorial and i have this inconsistencies at the very beggining.... ¿?

cheers
samu

On Nov 30, 7:27 pm, Rafael Vieira <rafaelra...@gmail.com> wrote:
> Hi, do you have change file settings.py section DATABASE_ENGINE = 'sqlite3',
> I recommend sqlite3 if you are new in django;
>
> and in Section DATABASE_NAME use your name database .db for example
>
> DATABASE_ENGINE = 'sqlite3'
> DATABASE_NAME = 'mybanco.db'
>
> Sorry about my text but i am brazilian and my english  don't is good
>
> 2009/11/30 Baba Samu <samuelbarcel...@gmail.com>
> > <django-users%2Bunsu...@googlegroups.com<django-users%252Buns...@googlegroups.com>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users...@googlegroups.com<django-users%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Rafael Vieira
> 54-91575031

Rafael Vieira

unread,
Nov 30, 2009, 2:54:48 PM11/30/09
to django...@googlegroups.com
what python's version you are using?

2009/11/30 Baba Samu <samuelb...@gmail.com>
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.





--
Rafael Vieira
54-91575031

Baba Samu

unread,
Nov 30, 2009, 3:01:43 PM11/30/09
to Django users
2.6

On Nov 30, 8:54 pm, Rafael Vieira <rafaelra...@gmail.com> wrote:
> what python's version you are using?
>
> 2009/11/30 Baba Samu <samuelbarcel...@gmail.com>
> > > > <django-users%2Bunsu...@googlegroups.com<django-users%252Buns...@googlegroups.com>
> > <django-users%252Buns...@googlegroups.com<django-users%25252Bun...@googlegroups.com>
>
> > > > > > .
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/django-users?hl=en.
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > django-users...@googlegroups.com<django-users%2Bunsu...@googlegroups.com>
> > <django-users%2Bunsu...@googlegroups.com<django-users%252Buns...@googlegroups.com>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --

Rafael Vieira

unread,
Nov 30, 2009, 4:22:56 PM11/30/09
to django...@googlegroups.com
Please Baba send-me your project. 
I want see your error

2009/11/30 Baba Samu <samuelb...@gmail.com>
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.





--
Rafael Vieira
54-91575031

ibes ...

unread,
Jan 5, 2015, 10:41:07 AM1/5/15
to django...@googlegroups.com, rafae...@gmail.com
hello,
I am frustrated with django and phyton tutorial it is very difficult
i'm having a problem with the tutorial of django and python,

am using django 1.7.1 and python 2.7 on win xp-sp3 so far it was good, i create everything without problem but in tutorial step where it says:

https://docs.djangoproject.com/en/1.7/intro/tutorial01/

Once you’re in the shell, explore the database API:

i've got the message:

C:\xampp\htdocs\primerdjango>manage.py runserver
Traceback (most recent call last):
  File "D:\xampp\htdocs\primerdjango\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "D:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\managem
ent\__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "D:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\managem
ent\__init__.py", line 354, in execute
    django.setup()
  File "D:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\__init__.py"
, line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\apps\registr
y.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "D:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\apps\config.
py", line 123, in create
    import_module(entry)
  File "D:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named polls

i don't know what to do.... can anyone help, please!!!

sorry for my bad english...

Xavier Ordoquy

unread,
Jan 5, 2015, 10:47:44 AM1/5/15
to django...@googlegroups.com, rafae...@gmail.com
Hi,


sorry for my bad english…

It looks like Python couldn’t find the « polls » directory.
Maybe you didn’t create it or it is at the wrong location. Could you write us where the « polls » directory is, relating to « mysite » ?

Regards,
Xavier Ordoquy,
Linovia.

Vijay Khemlani

unread,
Jan 5, 2015, 2:34:01 PM1/5/15
to django...@googlegroups.com
Also make sure that there is an __init__.py file in the polls directory

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.

tita

unread,
Jan 6, 2015, 9:03:32 AM1/6/15
to django...@googlegroups.com
Hi,
thanks for your answer...
here is the path of my site, that i called "primerdjango":

C:\xampp\htdocs\primerdjango\

inside of that folder i have:

polls\
primerdjango\
db.sqlite3
manage.py
Vista.py

then inside of - polls - i have:

migrations\
admin.py
admin.pyc
models.py
models.pyc
tests.py
tests.pyc
urls.py
urls.pyc
views.py
views.pyc
__init__.py
__init__.pyc

i have my python in C:\Python27\

i notice that when i try to start my apache ( at the first time), i
have to erase the module mod_wsgi.so...
( LoadModule wsgi_module modules/mod_wsgi.so )

and comment that line in the httpd.conf, because that's the only way
that my apache run, the and i can start my xampp and finally run the
server with manage.py runserver...
that only happens at the first time, gradually during the day that
things doesn't happens again...

here is another problem:

when i try to follow the step of the tutorial
(https://docs.djangoproject.com/en/1.7/intro/tutorial01/) where it
said:
"from polls.models import Question, Choice"

begins other problems...

for example:

if i write into the CMD the manage.py shell :
>>> q = Question(question_text="que hay?", pub_date=timezone())

i got this message:

Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: 'module' object is not callable

and there i stuck...

my http pages looks fine, i can work with polls page, create, modify
and erase...

what i do wrong??

sorry for my english, i'm extra newbie in python and django...

i hope that you could understand all that i try to explain...

THANKS A LOT AGAIN.

regards.
ibes.



2015-01-05 14:33 GMT-05:00, Vijay Khemlani <vkhe...@gmail.com>:
> Also make sure that there is an __init__.py file in the polls directory
>
> On Mon, Jan 5, 2015 at 12:47 PM, Xavier Ordoquy <xord...@linovia.com>
> wrote:
>
>> Hi,
>>
>>
>> Le 5 janv. 2015 à 16:41, ibes ... <tit...@gmail.com> a écrit :
>>
>> hello,
>> I am frustrated with django and phyton tutorial it is very difficult
>> i'm having a problem with the tutorial of django and python,
>>
>> am using django 1.7.1 and python 2.7 on win xp-sp3 so far it was good, i
>> create everything without problem but in tutorial step where it says:
>>
>> https://docs.djangoproject.com/en/1.7/intro/tutorial01/
>>
>> Once you’re in the shell, explore the *database API*
>> <https://docs.djangoproject.com/en/1.7/topics/db/queries/>:
>> <https://groups.google.com/d/msgid/django-users/6CA9FED6-CCA2-4854-B834-8D6F3B74D316%40linovia.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/Dg6zBJ5hlYc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALn3ei1yDtDJUTjtTdfpE5QrxJEZzJutUoCVS5H7jYohubuLBw%40mail.gmail.com.

Collin Anderson

unread,
Jan 8, 2015, 1:58:30 PM1/8/15
to django...@googlegroups.com
Hi,

Question(question_text="que hay?", pub_date=timezone())

should be:

Question(question_text="que hay?", pub_date=timezone.now())

Collin
Reply all
Reply to author
Forward
0 new messages