Tuesday, 21 January 2020

URL Mapping

from django.contrib import admin
from django.urls import path
from django.conf.urls import include

urlpatterns= [
   path('admin/', admin.site.urls),
   path('', include('DJP.urls')),

from django.urls import path
from . import views
from django.conf.urls import url

from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin

urlpatterns = [
    path('', views.home, name'home'),
   # url(r'^home/(?P<id>\d+)/$', views.data, name= 'data'),

from django.shortcuts import render

# Create your views here.

from .models import *

# Create your views here.

def home(request):
    return render(request, 'DJP/home.html')

No comments:

Post a comment

Note: only a member of this blog may post a comment.

TypeError: argument of type 'WindowsPath' is not iterable

 Please make to modify settings.py file: DATABASES = { 'default' : { 'ENGINE' : 'django.db.backends.sqlite3&...