mirror of
https://github.com/skoobasteeve/django-movies.git
synced 2026-03-20 03:28:59 +00:00
Compare commits
1 Commits
main
...
384b2e7303
| Author | SHA1 | Date | |
|---|---|---|---|
|
384b2e7303
|
@@ -14,9 +14,11 @@ Including another URLconf
|
|||||||
1. Import the include() function: from django.urls import include, path
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import include, path
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
|
path("polls/", include("polls.urls")),
|
||||||
]
|
]
|
||||||
|
|||||||
0
polls/__init__.py
Normal file
0
polls/__init__.py
Normal file
3
polls/admin.py
Normal file
3
polls/admin.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
5
polls/apps.py
Normal file
5
polls/apps.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class PollsConfig(AppConfig):
|
||||||
|
name = 'polls'
|
||||||
0
polls/migrations/__init__.py
Normal file
0
polls/migrations/__init__.py
Normal file
3
polls/models.py
Normal file
3
polls/models.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
||||||
3
polls/tests.py
Normal file
3
polls/tests.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
7
polls/urls.py
Normal file
7
polls/urls.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("", views.index, name="index"),
|
||||||
|
]
|
||||||
9
polls/views.py
Normal file
9
polls/views.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from django.http import HttpResponse
|
||||||
|
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
return HttpResponse("Hello, world. You're at the polls index.")
|
||||||
|
|
||||||
|
|
||||||
|
def index2(request):
|
||||||
|
return HttpResponse("Hello, world. You're at the polls index #2.")
|
||||||
Reference in New Issue
Block a user