Created
March 4, 2021 14:43
-
-
Save salvatorecapolupo/342ad56c46b33073eda5de763dcd0a05 to your computer and use it in GitHub Desktop.
Come realizzare un semplice hello world usando Django.Per dettagli vedere la guida: https://trovalost.it/guida-django/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HelloWorld/ | |
helloworld/ | |
__init__.py | |
asgi.py | |
settings.py | |
urls.py | |
wsgi.py | |
manage.py | |
------------------------------------- | |
from django.http import HttpResponse | |
def index(request): | |
return HttpResponse("Hello world") | |
------------------------------------- | |
from django.urls import re_path | |
from . import views | |
urlpatterns = [ | |
re_path(r'^', views.index, name='index') | |
] | |
-------------------------------------- | |
from django.contrib import admin | |
from django.urls import include, re_path, path | |
urlpatterns = [ | |
path('admin/', admin.site.urls), | |
re_path(r'^', include('ciaomondo.urls')) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment