Request Method: | GET |
---|---|
Request URL: | http://<my IP>/ |
Using the URLconf defined in stockprices.urls
, Django tried these URL patterns, in this order:
The current URL, , didn't match any of these.
You're seeing this error because you have DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard 404 page.
The app http://<my IP>/data/ works fine.
If I remove the line: url(r'^data/', include('data.urls')),
then the root app works a treat:
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05cf9421-5481-4e6a-b1a9-0ae874dbe860%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
On Tuesday 31 January 2017 06:51:35 Thames Khi wrote:
> I added the following to main site urls.py:
and I assume this also contains:
from data import views
> url(r'^$', views.home, name='home'),
>
> and added the following to the /data/views.py file.
>
> def home(request):
> return HttpResponse("<h1>Main Page</h1>")
>
> This somewhat makes sense, just wondering why the main site does not
> require a views.py file
It does in the real world, but you deligated the response to the 'data' app. The main project is just an app like any other. It is only special because it is the entry point of the project, but nothing prevents you from adding models and views there as well.
When homepages become complicated this is exactly what people do. Either that, or they create a "homepage" app.
--
Melvyn Sopacua