Watching for file changes with StatReloader
Performing system checks...
...[snip]...
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Django</title>
...[snip]
create a views.py file with a single view called 'home', have it return a simple http response with with text 'Hello there!'
cat views.py
from django.http import HttpResponse
def home(request):
return HttpResponse("Hello there!")
add the 'home' view from views.py to the url definitions in urls.py for the path '/'
from django.contrib import admin
from django.urls import path
from .views import home
urlpatterns = [
path('admin/', admin.site.urls),
path('/', home),
]
echo 'My test page' > index.html
python3 -m http.server
curl http://0.0.0.0:8000/index.html --You can even "install" and RUN Django
python -m pip install Django
django-admin startproject mysitecd ./mysite
python manage.py runserver
curl http://127.0.0.1:8000/ create a views.py file with a single view called 'home', have it return a simple http response with with text 'Hello there!'cat views.py
add the 'home' view from views.py to the url definitions in urls.py for the path '/' curl http://127.0.0.1:8000/ --This is mad!