And now when I try to open localhost:8000/site/I get the following
error:
ImportError at /site/
No module named index
Request Method: GET
Request URL: http://localhost:8000/site/
Exception Type: ImportError
Exception Value: No module named index
Exception Location: <unknown> in ?, line ?
With a really usefull trackback:
* <unknown> in ?
I'm at a complete loss here. What's wrong with it?
PS: I'm using django from the svn on SuSE 10.1. I got the same error
when I tried apache2.
you either want include('mysite.hello.urls') to include the urls.py in your
app, or
(r'^site/$', 'mysite.hello.views.index'),
to execute that view when they visit site/
You're trying to include the view as urls, and that won't work 8)
--
Bryan L. Fordham
socialistsushi.com
Sushi For Everyone
Oh *gawd* I'm such a twat!
Thank you!
this situation is not unknown to me :)
First you should check if you have __init__.py files along mysite.hello.views. They can be empty but thats what python expects.
Than check if mysite.hello or mysite is in the settings.py in INSTALLED_APPS. If so use the shell-mode:
python manage.py shell # (you maybe need to set a DJANGO_SETTINGS_MODULE)
import mysite
import mysite.hello
import mysite.hello.views
from mysite.hello.views import index
import urls
from urls import urlpatterns
You will get an error somewhere and that error message points you to the problem.
Regards,
Dirk
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer