Steps To Build A Website On Django
Steps To Build A Website On Django
after creating project, Django will defaultly create some project files
Close the vs code and open the Project file(Hello in this case).
Run the command – python manage.py runserver to check if Django has been successfully
downloaded.
A Django project can contain more than one apps but it should at least contain one app.
Copy the content of urls.py from the main project-app to your urls.py of recently created app(home
app).
After creating the path, define a view(function) that returns a template or a string.
In this way, a simple string/webpage will be displayed on screen
How it works -
In this way the views function returns a string or it can also return a template.
Static files- it is that file which is publicly available so it doesn’t contain any sensitive data.
--------------------------------------------------------------------------------------------------------------------------------------
Templates-