I am trying to write a program by running Django using manage.py runserver ip:port in my Linux box as a non-root user. My first objective is that if a user enters a URL in the browser http://ip:port it should display something or a welcome content.
So I modified my mysite/url.py something like this:
urlpatterns = patterns('',
('', ''),
(r'^admin/', include(admin.site.urls)),
)
python manage.py runserver : runs and start fine but in browser I get below exception:
Exception Type: ImproperlyConfigured
Exception Value: Empty URL pattern view name not permitted (for pattern ”)
So how can construct the URL just like:
www.google.com
www.mail.yahoo.com
www.mysite.com
Thanks in advance
The empty pattern will match anything, so you should be anchoring it to full empty string. The second tuple parameter must also be a view name.
In your URLconf:
In a
views.pyin the same directory: