[PYTHON] Hello World on Django

Procedure memo to start django continued

Make apps

$cd project name
$ python manage.py startapp app name

At this stage

A folder that is

Write code

In the app

views.py


from django.shortcuts import render
from django.http import HttpResponse


def home(request):
    return HttpResponse("Hello, World")

In the project

settings.py


INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'app name'← Add
]

urls.py


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'', 'app name.views.home')
]

Start up the server and complete

Recommended Posts

Hello World on Django
Hello World (beginners) on Django
Hello world
cython hello world
How to build Hello, World on #Nix
Hello world instead of localhost in Django
(For myself) Django_1 (Basic / Hello World / Template)
Hello X3DOM on Jupyter
web2py memo: Hello World
hello world with ctypes
RabbitMQ Tutorial 1 ("Hello World!")
Hello World with nginx + uwsgi + python on EC2
Flask Hello World cannot be displayed on VPS
Hello, World with Docker
Create a one-file hello world application with django
Django's first Hello World
Hello world with flask
To myself as a Django beginner (3)-Hello world! ---
Draw hello world with mod_wsgi
Until hello world with zappa
[Django] Notes on using django-debug-toolbar
Programming language in "Hello World"
Django environment development on Windows 10
Hello World in GO language
Install Django on your Mac
Python starting with Hello world!
Let's do "Hello World" in 40 languages! !!
Hello, world! With virtual CAN communication
Introduction to TensorFlow --Hello World Edition
Hello world! (Minimum Viable Block Chain)
Deploy your Django application on Heroku
Django
python + django + scikit-learn + mecab (1) on heroku
Implement a Django app on Hy
Use python on Raspberry Pi 3 to illuminate the LED (Hello World)
python + django + scikit-learn + mecab (2) on heroku
[Note] Hello world output with python
Publish DJango page on heroku: Practice
cout << "Hello, World! \ N" in python
Hello World in Flask [Appropriate memo]
Code: 2 "Hello World" in "Choregraphe-Python script"
Hello World! By QPython with Braincrash
Update applications running on Django 1.7 to Django 1.8
[Note] Run Django on Amazon Linux 2
Django blog on heroku: login implementation
Python #Hello World for super beginners
Introduction to Ansible Part 1'Hello World !!'
Django Crispy Tutorial (Environment Building on Mac)
[Python] Web application from 0! Hands-on (2) -Hello World-
Hello World and face detection with opencv-python 4.2
Migrate Django applications running on Python 2.7 to Python 3.5
Hello World with Raspberry Pi + Minecraft Pi Edition
Notes on creating static files in Django
Django + Apache with mod_wsgi on Windows Server 2016
Deploy the Django app on Heroku [Part 2]
React → Ajax → Django on Linux implementation memo
Deploy the Django app on Heroku [Part 1]
Django: Test Middleware that depends on another Middleware
A note on enabling PostgreSQL with Django
Flask tutorial (from installation to hello world)
How to display Hello world in python