Re: How can I solve the broken home page in the root folder?

2017-02-03 Thread Melvyn Sopacua
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

Re: How can I solve the broken home page in the root folder?

2017-01-31 Thread Thames Khi
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

Re: How can I solve the broken home page in the root folder?

2017-01-31 Thread ludovic coues
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

How can I solve the broken home page in the root folder?

2017-01-31 Thread Thames Khi
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/',