0

I am using Django non-rel in Google App Engine, and my URLConf seems not to work and generate a 500 Server Error.

This is my urls.py file at the root of my app :

from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
    url(r'^home/', include('appname.home.urls')),
)

And this is my urls.py in a subpackage home of appname:

from django.conf.urls import patterns, include, url
urlpatterns = patterns(r'appname.home.views',
    url(r'^0/', 'home'),
)

It works great in development server but it does not work on Google App Engine.

I already read a related question and its answer but it did not solve my problem.

Community
  • 1
  • 1
Hicham
  • 17
  • 3

1 Answers1

0

What does the error message say in the logs? You urlpatterns is malformed. The first r'' is incorrect. That should be a string. And, is the 0 in your url intentional? Change to:

urlpatterns = patterns('appname.home.views',
    url(r'^$', 'home'), # matches mysite.com
    url(r'^0/$', 'home'), # matches mysite.com/0/
)
GAEfan
  • 11,244
  • 2
  • 17
  • 33
  • Thanks for your answer. I have fixed this but that was not the problem apparently. I have checked the logs as you suggested and it tells me that I have forgotten to configure ALLOWED_HOSTS. Now it works. – Hicham Jul 05 '14 at 16:35