LoginSignup
0
0

More than 5 years have passed since last update.

DjangoでHello World

Posted at

DjangoでHello World | まめも
http://torokeru.tv/mameblog/?p=35

動かなかったので書き直してみる

>django-admin startproject myproject
>cd myproject
>python manage.py startapp myapp
myproject/settings.py
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'myapp',
]
myapp/views.py
from django.http import HttpResponse
def main(request):
    return HttpResponse("Hello World!!")
urls.py
from django.conf.urls import url
from django.contrib import admin
from myapp import views

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', views.main)
]

参考

"view must be a callable or a list/tuple in the case of include"
TypeError: view must be a callable or a list/tuple in the case of include() - Google グループ
https://groups.google.com/forum/#!topic/django-users/Bt8afN3Sd0E

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0