1👍
✅
you see 404 error, because you don’t have the default handler, add to url patterns something like this:
('^$', views.default )
and probably you need to add the web application path to the sys.path variable to be able to ‘see’ your modules:
import sys
sys.path.append(path_to_site)
1👍
I’m not sure what your actual question is.
You’ve requested the root page, \
, but have only defined a URL for \hello\
, so obviously Django can’t find what you’ve requested. If you want your hello
view to match against the site root, do this:
urlpatterns = patterns('',
(r'^$', hello),
)
I don’t understand the question about the from mysite.views import hello
. This will work if the parent of mysite
is on the Python path.
Source:stackexchange.com