sqwale
sqwale

Reputation: 575

django wagtail page not found when i don't use "127.0.0.1:8000"

I have added the following to my settings.py

ALLOWED_HOSTS = ['0.0.0.0','127.0.0.1','192.168.0.05']

My url.py

urlpatterns = [
url(r'^django-admin/', include(admin.site.urls)),

url(r'^admin/', include(wagtailadmin_urls)),
url(r'^documents/', include(wagtaildocs_urls)),

#url(r'^search/$', search_views.search, name='search'),

# For anything not caught by a more specific rule above, hand over to
# Wagtail's page serving mechanism. This should be the last pattern in
# the list:
#url(r'', include(wagtail_urls)),

# Alternatively, if you want Wagtail pages to be served from a subpath
# of your site, rather than the site root:
#    url(r'^pages/', renders(wagtail_urls)),
url(r'^i18n/', include('django.conf.urls.i18n')),

]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += i18n_patterns(
# These URLs will have /<language_code>/ appended to the beginning
url(r'^search/$', search_views.search, name='search'),
url(r'', include(wagtail_urls)),
#url(r'^$', include(wagtail_urls)),
 )

The dilema is when I do "http://127.0.0.1:8000/en" it works just fine however when I do "http://192.168.0.5:8000/en/" from my mobile phone on the same lan or even from the laptop its hosted on I keep getting "Page not found (404)".

What would cause such behavior did I overlook something in my url.py.

I have tried running it as follows :

python manage.py runserver 192.168.0.13:8000
python manage.py runserver 0.0.0.0:8000

Non of which helps.

I know its not a firewall issue as the page not found is as a result of the django service responding.

Upvotes: 2

Views: 1476

Answers (1)

gasman
gasman

Reputation: 25227

Check the site records under Settings -> Sites in the Wagtail admin. When a request comes in, Wagtail will only serve a page if the hostname matches one named in a site record, or the 'is default site' box is checked.

Upvotes: 4

Related Questions