Newbie: ImportError during syncdb

61 views
Skip to first unread message

David

unread,
Mar 6, 2014, 1:13:48 AM3/6/14
to django...@googlegroups.com
Dear django users,

I am new to django and have an ImportError: No module named bookmarks
problem.

It seems that as I tried to syncdb django does not recognize the
bookmarks module I have created before. In the past I was able to
syncdb, hence my confusion.

I am trying to teach myself by following "Learning Website Development
with Django" by Ayman Hourieh.

I am not working in a virtualenv.

Thanks for your guidance and hints!

David


settings.py:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_bookmarks.bookmarks',
)

david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 399, in execute_from_command_line
utility.execute()
File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 280, in execute
translation.activate('en-us')
File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
line 130, in activate
return _trans.activate(language)
File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
line 188, in activate
_active.value = translation(language)
File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
line 159, in _fetch
app = import_module(appname)
File
"/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
40, in import_module
__import__(name)
ImportError: No module named bookmarks

Robin Lery

unread,
Mar 6, 2014, 7:36:30 AM3/6/14
to django...@googlegroups.com
What the name of the app folder? I think its just django_bookmarks.



--
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.
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/5317CBCC.4060908%40gmx.net.
For more options, visit https://groups.google.com/groups/opt_out.

Jay Parikh

unread,
Mar 6, 2014, 7:42:53 AM3/6/14
to django...@googlegroups.com
Let say for example i am going to create new app say bookmarks then i will do something like "python manage.py startapp bookmarks" likewise whatever name you have passed in place of bookmarks. Just place it inside INSTALLED_APPS.


Jay Parikh

unread,
Mar 6, 2014, 5:50:07 AM3/6/14
to django...@googlegroups.com
Hi David,

Instead of specifying ''django_bookmarks.bookmarks'' in 'INSTALLED_APPS' i would suggest you to use your app name which you have created e.g someting like as below:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'bookmarks',
)
I am assuming over here as you have kept your app name as 'bookmarks'.

-Jay


On Thu, Mar 6, 2014 at 6:43 AM, David <ld...@gmx.net> wrote:

David

unread,
Mar 7, 2014, 6:22:34 PM3/7/14
to django...@googlegroups.com
Dear Robin and Jay,

thanks, I was able to solve my problem: setting.py just wants the name
of the app.

Cheers,

David


On 06/03/14 08:42, Jay Parikh wrote:
> Let say for example i am going to create new app say bookmarks then i
> will do something like *"python manage.py startapp bookmarks" *likewise
> whatever name you have passed in place of *bookmarks.* Just place it
> <mailto:django-users%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> django...@googlegroups.com
> <mailto: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/5317CBCC.4060908%40gmx.net.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> 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
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto: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/CA%2B4-nGorOGF10TOCuYAWohS%2B3nHjrL-DRpkj%2BDGTtmHDq4u00A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2B4-nGorOGF10TOCuYAWohS%2B3nHjrL-DRpkj%2BDGTtmHDq4u00A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> 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
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto: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/CAD-syJVuTabkTE2wO7%2BEt3tSN68RDSVU49j6%2BA8JLvxWamLXxw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD-syJVuTabkTE2wO7%2BEt3tSN68RDSVU49j6%2BA8JLvxWamLXxw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages