1.GO to views.py and the index function
2.def index(request):
return render(request, 'index.html')
3.goto ur urls.py and write following
path(' ', name of your view.index, name = 'home' )
THis how u can render any page to browser as ur home page .
you need to import render in ur views file
Basically bro,when you you serve project it takes the index file,You can
change route from / to /app then you will be directed there.
On Sun, Sep 29, 2019 at 3:56 AM Tato Müller wrote:
> Hi everyone.
>
> How can i call an html page when i request the root of my app, like
> http://127.0.0.1:8000/
You can use generic.TemplateView to load an HTML template.
See for example:
https://github.com/speedy-net/speedy-net/blob/master/speedy/core/base/views.py#L28
https://github.com/speedy-net/speedy-net/blob/master/speedy/core/about/views.py#L4
Although, there are many options to use in your templa
Note: Nonetheless, you should read more about the documentation or the
tutorials available since everything you need to start you first Django
project is already there.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this gro
Greetings Müller,
In order for your template to load for that specific page, you have to
state it under that page’s view in views.py
Eg:
class IndexView():
template_name = “index.html”
// Or if it’s a function view
def index(request):
return render(request, 'app/index.html', context
Hi everyone.
How can i call an html page when i request the root of my app, like
http://127.0.0.1:8000/app.
I want index.html loads when i call this url.
Could you help me?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from t
6 matches
Mail list logo