/django-apache2-wsgi-2/idreammicro/helloworld/views.py |
---|
1,4 → 1,4 |
from django.http import HttpResponse |
from django.shortcuts import render |
def index(request): |
return HttpResponse("Hello world!") |
return render(request, 'helloworld/index.html') |
/django-apache2-wsgi-2/idreammicro/helloworld/static/helloworld/screen.css |
---|
0,0 → 1,4 |
p |
{ |
color: red; |
} |
/django-apache2-wsgi-2/idreammicro/helloworld/templates/helloworld/index.html |
---|
0,0 → 1,9 |
{% extends "helloworld/base.html" %} |
{% block title %}Hello world!{% endblock %} |
{% block content %} |
<p> |
Hello world! |
</p> |
{% endblock %} |
/django-apache2-wsgi-2/idreammicro/helloworld/templates/helloworld/base.html |
---|
0,0 → 1,14 |
<!DOCTYPE html> |
<html lang="fr"> |
<head> |
{% load staticfiles %} |
<link rel="stylesheet" type="text/css" media="screen" href="{% static 'helloworld/screen.css' %}" /> |
<title>{% block title %}Hello world!{% endblock %}</title> |
</head> |
<body> |
<div id="content"> |
{% block content %}{% endblock %} |
</div> |
</body> |
</html> |