Reputation: 1
I am having trouble accessing the base url for my django app once it is deployed.
Can't reach base url:
This just runs until it times out.
Can reach:
www.example.com/home/
Here are my allowed hosts in settings.py:
ALLOWED_HOSTS = ['example.com', 'example' 'https://example.com/', '127.0.0.1']
Here are my url patterns in myapp/urls.py:
from .views import index
urlpatterns = [ path('', index, name='index'), path('home/', index, name="index"), ]
I have tried adjusting the url patterns but have had no success. Thanks for your help.
EDIT:
root urls.py:
urlpatterns = [ path('', include('myapp.urls')), path('admin/', admin.site.urls), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Upvotes: 0
Views: 315
Reputation: 1684
Change your allowed hosts to
ALLOWED_HOSTS = ['example.com', 'www.example.com', '127.0.0.1']
Upvotes: 0