2
votes

i set following http://django-grappelli.readthedocs.org/en/2.6.3/index.html

settings.py

    INSTALLED_APPS = (
        'grappelli',
        'django.contrib.admin',
    )
url.py

urlpatterns = patterns('',
    (r'^grappelli/', include('grappelli.urls')), # grappelli URLS
    (r'^admin/',  include(admin.site.urls)), # admin site
)

$ python manage.py collectstatic

as a result my pycharm3.4.1 with django1.7.1 and grappelli2.6.3 tell me:

Traceback (most recent call last):
File "D:\PyCharm 3.4.1\helpers\pycharm\django_manage.py", line 23, in
run_module(manage_file, None, 'main', True)
File "D:\Python27\lib\runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "D:\Python27\lib\runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "D:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "D:\Documents\programe\python\django\mysite\manage.py", line 10, in
execute_from_command_line(sys.argv)
File "D:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management__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\management__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\registry.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 116, in create
mod = import_module(mod_path)
File "D:\Python27\lib\importlib__init__.py", line 37, in import_module
import(name)
ImportError: No module named grappellidjango.contrib

1
That sounds like you've forgotten a comma, and accidentally concatenated two strings: 'grappelli' 'django.contrib'. Check your settings and urls files very carefully for missing commas.user707650
It works for me too! However, accept the answer as correct please, because I got confused that it was not a sound solution. Thank you!raratiru

1 Answers

8
votes

Kindly set the following settings in settings.py file:-

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

    MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

I hope above solution will resolve your issue.