Re: Python-Django : ImportError at / : No module named urls
Have you checked the file permissions? The user runing the project, must be able to read the files at least. check this question: http://stackoverflow.com/questions/805427/which-permissions-should-i-use-for-django-folders-at-my-server Em quarta-feira, 11 de dezembro de 2013 11h39min08s UTC-2, Lier escreveu: > > Check "urls.py" file in your project manage folder. > > I think you doesn't have a "urls.py" in your project folder. > > > > 2013년 12월 11일 수요일 오후 5시 32분 20초 UTC+9, shoaib ijaz 님의 말: >> >> I have created Djnago project in eclipse. Unfortunately, i am facing >> issue when i run the project >> >> ImportError at / No module named urls >> >> Here Error Page http://dpaste.com/1499981/ >> >> Eclipse Project >> http://i1008.photobucket.com/albums/af204/shoaibshah01/Untitled_zps84f95b4f.jpg >> > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@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/0b3c0af7-5d09-41ea-8392-7e68c99b1d07%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Python-Django : ImportError at / : No module named urls
Check "urls.py" file in your project manage folder. I think you doesn't have a "urls.py" in your project folder. 2013년 12월 11일 수요일 오후 5시 32분 20초 UTC+9, shoaib ijaz 님의 말: > > I have created Djnago project in eclipse. Unfortunately, i am facing issue > when i run the project > > ImportError at / No module named urls > > Here Error Page http://dpaste.com/1499981/ > > Eclipse Project > http://i1008.photobucket.com/albums/af204/shoaibshah01/Untitled_zps84f95b4f.jpg > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@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/93855146-b7a2-4b96-a56a-416f13e28c32%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Python-Django : ImportError at / : No module named urls
I have created Djnago project in eclipse. Unfortunately, i am facing issue when i run the project ImportError at / No module named urls Here Error Page http://dpaste.com/1499981/ Eclipse Project http://i1008.photobucket.com/albums/af204/shoaibshah01/Untitled_zps84f95b4f.jpg -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@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/b05a6745-d150-4b1a-bd2a-297d665da1f7%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: No Module named URLS
Thank so much! I've figured it out. Have fun :) On Feb 6, 8:55 pm, Sandro Dutra wrote: > If I understand you're writing a template for admin, and this is not > required 'cause the admin template is called by the contrib > 'django.contrib.admin', in INSTALLED_APPS (settings file), only if you > want to customize admin, you can override the admin files, putting > them o 'yourtemplatesdir/admin/', and I think this is not the case. > > The only required steps to see the admin page is: > 1. Check if 'django.contrib.admin' is uncommented in 'settings.py'; > 2. Uncomment the required lines in file 'urls.py'; > 3. Launch the dev server and acess localhost/admin/. > > Only this, nothing more... > > Templates.py? Templates can have any extension, this is true, but > usually we put .html or .htm... > > 2012/2/6 akaariai : > > > > > > > > > On Feb 6, 5:09 pm, coded kid wrote: > >> Hey guys, I’m getting an error when trying to visit my admin page: > >> TemplateSyntaxError at /admin/ > >> Caught ImportError while rendering: No module named urls > > >> In urls.py > >> from django.conf.urls.defaults import patterns, include, url > >> from django.contrib import admin > >> admin.autodiscover() > > >> urlpatterns = patterns('', > >> (r'^admin/',include(admin.site.urls)), > >> ) > > >> In Template.py > > >> > >> {% block branding %}{% endblock %} > >> {% if user.is_active and user.is_staff %} > >> {% trans 'Welcome,' %} {% filter > >> force_escape %}{% firstof user.first_name user.username %}{% endfilter > >> %}. > >> {% block userlinks %} {% url 'django-admindocs-docroot' as docsroot > >> %} {% if docsroot %} {% trans > >> 'Documentation' %} {% endif %} {% url 'admin:password_change' as > >> password_change_url %} {% if password_change_url %} 37 >> href="{{ password_change_url }}"> {% else %} 40 {% endif %} 41 {% trans 'Change password' %} >> a> / > > >> What do you think is the problem! I’ve been fighting with this for the > >> pas 15hrs yet no success. Kindly help me out! > > > I don't spot any immediate reason for your problem. Some more > > information is needed. A full stacktrace is always really good if you > > happen to get one. Maybe the problem is in your admin.py. As said, it > > is hard to say without more information. > > > - Anssi > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-users@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://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-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: No Module named URLS
If I understand you're writing a template for admin, and this is not required 'cause the admin template is called by the contrib 'django.contrib.admin', in INSTALLED_APPS (settings file), only if you want to customize admin, you can override the admin files, putting them o 'yourtemplatesdir/admin/', and I think this is not the case. The only required steps to see the admin page is: 1. Check if 'django.contrib.admin' is uncommented in 'settings.py'; 2. Uncomment the required lines in file 'urls.py'; 3. Launch the dev server and acess localhost/admin/. Only this, nothing more... Templates.py? Templates can have any extension, this is true, but usually we put .html or .htm... 2012/2/6 akaariai : > On Feb 6, 5:09 pm, coded kid wrote: >> Hey guys, I’m getting an error when trying to visit my admin page: >> TemplateSyntaxError at /admin/ >> Caught ImportError while rendering: No module named urls >> >> In urls.py >> from django.conf.urls.defaults import patterns, include, url >> from django.contrib import admin >> admin.autodiscover() >> >> urlpatterns = patterns('', >> (r'^admin/',include(admin.site.urls)), >> ) >> >> In Template.py >> >> >> {% block branding %}{% endblock %} >> {% if user.is_active and user.is_staff %} >> {% trans 'Welcome,' %} {% filter >> force_escape %}{% firstof user.first_name user.username %}{% endfilter >> %}. >> {% block userlinks %} {% url 'django-admindocs-docroot' as docsroot >> %} {% if docsroot %} {% trans >> 'Documentation' %} {% endif %} {% url 'admin:password_change' as >> password_change_url %} {% if password_change_url %} 37 > href="{{ password_change_url }}"> {% else %} 40 {% endif %} 41 {% trans 'Change password' %}> a> / >> >> What do you think is the problem! I’ve been fighting with this for the >> pas 15hrs yet no success. Kindly help me out! > > I don't spot any immediate reason for your problem. Some more > information is needed. A full stacktrace is always really good if you > happen to get one. Maybe the problem is in your admin.py. As said, it > is hard to say without more information. > > - Anssi > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@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-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: No Module named URLS
On Feb 6, 5:09 pm, coded kid wrote: > Hey guys, I’m getting an error when trying to visit my admin page: > TemplateSyntaxError at /admin/ > Caught ImportError while rendering: No module named urls > > In urls.py > from django.conf.urls.defaults import patterns, include, url > from django.contrib import admin > admin.autodiscover() > > urlpatterns = patterns('', > (r'^admin/',include(admin.site.urls)), > ) > > In Template.py > > > {% block branding %}{% endblock %} > {% if user.is_active and user.is_staff %} > {% trans 'Welcome,' %} {% filter > force_escape %}{% firstof user.first_name user.username %}{% endfilter > %}. > {% block userlinks %} {% url 'django-admindocs-docroot' as docsroot > %} {% if docsroot %} {% trans > 'Documentation' %} {% endif %} {% url 'admin:password_change' as > password_change_url %} {% if password_change_url %} 37 href="{{ password_change_url }}"> {% else %} 40 {% endif %} 41 {% trans 'Change password' %} a> / > > What do you think is the problem! I’ve been fighting with this for the > pas 15hrs yet no success. Kindly help me out! I don't spot any immediate reason for your problem. Some more information is needed. A full stacktrace is always really good if you happen to get one. Maybe the problem is in your admin.py. As said, it is hard to say without more information. - Anssi -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
Thanks, it works now. :D On Jun 3, 2:14 pm, Kenneth Gonsalves wrote: > On Fri, 2011-06-03 at 05:07 -0700, Kann wrote: > > > you have a file called mirnaweb.py - your path should contain only > > the > > > parent directory to your mirnaweb directory. Python is now looking > > for > > > settings inside mirnaweb.py > > > OK, now I changed the setting file into mirna_settings.py to avoid the > > confusion with the directory name. I also include the new setting file > > to django.wsgi file and telling the sys.path to append the new > > PYTHONPATH. I wonder why Python still could not see the modules inside > > my django project. > > > Also, I tried running the "python manage.py shell" again and it's > > still looking for the "settings.py". Why is that? > > rename your mirnaweb.py file and change your settings file back to > settings.py > -- > regards > KGhttp://lawgon.livejournal.com > Coimbatore LUG roxhttp://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
On Fri, 2011-06-03 at 05:07 -0700, Kann wrote: > > you have a file called mirnaweb.py - your path should contain only > the > > parent directory to your mirnaweb directory. Python is now looking > for > > settings inside mirnaweb.py > > OK, now I changed the setting file into mirna_settings.py to avoid the > confusion with the directory name. I also include the new setting file > to django.wsgi file and telling the sys.path to append the new > PYTHONPATH. I wonder why Python still could not see the modules inside > my django project. > > Also, I tried running the "python manage.py shell" again and it's > still looking for the "settings.py". Why is that? rename your mirnaweb.py file and change your settings file back to settings.py -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
> you have a file called mirnaweb.py - your path should contain only the > parent directory to your mirnaweb directory. Python is now looking for > settings inside mirnaweb.py OK, now I changed the setting file into mirna_settings.py to avoid the confusion with the directory name. I also include the new setting file to django.wsgi file and telling the sys.path to append the new PYTHONPATH. I wonder why Python still could not see the modules inside my django project. Also, I tried running the "python manage.py shell" again and it's still looking for the "settings.py". Why is that? Kann On Jun 3, 1:56 pm, Kenneth Gonsalves wrote: > On Fri, 2011-06-03 at 04:44 -0700, Kann wrote: > > Below is what I just did. Does this mean that I still have problem > > with my pythonpath? > > yes > > > > > [xxx@lagrange mirnaweb]$ python manage.py > > Error: Can't find the file 'settings.py' in the directory containing > > 'manage.py'. It appears you've customized things. > > You'll have to run django-admin.py, passing it your settings module. > > (If the file settings.py does indeed exist, it's causing an > > ImportError somehow.) > > you have a file called mirnaweb.py - your path should contain only the > parent directory to your mirnaweb directory. Python is now looking for > settings inside mirnaweb.py > -- > regards > KGhttp://lawgon.livejournal.com > Coimbatore LUG roxhttp://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
On Fri, 2011-06-03 at 04:44 -0700, Kann wrote: > Below is what I just did. Does this mean that I still have problem > with my pythonpath? yes > > [xxx@lagrange mirnaweb]$ python manage.py > Error: Can't find the file 'settings.py' in the directory containing > 'manage.py'. It appears you've customized things. > You'll have to run django-admin.py, passing it your settings module. > (If the file settings.py does indeed exist, it's causing an > ImportError somehow.) you have a file called mirnaweb.py - your path should contain only the parent directory to your mirnaweb directory. Python is now looking for settings inside mirnaweb.py -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
Hi Kenneth, Below is what I just did. Does this mean that I still have problem with my pythonpath? [xxx@lagrange mirnaweb]$ python manage.py Error: Can't find the file 'settings.py' in the directory containing 'manage.py'. It appears you've customized things. You'll have to run django-admin.py, passing it your settings module. (If the file settings.py does indeed exist, it's causing an ImportError somehow.) [xxx@lagrange mirnaweb]$ django-admin.py shell Error: Could not import settings 'mirnaweb' (Is it on sys.path? Does it have syntax errors?): No module named mirnaweb [xxx@lagrange mirnaweb]$ django-admin.py shell --settings='mirnaweb' -- pythonpath='/srv/mirnaweb' Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> import urls >>> Kann On Jun 3, 1:16 pm, Kenneth Gonsalves wrote: > On Fri, 2011-06-03 at 04:11 -0700, Kann wrote: > > [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No > > module named urls > > no module named urls can also mean that urls.py has errors. From the > shell try to import urls > -- > regards > KGhttp://lawgon.livejournal.com > Coimbatore LUG roxhttp://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
On Fri, 2011-06-03 at 04:11 -0700, Kann wrote: > [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No > module named urls no module named urls can also mean that urls.py has errors. From the shell try to import urls -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
ImportError: No module named urls
Dear all, Thanks so much for help me with the $DJANGO_SETTINGS_MODULE issue. Now I just installed the wsgi module and try to use apache 2.2.17 to host the django project. However, the page always throws error. I checked the log file and it says there's no module named urls. Seems like python could not find the 'urls.py' inside my django project directory. Does this mean that I still haven't got my $DJANGO_SETTINGS_MODULE set up properly. Below is the error and how I set the django.wsgi file. >>>>>>>>>>>>>>>>>>>>>>>>>> [Fri Jun 03 13:04:28 2011] [notice] SIGHUP received. Attempting to restart [Fri Jun 03 13:04:28 2011] [notice] Digest: generating secret for digest authentication ... [Fri Jun 03 13:04:28 2011] [notice] Digest: done [Fri Jun 03 13:04:28 2011] [notice] Apache/2.2.17 (Unix) DAV/2 PHP/ 5.3.6 mod_wsgi/3.2 Python/2.7 mod_perl/2.0.4 Perl/v5.12.3 configured -- resuming normal operations [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] mod_wsgi (pid=14389): Exception occurred processing WSGI script '/srv/mirnaweb/ apache/django.wsgi'. [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] Traceback (most recent call last): [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/ python2.7/site-packages/django/core/handlers/wsgi.py", line 248, in __call__ [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] response = self.get_response(request) [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/ python2.7/site-packages/django/core/handlers/base.py", line 141, in get_response [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] return self.handle_uncaught_exception(request, resolver, sys.exc_info()) [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/ python2.7/site-packages/django/core/handlers/base.py", line 176, in handle_uncaught_exception [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] if resolver.urlconf_module is None: [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/ python2.7/site-packages/django/core/urlresolvers.py", line 239, in _get_urlconf_module [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] self._urlconf_module = import_module(self.urlconf_name) [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/ python2.7/site-packages/django/utils/importlib.py", line 35, in import_module [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] __import__(name) [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No module named urls >>>>>>>>>>>>>>>>>>>> import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'mirnaweb' import django.core.handlers.wsgi path = '/srv/mirnaweb' if path not in sys.path: sys.path.append(path) application = django.core.handlers.wsgi.WSGIHandler() >>>>>>>>>>>>>>>>>>>>>>>>>> the content of my django project is as below: >>>>>>>>>>>>>>>>>>>>>>>>>>> [@yy mirnaweb]$ ls apache __init__.pyc mediamirnaweb.pycscripts tmp urls.pyc __init__.py manage.py mirnaweb.py mirnaworkbench template test.txt urls.py -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Import error No module named urls to url login_in in html page
Thank you Subhranath! I do not know what happened, but I created a new project and put the same configuration and is now working. I think it was a problem with the framework. I made the correction on this line: AUTH_PROFILE_MODULE = 'imobiliaria.login' <-- login app Thanks! On 19 abr, 06:49, Subhranath Chunder wrote: > Hi, > > The problems seems to be with the way you are using the view prefixes in the > 'patterns' function in your urls.py > Refer > to:http://docs.djangoproject.com/en/dev/topics/http/urls/#the-view-prefix > > You have used 'view' string twice. > > Thanks, > Subhranath Chunder. > > > > > > > > On Tue, Apr 19, 2011 at 5:11 AM, Guevara wrote: > > Hello!! > > > I am getting the following error on my index.html page: > > > Exception Type: TemplateSyntaxError > > Exception Value: > > > Caught ImportError while rendering: No module named urls > > > In this line: > > > Login > > > My urls.py: > > > (r'^imobiliaria/', include('auth.urls')), > > > In my auth app, i have this: > > > urlpatterns = patterns('auth.views', > > url(r'^$', views.index, name="index"), <-- this is index page > > url(r'^accounts/login/$', views.login_in, name="login_in"), <-- > > this is login page > > url(r'^logout/$', views.logout_view, name="logout_view"), > > url(r'^register/$', views.register, name="register"), > > url(r'^home/$', views.home, name="home"), > > ) > > > My view to render index.html is: > > > def index(request): > > return render_to_response('imobiliaria/auth/index.html') > > > In my settings.py i have this: > > > AUTH_PROFILE_MODULE = 'imobiliaria.imobiliaria' > > LOGIN_URL = '/imobiliaria/accounts/login/' > > > INSTALLED_APPS = ( > > 'imobiliaria.auth', > > ) > > > ROOT_URLCONF = 'imobiliaria.urls' > > > Anyone know where the problem might be? > > Thanks!! > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-users@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@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-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Import error No module named urls to url login_in in html page
Hi, The problems seems to be with the way you are using the view prefixes in the 'patterns' function in your urls.py Refer to: http://docs.djangoproject.com/en/dev/topics/http/urls/#the-view-prefix You have used 'view' string twice. Thanks, Subhranath Chunder. On Tue, Apr 19, 2011 at 5:11 AM, Guevara wrote: > Hello!! > > I am getting the following error on my index.html page: > > Exception Type: TemplateSyntaxError > Exception Value: > > Caught ImportError while rendering: No module named urls > > > In this line: > >Login > > My urls.py: > > (r'^imobiliaria/', include('auth.urls')), > > In my auth app, i have this: > > urlpatterns = patterns('auth.views', >url(r'^$', views.index, name="index"), <-- this is index page >url(r'^accounts/login/$', views.login_in, name="login_in"), <-- > this is login page >url(r'^logout/$', views.logout_view, name="logout_view"), >url(r'^register/$', views.register, name="register"), >url(r'^home/$', views.home, name="home"), > ) > > > My view to render index.html is: > > def index(request): >return render_to_response('imobiliaria/auth/index.html') > > > In my settings.py i have this: > > AUTH_PROFILE_MODULE = 'imobiliaria.imobiliaria' > LOGIN_URL = '/imobiliaria/accounts/login/' > > INSTALLED_APPS = ( > 'imobiliaria.auth', > ) > > ROOT_URLCONF = 'imobiliaria.urls' > > > > Anyone know where the problem might be? > Thanks!! > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@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-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Import error No module named urls to url login_in in html page
Hello!! I am getting the following error on my index.html page: Exception Type: TemplateSyntaxError Exception Value: Caught ImportError while rendering: No module named urls In this line: Login My urls.py: (r'^imobiliaria/', include('auth.urls')), In my auth app, i have this: urlpatterns = patterns('auth.views', url(r'^$', views.index, name="index"), <-- this is index page url(r'^accounts/login/$', views.login_in, name="login_in"), <-- this is login page url(r'^logout/$', views.logout_view, name="logout_view"), url(r'^register/$', views.register, name="register"), url(r'^home/$', views.home, name="home"), ) My view to render index.html is: def index(request): return render_to_response('imobiliaria/auth/index.html') In my settings.py i have this: AUTH_PROFILE_MODULE = 'imobiliaria.imobiliaria' LOGIN_URL = '/imobiliaria/accounts/login/' INSTALLED_APPS = ( 'imobiliaria.auth', ) ROOT_URLCONF = 'imobiliaria.urls' Anyone know where the problem might be? Thanks!! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Exception Value: No module named urls
I finally fund the problem. A freelancer I have working on the site deleted a urls file in my api app. On Mar 11, 10:34 am, nerdydork wrote: > /home/inzolo/webapps/budgetsite/lib/python2.5 contains "django". That > is the only folder there. This is hosted on Webfaction. > > On Mar 11, 9:35 am, Xavier Ordoquy wrote: > > > > > Hello, > > > > /home/inzolo/webapps/budgetsite/lib/python2.5 > > > You probably want > > /home/inzolo/webapps/budgetsite/lib/python2.5/site-packages instead if it's > > a virtual env. > > > Xavier. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Exception Value: No module named urls
/home/inzolo/webapps/budgetsite/lib/python2.5 contains "django". That is the only folder there. This is hosted on Webfaction. On Mar 11, 9:35 am, Xavier Ordoquy wrote: > Hello, > > > /home/inzolo/webapps/budgetsite/lib/python2.5 > > You probably want /home/inzolo/webapps/budgetsite/lib/python2.5/site-packages > instead if it's a virtual env. > > Xavier. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Exception Value: No module named urls
Hello, > /home/inzolo/webapps/budgetsite/lib/python2.5 You probably want /home/inzolo/webapps/budgetsite/lib/python2.5/site-packages instead if it's a virtual env. Xavier. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Exception Value: No module named urls
I have that folder in my python path. Here is my wsgi file === import os import sys sys.path = ['/home/inzolo/webapps/budgetsite', '/home/inzolo/webapps/budgetsite/budgetsite', '/home/inzolo/webapps/budgetsite/budgetsite/budget', '/home/inzolo/webapps/budgetsite/lib/python2.5'] + sys.path from django.core.handlers.wsgi import WSGIHandler os.environ['DJANGO_SETTINGS_MODULE'] = 'budgetsite.settings' application = WSGIHandler() === I added '/home/inzolo/webapps/budgetsite/budgetsite' & '/home/inzolo/ webapps/budgetsite/budgetsite/budget' trying to fix the problem, but still no luck. On Mar 11, 7:08 am, felix wrote: > its an ImportError which means that it couldn't find your main urls.py > or possibly a sub urls that you are including. > > check your python paths > > you need to include the folder ABOVE the module you are addressing > > eg. > > folder > app > urls.py > models.py > > folder needs to be on the python path > > On Mar 11, 2:13 pm, nerdydork wrote: > > > > > I hired someone to help me write an API using piston. One of the pages > > is returning this error: > > === > > Traceback: > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > > handlers/base.py" in get_response > > 83. request.path_info) > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > > urlresolvers.py" in resolve > > 218. sub_match = pattern.resolve(new_path) > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > > urlresolvers.py" in resolve > > 216. for pattern in self.url_patterns: > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > > urlresolvers.py" in _get_url_patterns > > 245. patterns = getattr(self.urlconf_module, "urlpatterns", > > self.urlconf_module) > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > > urlresolvers.py" in _get_urlconf_module > > 240. self._urlconf_module = > > import_module(self.urlconf_name) > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/utils/ > > importlib.py" in import_module > > 35. __import__(name) > > > Exception Type: ImportError at /api/v0.1/transaction.xml/get/ > > Exception Value: No module named urls > > === > > > I was running Django 1.0. I thought I would first try to update to the > > latest stable version 1.1. I'm still getting the above error, but now > > I am also getting this error on all my admin pages. I can see my admin > > login screen, but once I log in, I get this error page. The rest of > > the site works fine. > > > My guess is that it might have something to do with the URL reverse > > function, but I'm not sure. Anyone have an idea? > > > === > > Environment: > > > Request Method: GET > > Request URL:https://inzolo.com/admin/ > > Django Version: 1.1.1 > > Python Version: 2.5.4 > > Installed Applications: > > ['django.contrib.auth', > > 'django.contrib.contenttypes', > > 'django.contrib.sessions', > > 'django.contrib.sites', > > 'django.contrib.admin', > > 'django.contrib.flatpages', > > 'django_wysiwyg', > > 'registration', > > 'template_utils', > > 'budgetsite.budget', > > 'budgetsite.budget.templatetags.hashkey', > > 'south', > > 'paypal.standard.ipn', > > 'wapi'] > > Installed Middleware: > > ('django.middleware.common.CommonMiddleware', > > 'django.contrib.sessions.middleware.SessionMiddleware', > > 'django.contrib.auth.middleware.AuthenticationMiddleware', > > 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', > > 'budgetsite.budget.middleware.ProStatusMiddleware', > > 'budgetsite.budget.middleware.SecureBudgetPros') > > > Traceback: > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > > handlers/base.py" in get_response > > 92. response = callback(request, *callback_args, > > **callback_kwargs) > > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ > > admin/sites.py" in wrapper > > 196. return self.admin_view(view, cacheable)(*args, > > **kwargs) > > File
Re: Exception Value: No module named urls
its an ImportError which means that it couldn't find your main urls.py or possibly a sub urls that you are including. check your python paths you need to include the folder ABOVE the module you are addressing eg. folder app urls.py models.py folder needs to be on the python path On Mar 11, 2:13 pm, nerdydork wrote: > I hired someone to help me write an API using piston. One of the pages > is returning this error: > === > Traceback: > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > handlers/base.py" in get_response > 83. request.path_info) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > urlresolvers.py" in resolve > 218. sub_match = pattern.resolve(new_path) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > urlresolvers.py" in resolve > 216. for pattern in self.url_patterns: > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > urlresolvers.py" in _get_url_patterns > 245. patterns = getattr(self.urlconf_module, "urlpatterns", > self.urlconf_module) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > urlresolvers.py" in _get_urlconf_module > 240. self._urlconf_module = > import_module(self.urlconf_name) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/utils/ > importlib.py" in import_module > 35. __import__(name) > > Exception Type: ImportError at /api/v0.1/transaction.xml/get/ > Exception Value: No module named urls > === > > I was running Django 1.0. I thought I would first try to update to the > latest stable version 1.1. I'm still getting the above error, but now > I am also getting this error on all my admin pages. I can see my admin > login screen, but once I log in, I get this error page. The rest of > the site works fine. > > My guess is that it might have something to do with the URL reverse > function, but I'm not sure. Anyone have an idea? > > === > Environment: > > Request Method: GET > Request URL:https://inzolo.com/admin/ > Django Version: 1.1.1 > Python Version: 2.5.4 > Installed Applications: > ['django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.admin', > 'django.contrib.flatpages', > 'django_wysiwyg', > 'registration', > 'template_utils', > 'budgetsite.budget', > 'budgetsite.budget.templatetags.hashkey', > 'south', > 'paypal.standard.ipn', > 'wapi'] > Installed Middleware: > ('django.middleware.common.CommonMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware', > 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', > 'budgetsite.budget.middleware.ProStatusMiddleware', > 'budgetsite.budget.middleware.SecureBudgetPros') > > Traceback: > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ > handlers/base.py" in get_response > 92. response = callback(request, *callback_args, > **callback_kwargs) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ > admin/sites.py" in wrapper > 196. return self.admin_view(view, cacheable)(*args, > **kwargs) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/views/ > decorators/cache.py" in _wrapped_view_func > 44. response = view_func(request, *args, **kwargs) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ > admin/sites.py" in inner > 186. return view(request, *args, **kwargs) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/views/ > decorators/cache.py" in _wrapped_view_func > 44. response = view_func(request, *args, **kwargs) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ > admin/sites.py" in index > 374. context_instance=context_instance > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/shortcuts/ > __init__.py" in render_to_response > 20. return HttpResponse(loader.render_to_string(*args, > **kwargs), **httpresponse_kwargs) > File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ > loader.py" in render_to_string > 108. return t.render(context_instance) > File "/home/inzolo/webapps/budgetsite/lib
Exception Value: No module named urls
I hired someone to help me write an API using piston. One of the pages is returning this error: === Traceback: File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ handlers/base.py" in get_response 83. request.path_info) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ urlresolvers.py" in resolve 218. sub_match = pattern.resolve(new_path) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ urlresolvers.py" in resolve 216. for pattern in self.url_patterns: File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ urlresolvers.py" in _get_url_patterns 245. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ urlresolvers.py" in _get_urlconf_module 240. self._urlconf_module = import_module(self.urlconf_name) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/utils/ importlib.py" in import_module 35. __import__(name) Exception Type: ImportError at /api/v0.1/transaction.xml/get/ Exception Value: No module named urls === I was running Django 1.0. I thought I would first try to update to the latest stable version 1.1. I'm still getting the above error, but now I am also getting this error on all my admin pages. I can see my admin login screen, but once I log in, I get this error page. The rest of the site works fine. My guess is that it might have something to do with the URL reverse function, but I'm not sure. Anyone have an idea? === Environment: Request Method: GET Request URL: https://inzolo.com/admin/ Django Version: 1.1.1 Python Version: 2.5.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', 'django_wysiwyg', 'registration', 'template_utils', 'budgetsite.budget', 'budgetsite.budget.templatetags.hashkey', 'south', 'paypal.standard.ipn', 'wapi'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'budgetsite.budget.middleware.ProStatusMiddleware', 'budgetsite.budget.middleware.SecureBudgetPros') Traceback: File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ handlers/base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ admin/sites.py" in wrapper 196. return self.admin_view(view, cacheable)(*args, **kwargs) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/views/ decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ admin/sites.py" in inner 186. return view(request, *args, **kwargs) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/views/ decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/contrib/ admin/sites.py" in index 374. context_instance=context_instance File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/shortcuts/ __init__.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ loader.py" in render_to_string 108. return t.render(context_instance) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ __init__.py" in render 178. return self.nodelist.render(context) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ __init__.py" in render 779. bits.append(self.render_node(node, context)) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ __init__.py" in render_node 792. return node.render(context) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ loader_tags.py" in render 97. return compiled_parent.render(context) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ __init__.py" in render 178. return self.nodelist.render(context) File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/template/ __init__.py&quo
Re: No module named urls
Aaargh! I knew it had to be something like that! Thanx Karen. On Feb 7, 5:20 pm, Karen Tracey wrote: > On Sun, Feb 7, 2010 at 4:27 PM, Brian wrote: > > Hi all, > > > I'm putting together a Django application from scratch and have > > created my models. I'm trying to activate the admin site now and am > > getting the above error. I've tried everything I found on mailing > > lists with no luck. This includes the old style settings.py (which is > > commented out now) as well as the new. Note, the model has synced to > > the database correctly. > > > Here is the contents of the admin.py file which resides in my app > > directory (triagedb/triagedb_app): > > > [snip] > > Here is my settings file: > > [snip] > > > ROOT_URLCONF = 'triagedb_app.urls' > > > [snip] > > > INSTALLED_APPS = ( > > #'django.contrib.auth', > > #'django.contrib.contenttypes', > > 'django.contrib.sessions', > > 'django.contrib.sites', > > 'django.contrib.admin', > > 'triagedb.triagedb_app', > > ) > > > Here is my urls..py file: > > [snip] > > The urls.py file you show looks like it is a base project urls.py file, > auto-created perhaps when you ran django-admin.py startproject triagedb. > That file would have been place in triagedb/urls.py. Yet your ROOT_URLCONF > settings is ''triagedb_app.urls", which will be looking to load > triagedb_app/urls.py from somewhere in the Python path. Where exactly is > this urls.py file located? If it is really in triagedb/urls.py then the > URLCONF setting should be 'triagedb.urls'. > > Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: No module named urls
On Sun, Feb 7, 2010 at 4:27 PM, Brian wrote: > Hi all, > > I'm putting together a Django application from scratch and have > created my models. I'm trying to activate the admin site now and am > getting the above error. I've tried everything I found on mailing > lists with no luck. This includes the old style settings.py (which is > commented out now) as well as the new. Note, the model has synced to > the database correctly. > > Here is the contents of the admin.py file which resides in my app > directory (triagedb/triagedb_app): > > [snip] > Here is my settings file: > [snip] > > ROOT_URLCONF = 'triagedb_app.urls' > > [snip] > > INSTALLED_APPS = ( >#'django.contrib.auth', >#'django.contrib.contenttypes', >'django.contrib.sessions', >'django.contrib.sites', >'django.contrib.admin', >'triagedb.triagedb_app', > ) > > Here is my urls..py file: > [snip] > The urls.py file you show looks like it is a base project urls.py file, auto-created perhaps when you ran django-admin.py startproject triagedb. That file would have been place in triagedb/urls.py. Yet your ROOT_URLCONF settings is ''triagedb_app.urls", which will be looking to load triagedb_app/urls.py from somewhere in the Python path. Where exactly is this urls.py file located? If it is really in triagedb/urls.py then the URLCONF setting should be 'triagedb.urls'. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No module named urls
Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/servers/basehttp.py", line 279, in run self.result = application(self.environ, self.start_response) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/servers/basehttp.py", line 651, in __call__ return self.application(environ, start_response) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ response = self.get_response(request) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/handlers/base.py", line 73, in get_response response = middleware_method(request) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/middleware/common.py", line 56, in process_request if (not _is_valid_path(request.path_info) and File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/urlresolvers.py", line 303, in resolve return get_resolver(urlconf).resolve(path) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/urlresolvers.py", line 216, in resolve for pattern in self.url_patterns: File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/urlresolvers.py", line 245, in _get_url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/core/urlresolvers.py", line 240, in _get_urlconf_module self._urlconf_module = import_module(self.urlconf_name) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) ImportError: No module named urls -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: No module named urls (again)
Hi Michael, Thanks for your suggestion. I´ve added the whole project to the PYTHONPATH under project->properties->PYTHONPATH->Add source folder And now it works! I had to solve an additional error, the app couldn´t find my "templates" dir. When running the server on eclipse, it threw an error "TemplateDoesNotExist at /". It was trying to take the template from "c:\eclipse\templates \temp.html" So I changed the settings variable template_dirs from "templates/", to 'E:/dev/nav/pr1/templates/' Don´t know why the relative didn´t work. Anyway, this is now working. For future reference, if anyone has this problem, check also if your manage.py it´s on the root folder, not on the src. Thanks again for your help. Pablo Solera On Dec 15, 9:38 pm, Michael K wrote: > On Dec 15, 3:18 pm, Pablo Solera wrote: > > > When I try to run the same server from eclipse, it seems that > > something is not correct. > > I got the error: ImportError at / "No module named urls" > > I do have the urls.py on my application, and averything works fine out > > of eclipse. > > > Could it be a PATH problem? How could I debug it? > > Did you add your project path to the PYTHONPATH environment variable > in your Run profile? That's what the problem sounds like - Eclipse's > environment doesn't know to tell Python that your Django project needs > to be in the PYTHONPATH. > > -- > Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: No module named urls (again)
On Dec 15, 3:18 pm, Pablo Solera wrote: > When I try to run the same server from eclipse, it seems that > something is not correct. > I got the error: ImportError at / "No module named urls" > I do have the urls.py on my application, and averything works fine out > of eclipse. > > Could it be a PATH problem? How could I debug it? Did you add your project path to the PYTHONPATH environment variable in your Run profile? That's what the problem sounds like - Eclipse's environment doesn't know to tell Python that your Django project needs to be in the PYTHONPATH. -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No module named urls (again)
Hi everyone, This is my first post ans as usual it deals with a problem. I hope it isn´t answered yet. I´ve searched across the group and didn ´t find the solution (A similar problem didn´t detail the solution - no renaming here) Ok lets describe it: I´m trying to start developing with eclipse + pydev + django. I´ve followed the superb instructions here: http://pydev.blogspot.com/2006/09/configuring-pydev-to-work-with-django.html When I run my server from command line (windows) It works! E:\dev\nav\pr1>manage.py runserver When I try to run the same server from eclipse, it seems that something is not correct. I got the error: ImportError at / "No module named urls" I do have the urls.py on my application, and averything works fine out of eclipse. Could it be a PATH problem? How could I debug it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ImportError: No module named urls
Ah fantastic many thanks. All working nicely now much appreciated. On Jul 10, 4:16 pm, Russell Keith-Magee wrote: > On Fri, Jul 10, 2009 at 10:33 PM, huw_at1 wrote: > > > So I switched from mod_python to mod_wsgi since I don;t really know > > what is going on and I realise mod_wsgi is recommended for 1.1 now. > > Anyway the rest of my site works fine now. The only part still not > > working is the admin section which fails with this "No module named > > urls" error as can be seen in the traceback above. > > > For my settings I have the root urlconf as "myapp.urls". > > > In the urls file I have: > > > (r'^admin/(.*)', include('admin.site.urls')), > > > as is specified in the latest release notes. > > That isn't what the release notes say - the new form for the admin includes > is: > > (r'^admin/', include(admin.site.urls)), > > Note that there is no need for the wildcard regex pattern, and there > are no quotes around admin.site.urls - it isn't a string, it's an > attribute on the site object. This form was introduced for Django > v1.1. > > However, the old form ( the same as your include('admin.site.root') ) > should continue to work. This form has been officially deprecated, but > it is guaranteed to work until the release of Django v1.3 (i.e., two > full releases in a deprecated state). > > Yours, > Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImportError: No module named urls
On Sat, Jul 11, 2009 at 12:26 PM, selcukcihan wrote: > > Using trunk with apache + mod_wsgi, > > Hi, i also have url problems with admin. First of all, if i use the > depreciated method(r'^admin/(.*)', admin.site.root) everything works > fine. > > Well, since there is a new method, i switched to it; using > (r'^admin/', include(admin.site.urls)). > > The problem is on www.mydomain.com/admin/ the links for "change > password" and "logout" (by default on the top right) are corrupt. For > instance, change password link reads > http://www.mydomain.com/admin/admin/password_change/ > it seems that the url is formed by appending "admin/password_change/" > to the current page's url, rather than appending to site root. > > The problem can be found on each page inside admin, for instance on > users page (http://www.mydomain.com/admin/auth/user/) the link for > change password reads > http://www.mydomain.com/admin/auth/user/admin/password_change/ > > see the pattern? > > i could not figure out what is causing the problem, any idea/pointer > truely appreciated (This question doesn't really seem to have anything to do with the original thread topic? While your question has to do with urls and this thread title has an exception that mentions urls, you are not seeing that exception so it probably would have been better to start a new thread. Mushing every conversation that has anything to do with urls into a single thread on this mailing list would make for one very confusing and disjointed thread.) What you have described is: http://code.djangoproject.com/ticket/10061 This ticket is the big blocker for getting 1.1 finalized, and is being actively worked on. It has a patch you could try. Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImportError: No module named urls
Using trunk with apache + mod_wsgi, Hi, i also have url problems with admin. First of all, if i use the depreciated method(r'^admin/(.*)', admin.site.root) everything works fine. Well, since there is a new method, i switched to it; using (r'^admin/', include(admin.site.urls)). The problem is on www.mydomain.com/admin/ the links for "change password" and "logout" (by default on the top right) are corrupt. For instance, change password link reads http://www.mydomain.com/admin/admin/password_change/ it seems that the url is formed by appending "admin/password_change/" to the current page's url, rather than appending to site root. The problem can be found on each page inside admin, for instance on users page (http://www.mydomain.com/admin/auth/user/) the link for change password reads http://www.mydomain.com/admin/auth/user/admin/password_change/ see the pattern? i could not figure out what is causing the problem, any idea/pointer truely appreciated On Jul 10, 6:16 pm, Russell Keith-Magee wrote: > On Fri, Jul 10, 2009 at 10:33 PM, huw_at1 wrote: > > That isn't what the release notes say - the new form for theadminincludes is: > > (r'^admin/', include(admin.site.urls)), > > Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImportError: No module named urls
On Fri, Jul 10, 2009 at 10:33 PM, huw_at1 wrote: > > So I switched from mod_python to mod_wsgi since I don;t really know > what is going on and I realise mod_wsgi is recommended for 1.1 now. > Anyway the rest of my site works fine now. The only part still not > working is the admin section which fails with this "No module named > urls" error as can be seen in the traceback above. > > For my settings I have the root urlconf as "myapp.urls". > > In the urls file I have: > > (r'^admin/(.*)', include('admin.site.urls')), > > as is specified in the latest release notes. That isn't what the release notes say - the new form for the admin includes is: (r'^admin/', include(admin.site.urls)), Note that there is no need for the wildcard regex pattern, and there are no quotes around admin.site.urls - it isn't a string, it's an attribute on the site object. This form was introduced for Django v1.1. However, the old form ( the same as your include('admin.site.root') ) should continue to work. This form has been officially deprecated, but it is guaranteed to work until the release of Django v1.3 (i.e., two full releases in a deprecated state). Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImportError: No module named urls
So I switched from mod_python to mod_wsgi since I don;t really know what is going on and I realise mod_wsgi is recommended for 1.1 now. Anyway the rest of my site works fine now. The only part still not working is the admin section which fails with this "No module named urls" error as can be seen in the traceback above. For my settings I have the root urlconf as "myapp.urls". In the urls file I have: (r'^admin/(.*)', include('admin.site.urls')), as is specified in the latest release notes. Although googling around it is confusing as to whether this should be used or: (r'^admin/(.*)', include('admin.site.root')), should be used. Also I'm not sure if I should substitute "site" for "myapp" in here. Again I have found a couple of threads where someone has experienced something similar better exaclty the same as what I am experiencing. Any further suggestions? Many thanks On Jul 9, 5:44 pm, huw_at1 wrote: > Hmm I didn't change any imports as far as i am aware. > > By full traceback do you mean the entirety of the error in the error > log? > > Such as: > > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] mod_python > (pid=26734, interpreter='ccprod.arrowt.co.uk', phase='PythonHandler', > handler='django.core.handlers.modpython'): Application error > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ServerName: > 'ccprod.arrowt.co.uk' > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] DocumentRoot: > '/var/www' > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] URI: '/admin' > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Location: '/' > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Directory: > None > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Filename: '/ > var/www/admin' > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] PathInfo: '' > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Traceback > (most recent call last): > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/mod_python/importer.py", line 1542, in > HandlerDispatch\n default=default_handler, arg=req, > silent=hlist.silent) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/mod_python/importer.py", line 1234, in > _process_target\n result = _execute_target(config, req, object, > arg) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/mod_python/importer.py", line 1133, in > _execute_target\n result = object(arg) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/handlers/modpython.py", line > 228, in handler\n return ModPythonHandler()(req) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/handlers/modpython.py", line > 201, in __call__\n response = self.get_response(request) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/handlers/base.py", line 73, in > get_response\n response = middleware_method(request) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/middleware/common.py", line 57, in > process_request\n _is_valid_path("%s/" % request.path_info)): > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/middleware/common.py", line 142, in > _is_valid_path\n urlresolvers.resolve(path) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/urlresolvers.py", line 262, in > resolve\n return get_resolver(urlconf).resolve(path) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/urlresolvers.py", line 186, in > resolve\n sub_match = pattern.resolve(new_path) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/urlresolvers.py", line 184, in > resolve\n for pattern in self.url_patterns: > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ > lib/python2.6/dist-packages/django/core/urlresolvers.py", line 213, in > _get_url_patterns\n patterns = getattr(self.urlconf_module, > "urlpatterns", self.urlconf_module) > [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]
Re: TemplateSyntaxError: No module named urls
SOLVED. It was a wrong URL mapping, in the frontend, that I was not seing, and the stack trace didn't give me a clue of where it was... but thanks, anyway... Diogo On Jul 9, 3:35 am, diogobaeder wrote: > I searched for this kind of error in this group, but there were only > old posts, from when django had different urls.py configs, so I'm > asking for help on this: > > http://dpaste.com/64906/ > > Thanks in advance! > > Diogo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImportError: No module named urls
Hmm I didn't change any imports as far as i am aware. By full traceback do you mean the entirety of the error in the error log? Such as: [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] mod_python (pid=26734, interpreter='ccprod.arrowt.co.uk', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ServerName: 'ccprod.arrowt.co.uk' [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] DocumentRoot: '/var/www' [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] URI: '/admin' [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Location: '/' [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Directory: None [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Filename: '/ var/www/admin' [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] PathInfo: '' [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Traceback (most recent call last): [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/mod_python/importer.py", line 1542, in HandlerDispatch\ndefault=default_handler, arg=req, silent=hlist.silent) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/mod_python/importer.py", line 1234, in _process_target\nresult = _execute_target(config, req, object, arg) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/mod_python/importer.py", line 1133, in _execute_target\nresult = object(arg) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/handlers/modpython.py", line 228, in handler\nreturn ModPythonHandler()(req) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/handlers/modpython.py", line 201, in __call__\nresponse = self.get_response(request) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/handlers/base.py", line 73, in get_response\nresponse = middleware_method(request) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/middleware/common.py", line 57, in process_request\n_is_valid_path("%s/" % request.path_info)): [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/middleware/common.py", line 142, in _is_valid_path\nurlresolvers.resolve(path) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/urlresolvers.py", line 262, in resolve\nreturn get_resolver(urlconf).resolve(path) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/urlresolvers.py", line 186, in resolve\nsub_match = pattern.resolve(new_path) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/urlresolvers.py", line 184, in resolve\nfor pattern in self.url_patterns: [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/urlresolvers.py", line 213, in _get_url_patterns\npatterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/core/urlresolvers.py", line 208, in _get_urlconf_module\nself._urlconf_module = import_module (self.urlconf_name) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] File "/usr/ lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module\n__import__(name) [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ImportError: No module named urls On 9 July, 16:59, Friðrik Már Jónsson wrote: > Hey! > > A full traceback could be helpful. > > A lot of time when you've got really strange import errors they have > something to do with circular imports. Did you change any imports > right before or after the upgrade? > > Regards, > Friðrik Már > > On Jul 9, 2009, at 3:25 PM, huw_at1 wrote: > > > > > Hi all, > > > I have just been moving my website to a production server and am > > having some difficulty getting it working. I have upgraded the Django > > from 1.0 on my development server to 1.1 on the production server. > > When I try to access the admin pages I get an Internal Server Error > > and a message in the apache logs stating "Import Error: No module > > named urls". I have tri
Re: ImportError: No module named urls
Hey! A full traceback could be helpful. A lot of time when you've got really strange import errors they have something to do with circular imports. Did you change any imports right before or after the upgrade? Regards, Friðrik Már On Jul 9, 2009, at 3:25 PM, huw_at1 wrote: > > Hi all, > > I have just been moving my website to a production server and am > having some difficulty getting it working. I have upgraded the Django > from 1.0 on my development server to 1.1 on the production server. > When I try to access the admin pages I get an Internal Server Error > and a message in the apache logs stating "Import Error: No module > named urls". I have tried running the shell and importing the urls > module from within and outside of the local directory both of which > work fine. > > I'm guessing it's either some value in my settings file or something > is non-backwards compatible going from 1.0 to 1.1 but I am a bit > clueless as to what atm. Any suggestions would be most welcome. > > Many thanks > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
ImportError: No module named urls
Hi all, I have just been moving my website to a production server and am having some difficulty getting it working. I have upgraded the Django from 1.0 on my development server to 1.1 on the production server. When I try to access the admin pages I get an Internal Server Error and a message in the apache logs stating "Import Error: No module named urls". I have tried running the shell and importing the urls module from within and outside of the local directory both of which work fine. I'm guessing it's either some value in my settings file or something is non-backwards compatible going from 1.0 to 1.1 but I am a bit clueless as to what atm. Any suggestions would be most welcome. Many thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
TemplateSyntaxError: No module named urls
I searched for this kind of error in this group, but there were only old posts, from when django had different urls.py configs, so I'm asking for help on this: http://dpaste.com/64906/ Thanks in advance! Diogo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
Ok, i got it all sorted out. Thanks Rob and Malcom. It was a problem in my accounts.urls.py file. I had made some placeholder urls to edit and save but never put them into the view.py. I commented them out for now and it worked like a champ. Its wierd this never poped up in my windows box useing manage.py runserver, but off the linux box it freaked out. Thanks again! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
On Dec 4, 12:59 am, Rob Hudson <[EMAIL PROTECTED]> wrote: > I'll keep poking around a bit and see if I can dig up anything > further. I think I tracked it down... Looking at the tracebacks above, you can see the first time through, it winds up on line 198 which tries to import the urls.py file. In my particular case, the urlconf_name was "profiles.urls". And indeed, my local (in my project) profiles app does not have a urls.py file in it. If I `touch profiles/urls.py` things work, sort of. The thing is, I'm using James Bennett's django-profiles package and it's not in my project but it's on my Python path. There are no models, so I never put it in my INSTALLED_APPS (though reading now, the docs say I should have)... I only reference the profiles.urls in my root urls via include(), and that pulls in the urls from the profiles app on my Python path. I have a local project app also called profiles, however, that doesn't include a urls.py (because I'm using the one from James'), and this is the reason for the breakage. Having the app named `profiles` is the perfect name but it can't exist on my Python path and in my project without a conflict. I tested renaming mine, putting the "profiles" in my INSTALLED_APPS, and all is well now. -Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
On Dec 3, 11:01 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > This is an area where Django has poor error handling and we're slowly > cutting them down. So you have to do a bit of commenting out and > experimenting on the command line (just try a simple reverse() call each > time to trigger it) to work out the problem. > > It's the first error that you should pay attention to here. Subsequent > "successes" are misleading -- they're not raising errors, but something > is still not working properly. Is this helpful at all then? This is importing `reverse` and running it twice with the same URL named view where I'm seeing the error. I'm doing it twice to see the difference... >>> from django.core.urlresolvers import reverse as r >>> r('django-admindocs-docroot') Traceback (most recent call last): File "", line 1, in File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 254, in reverse *args, **kwargs))) File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 227, in reverse possibilities = self.reverse_dict.getlist(lookup_view) File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 161, in _get_reverse_dict for name in pattern.reverse_dict: File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 154, in _get_reverse_dict if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'): File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls >>> r('django-admindocs-docroot') Traceback (most recent call last): File "", line 1, in File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 254, in reverse *args, **kwargs))) File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 243, in reverse "arguments '%s' not found." % (lookup_view, args, kwargs)) NoReverseMatch: Reverse for 'django-admindocs-docroot' with arguments '()' and keyword arguments '{}' not found. I was suspecting that not having this line in my urls.py was tripping it up so I added it: (r'^admin/doc/', include('django.contrib.admindocs.urls')), A slight difference was observed... >>> from django.core.urlresolvers import reverse as r >>> r('django-admindocs-docroot') Traceback (most recent call last): File "", line 1, in File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 254, in reverse *args, **kwargs))) File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 227, in reverse possibilities = self.reverse_dict.getlist(lookup_view) File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 161, in _get_reverse_dict for name in pattern.reverse_dict: File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 154, in _get_reverse_dict if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'): File "/Users/rob/django/django-trunk/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls >>> r('django-admindocs-docroot') '/admin/doc/' I'll keep poking around a bit and see if I can dig up anything further. -Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
On Wed, 2008-12-03 at 22:49 -0800, Rob Hudson wrote: > It's odd... I'm getting the exact same error at the exact same spot, > running Django trunk r9550. What's strange is that it gets the 500 > error on first request, and is ok all subsequent requests. That type of error means there's a problem importing something that the urls depends on. The first time around, the import attempt is raising an error. The next time around, the broken module is already "imported" (in the sense of bits of it being in sys.modules) and so a repeat attempt isn't made. Reversing URLs has to process all of your URLconf file, so the error isn't necessarily in the exact are you're reversing. It could be some view function somewhere in a nested URL Conf that is imported as part of working out all the reversable possibilities. This is an area where Django has poor error handling and we're slowly cutting them down. So you have to do a bit of commenting out and experimenting on the command line (just try a simple reverse() call each time to trigger it) to work out the problem. It's the first error that you should pay attention to here. Subsequent "successes" are misleading -- they're not raising errors, but something is still not working properly. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
It's odd... I'm getting the exact same error at the exact same spot, running Django trunk r9550. What's strange is that it gets the 500 error on first request, and is ok all subsequent requests. On Nov 26, 9:34 am, TheIvIaxx <[EMAIL PROTECTED]> wrote: > So i've narrowed down the problem more. Its failing on the template > call to {% url django-admindocs-docroot as docsroot %} on the admin > page and all other pages. If i remove this line, the site works just > fine, recognizing all urls defined. Not sure just the template engine > would fail to see the urls.py, but everything else does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
So i've narrowed down the problem more. Its failing on the template call to {% url django-admindocs-docroot as docsroot %} on the admin page and all other pages. If i remove this line, the site works just fine, recognizing all urls defined. Not sure just the template engine would fail to see the urls.py, but everything else does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
Its going to be running on apache, but right now im getting this error on the development server for django. The PYTHONPATH in the error has the project dir in it. I verified that PYTHONPATH has the project dir from putty. Not sure what else to try. Oh and starting the shell from a temp dir, importing urls went fine. On Nov 25, 11:32 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > I just moved my site to a production environment and i get > > this error when trying to view the admin stuff. I want to say > > its a path issue? If i use manage.py shell, i can import urls > > just fine. Any ideas on why this error is popping up? > > My first thought concurs with your path issue. What's your > server setup (Apache? lighttpd?) and within that config, what's > your $PYTHONPATH set to? My guess is that it doesn't include the > directory containing your urls.py which, for mod_python would be > a line like > > PythonPath "['/path/to/project'] + sys.path" > > Since it's working from your manage.py shell, are you either > running manage.py from within that directory (if so, try running > it from another directory such as > > cd ~/tmp > ~/dev/proj/manage.py shell > > to see if it still works), or do you set your $PYTHONPATH in your > current shell (such as your .bashrc)? > > -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
> I just moved my site to a production environment and i get > this error when trying to view the admin stuff. I want to say > its a path issue? If i use manage.py shell, i can import urls > just fine. Any ideas on why this error is popping up? My first thought concurs with your path issue. What's your server setup (Apache? lighttpd?) and within that config, what's your $PYTHONPATH set to? My guess is that it doesn't include the directory containing your urls.py which, for mod_python would be a line like PythonPath "['/path/to/project'] + sys.path" Since it's working from your manage.py shell, are you either running manage.py from within that directory (if so, try running it from another directory such as cd ~/tmp ~/dev/proj/manage.py shell to see if it still works), or do you set your $PYTHONPATH in your current shell (such as your .bashrc)? -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
No module named urls
I just moved my site to a production environment and i get this error when trying to view the admin stuff. I want to say its a path issue? If i use manage.py shell, i can import urls just fine. Any ideas on why this error is popping up? Request Method: GET Request URL:http://X.X.X.X:8000/admin/ Exception Type: TemplateSyntaxError Exception Value: Caught an exception while rendering: No module named urls Original Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/template/debug.py", line 71, in render_node result = node.render(context) File "/usr/lib/python2.4/site-packages/django/template/ defaulttags.py", line 373, in render url = reverse(self.view_name, args=args, kwargs=kwargs) File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 253, in reverse return iri_to_uri(u'%s%s' % (prefix, get_resolver(urlconf).reverse (viewname, File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 227, in reverse possibilities = self.reverse_dict.getlist(lookup_view) File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 161, in _get_reverse_dict for name in pattern.reverse_dict: File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 154, in _get_reverse_dict if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'): File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Import error exception "No module named urls" when running from eclipse
DragonSlayre wrote: [at the top, but it's now moved to the bottom] > On Oct 22, 2:03 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > >> DragonSlayre wrote: >> >>> Hi, I'm new to django/python, and I'm testing out eclipse for >>> development. >>> >>> I'm using pydev, and managed to run my app, but then when I go to the >>> web page, I get: >>> >>> ImportError at /time/ >>> No module named urls >>> >> You'll need to include the code for the view that is being called, and >> possibly your urls.py >> Do you have a urls.py in your project? >> >> Jeff Anderson >> >> signature.asc >> < 1KViewDownload >> > Thanks for your help, > > It turns out that it was a problem to do with the renaming > functionality not working properly in eclipse. I tried renaming my > package - and that doesn't work for some reason, and then my hack > around caused a problem when I created a new package, which ultimately > stuffed up which package eclipse was looking in when launching the > app. > > Is it *normal* for rename to not work properly for the packages in > eclipse using pydev? > > My solution to this was to create a new project, with the package name > I wanted, and to import the code I was previously using. If it's just > my version, then I should probably find out why my version doesn't > support rename. > > It would be helpful if there were an "app rename" and "project rename" tool but at present I don't believe there is. The fact is that these names do pervade the code, so as you have found out it's not as straightforward as it should be to change them retrospectively (though it's by no means impossible). regards Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Import error exception "No module named urls" when running from eclipse
Thanks for your help, It turns out that it was a problem to do with the renaming functionality not working properly in eclipse. I tried renaming my package - and that doesn't work for some reason, and then my hack around caused a problem when I created a new package, which ultimately stuffed up which package eclipse was looking in when launching the app. Is it *normal* for rename to not work properly for the packages in eclipse using pydev? My solution to this was to create a new project, with the package name I wanted, and to import the code I was previously using. If it's just my version, then I should probably find out why my version doesn't support rename. Louis On Oct 22, 2:03 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > DragonSlayre wrote: > > Hi, I'm new to django/python, and I'm testing out eclipse for > > development. > > > I'm using pydev, and managed to run my app, but then when I go to the > > web page, I get: > > > ImportError at /time/ > > No module named urls > > You'll need to include the code for the view that is being called, and > possibly your urls.py > Do you have a urls.py in your project? > > Jeff Anderson > > signature.asc > < 1KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Import error exception "No module named urls" when running from eclipse
DragonSlayre wrote: > Hi, I'm new to django/python, and I'm testing out eclipse for > development. > > I'm using pydev, and managed to run my app, but then when I go to the > web page, I get: > > ImportError at /time/ > No module named urls > You'll need to include the code for the view that is being called, and possibly your urls.py Do you have a urls.py in your project? Jeff Anderson signature.asc Description: OpenPGP digital signature
Import error exception "No module named urls" when running from eclipse
Hi, I'm new to django/python, and I'm testing out eclipse for development. I'm using pydev, and managed to run my app, but then when I go to the web page, I get: ImportError at /time/ No module named urls Request Method: GET Request URL:http://localhost:8080/time/ Exception Type: ImportError Exception Value: No module named urls Exception Location: C:\python25\lib\site-packages\django\core \urlresolvers.py in _get_urlconf_module, line 197 Python Executable: C:\Python25\python.exe Python Version: 2.5.2 I'm guessing that I probably need to include a library in eclipse or something like that - any ideas??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: No module named urls
Hi, This same error materialized in another way in my case. It said: Caught an exception while rendering: Tried change_stage in module django.contrib.admin.views.main. Error was: 'module' object has no attribute 'change_stage' I spent half a day figuring this out with the help of this thread. It turned out that the cause, in my case, was because I missed a pre-1.0- style admin entry in an urls.py that was included in the main urls.py. My problem was solved as soon as I changed that to the 1.0 preferred way as specified in: http://docs.djangoproject.com/en/dev/intro/tutorial02/#activate-the-admin-site Just thought I'd post this as an addition to this thread in case anyone else has the same problem. -geir On Aug 14, 10:48 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, Aug 14, 2008 at 6:42 PM, tooper gao <[EMAIL PROTECTED]> wrote: > > > how can you change it ? and I have this errors too. > > For the specific error mentioned by the original poster, it's the first > change noted here: > > http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Merge... > > that is, the change in urlconfs. There will be more changes needed in your > code, to move admin declarations out of the model classes, all documented > there. > > Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImportError: No module named urls
> I am just starting out with django (and python). I have already worked > through the tutorial successfully; now I am going through it again > adapting the examples to suit the web app I want to build (a local > book sharing scheme). What I have done so far is to define the models, > create the database and tables, and add the admin app to > INSTALLED_APPS. I have uncommmented the line in urls.py so that it now > looks like this: > > from django.conf.urls.defaults import * > > urlpatterns = patterns('', ># Example: ># (r'^horace/', include('horace.apps.foo.urls.foo')), I might be mistaken, but generally, the include would end with '.urls'. It is also likely (depending on your directory structure and setup), that the actually include would more like include('apps.foo.urls') assuming 'foo' is an app & subdirectory within the apps directory, and contains __init__.py, views.py models.py and urls.py > > ># Uncomment this for admin: > (r'^admin/', include('django.contrib.admin.urls')), > ) > > when I start the test server with 'python manage.py runserver', and > try to look at the admin page at: > http://127.0.0.1:8000/admin/ > it comes up with a page saying: > > ImportError at /admin/ > No module named urls > Request Method: GET > Request URL: http://127.0.0.1:8000/admin/ > Exception Type: ImportError > Exception Value: No module named urls > Exception Location: /var/lib/python-support/python2.5/django/core/ > urlresolvers.py in _get_urlconf_module, line 161 > > I have checked that the django tutorial app still works, so the > problem seems to be with what I've done rather than the django > installation. > > any help appreciated. thanks, > > andy baxter. > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
ImportError: No module named urls
hello, I am just starting out with django (and python). I have already worked through the tutorial successfully; now I am going through it again adapting the examples to suit the web app I want to build (a local book sharing scheme). What I have done so far is to define the models, create the database and tables, and add the admin app to INSTALLED_APPS. I have uncommmented the line in urls.py so that it now looks like this: from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: # (r'^horace/', include('horace.apps.foo.urls.foo')), # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls')), ) when I start the test server with 'python manage.py runserver', and try to look at the admin page at: http://127.0.0.1:8000/admin/ it comes up with a page saying: ImportError at /admin/ No module named urls Request Method: GET Request URL:http://127.0.0.1:8000/admin/ Exception Type: ImportError Exception Value:No module named urls Exception Location: /var/lib/python-support/python2.5/django/core/ urlresolvers.py in _get_urlconf_module, line 161 I have checked that the django tutorial app still works, so the problem seems to be with what I've done rather than the django installation. any help appreciated. thanks, andy baxter. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---