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
Thank you very much.
I added the following to main site urls.py:
url(r'^$', views.home, name='home'),
and added the following to the /data/views.py file.
def home(request):
return HttpResponse("Main Page")
This somewhat makes sense, just wondering why the main site does not
require a
Try "url(r'^/', include('data.urls'))," in url_patterns. This should do
what you want.
Alternatively, you can set a simple view on r'^$' that will redirect to
your main app.
On 31 Jan 2017 1:09 p.m., "Thames Khi" wrote:
I followed a simple tutorial to create a sample
I followed a simple tutorial to create a sample application in DJango. Here
is my code for urls.py in the root folder:
from django.conf.urls import url, include
from django.contrib import admin
#from data import views
urlpatterns = [
url(r'^data/', include('data.urls')),
url(r'^admin/',
4 matches
Mail list logo