Created
April 9, 2019 01:41
-
-
Save Xifeng2009/e5c62317cfb4f35df12daba4ebd41924 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In project/urls.py | |
from django.conf.urls import url, include | |
urlpatterns = [ | |
url(r'', include('main.urls', namespace='main')), | |
] | |
# In app/urls.py | |
from django.conf.urls import url | |
from . import views | |
urlpatterns = [ | |
url(r'^$', views.index, name='index'), | |
url(r'^base/$', views.base, name='base'), | |
] | |
# In app/views.py | |
from django.shortcuts import render | |
def index(request): | |
return render(request, 'index.html') | |
def base(request): | |
return render(request, 'examples/base1.html') | |
In templates/ | |
# Write your codes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment