I have had successfully deployed some pages which are in urls.py and could be reached with no problems.
There is also default page should have links to 127.0.0.1/page1 and 127.0.0.1/page2.
How could that be achieved? sitename is in settings.py
I have tried the following in index.html:
<h3>This is the URL for "page1": <a href="{% url 'sitename:page1.html' %}"> Click here</a></h3>
> django.urls.exceptions.NoReverseMatch: 'sitename' is not a registered namespace
<h3>This is the URL for "page1": <a href="{% url 'page1.html' %}"> Click here</a></h3>
> Reverse for 'exp.html' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
I advice you first read this link for understanding django url structure
https://docs.djangoproject.com/en/1.10/topics/http/urls/#url-namespaces
The Solution will be like that:
<h3>This is the URL for "page1": <a href="/page1"> Click here</a></h3>
<h3>This is the URL for "page2": <a href="/page2"> Click here</a></h3>
and you must define this urls in urls.py
It looks like you're trying to pass template name to url template tag. What you should actually do is to define url name in your urls.py, so it would look similiar to this:
url(r'^page1/$', YourView.as_view(), name="page1")
and then in template:
<a href="{% url "page1" %}">Page 1</a>
You should rather avoid hardcoding urls doing something like this:
<a href="/page1">Page 1</a>
because when in future you'd like to change the url you'll have to do it in two places: in urls.py and in template(s), while when using {% url %} template urls.py will be the only place to do it.