Skip to content

Instantly share code, notes, and snippets.

@salvatorecapolupo
Created March 4, 2021 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salvatorecapolupo/342ad56c46b33073eda5de763dcd0a05 to your computer and use it in GitHub Desktop.
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/
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