Django Bootstrap Base Template
Simple django bootstrap base template. Official reference for django template and bootstrap.
Step 1: Preparation, Create Django Project, Initial Migration
install virtualenv: pip install virtualenv
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django in virtualenv: pip install django==3.0
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Migrate: python manage.py migrate
Step 2. Create Django Apps
Create apps: python manage.py startapp myapp
Add myapp to INSTALLED_APPS in myproject/settings.py
Step 3. Preparing Templates Folder
Add folder templates in myapp
Register myapp/templates in myproject/settings.py
os.path.join(BASE_DIR, 'myapp', 'template')
Step 4. Add html file in myapp/templates folder
Add bootstrap base, create base.html CDN Bootstrap.
Create home.html in myapp/templates which implement base.html. Following codes is jumbotron example from official Bootstrap doc.
Step 5. Set up views and urls
Add render method in myapp/views.py
Create urls.py file in myapp folder
Add myapp/urls.py to myproject/urls.py using include
Step 6. Run and Try it in browser
python manage.py runserver