Django
Django is a python framework to create and deploy websites.
$ django-admin startproject <project_name>
$ python3 manage.py migrate # apply configuration
$ python3 manage.py runserver
$ python3 manage.py runserver 0.0.0.0:8080
$ python3 manage.py startapp <app_name>
The default admin page is at URI: /admin
.
You will usually edit urls.py
to add a route which is a path
, a function
, and optionally a name. For instance:
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, World!")
from django.shortcuts import render
def index(request):
return render(request, 'index.html')
If you're using HTML, then you can use template injection: {% ... %}
. Refer to the documentation, there are multiple instructions possible.