1、 download bootstrap4.3 My bag :https://getbootstrap.com/

2、 Put the downloaded file in project Next new static Under the table of contents . For example, I project yes mysite, Put it under the root of the project .

3、 Modify global setting file , Add static file path .

STATIC_URL = '/static/' # If you store static files static Directory in app Under the table of contents , Then the change will take effect , There is no need to define the following
STATICFILES_DIRS = [ # If you store static files static Directory in project Under the table of contents , Then use the definition 
os.path.join(BASE_DIR, "static"),

4、 On the whole mysite/mysite/urls.py Set forwarding rules , Forwarding application blog Of url

from django.conf.urls import include,url
from django.contrib import admin urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('blog.urls',namespace='blog')),

5、 stay blog Create concrete urls, modify mysite/blog/urls.py file

from django.conf.urls import url
from . import views
urlpatterns = [ url(r'^$', views.index,name='index'), ]

6、 modify blog Medium view.py

from django.shortcuts import render
def index(request):
return render(request,'blog/index.html')

7、 Create a template , stay blog Create under the folder templates Folder , Then create subfolders blog. In this folder mysite/blog/templates/blog Create below index.html file :

Reference documents :

1、Django Use in Bootstrap

django Introduction in bootstrap4.3 More articles about

  1. django Introduction in json

    try: from django.utils import simplejson as jsonexcept: import simplejson as json

  2. django On the introduction of static files ( This side refers to the edge, mainly jquery and bootstrap

    One .   Create folder First, create a new folder in the root of the project , The best name for this folder is static name Two .   Modify the configuration In the project settings In file , Pull down the bottom , You can see STATICFILES_DIR ...

  3. Mysql Business exploration and its application in Django Practice in ( One )

    Preface I've been thinking about blogging for a long time , On the one hand, it is a summary of my recent knowledge . precipitation , It is convenient to sort out the past knowledge in the future . trace , On the one hand, I also hope to know more friends in the same technology circle through blog . Fortunately, the blog Park recently passed the application , So today, ...

  4. Django Medium ORM

    Django in ORM Use . One . install python Connect mysql Module :MySQL-python sudo pip install MySQL-python After the installation is completed, please wait python-shell Medium test ...

  5. Django Pass through filter and simple_tag Implement custom functions for the front end

    Django The template engine of provides general functions , Most of the code logic functions can be realized through the front end , This is called generality , Because it only supports most common functions , for example if Judge ,ifequal Compare the return value and so on , But it's a little more complicated ...

  6. stay Django Use in ORM Create a library management system

    One .ORM( Object relation mapping ) In many languages web There's this concept in every framework 1. Why would there be ORM? 1. Writing programs is inseparable from data , To use data, you need to connect to a database , But different databases are sql On statement (mysql,oracle etc. ...

  7. Django Use in Celery

    start stay  < Distributed task queue Celery Instructions >  In this paper, we introduce the concept of  Python  Use in Celery To experiment with asynchronous and timed tasks . This article describes how to Django Use in Celery. install ...

  8. Django Caching basics in

    because Django It's a dynamic website , All requests will go to data for corresponding operations , When program access is large , Time consuming is bound to be more obvious , The easiest solution is to use : cache , Cache will be one of views The return value of is saved to memory or memcache in ,5 ...

  9. Django The role of each directory file in

    The general project structure is as follows ( Be the same in essentials while differing in minor points ) my_site It's a project ,blog It's one of the applications under the project , You can use the create command to create more applications . The top one django Folder : Create your own , Random names . The second floor my_site file ...

Random recommendation

  1. Git Step by Step

    Original address :http://www.cnblogs.com/wilber2013/category/643754.html 1.Git brief introduction 2.Git Local repository 3.Git The object model 4. Explore .git Catalog 5 ...

  2. Use POI export excel

    introduction : about excel Export of , The first is to write the data to WorkBook in , And then book Write in the form of flow , Look at the code : public void exportResultInfo(String fileName,S ...

  3. python Of pika Module operation rabbitmq

    Last blog post rabbitmq The structure and principle of the system , I understand rabbitmq How to use it , Next use python Of pika Module implementation uses rabbitmq. Environment building install python, No, please refer to Linux Installation configuration py ...

  4. delphi Simple paging implementation ( Experts can not look at )

    Suitable for beginners , Practice using a few controls 1. Let's put an interface control layout first : 4 individual button,2 individual label,1 individual edit,1 individual TRzsplitter( Divide the interface up and down 2 part ),1 One adoquery,1 individual adoco ...

  5. Use VBA Easy conversion between Chinese characters and Pinyin

    Function pinyin(p As String) As String i = Asc(p) Select Case i Case -20319 To -20318: pinyin = &quo ...

  6. springboot How to package a project into war package

    One . Modify the packaging form stay pom.xml Set in the  <packaging>war</packaging> Two . Remove embedded tomcat plug-in unit stay pom.xml Found in spring-boot-s ...

  7. SQL Injected Sqli-labs Level 32 of the series ( Based on wide character escape Injection )

    Start to challenge level 32 (Bypass addslashes) 0x1 View the source code (1) Code key Obviously , Using regular matching in the code will [ /,'," ] These three symbols are filtered out function che ...

  8. Android The screen is sliding onFling() Skill analysis of function

    I won't talk about how to handle gesture operation and the four basic fixed orders , Here we jump directly to the callback after we get the instant slide onFling() This abstract function , How to judge the sliding direction accurately according to the parameters . If you don't have the previous basic knowledge , You can go to ...

  9. php An application of dynamic variables in

    original text :https://www.cnblogs.com/JimmyBright/p/9869168.html In some cases , Can replace switch sentence , Greatly simplify the code , Very interesting $list = [ [ ' ...

  10. SpringMVC The framework uses annotations to perform timed tasks ( turn )

    First of all, we need to configure our SpringMVC file xmlns Add the following : xmlns:task="http://www.springframework.org/schema/task" ...