windows10 Pycharm Community 2019.3 Python3.7 Django3.03
It is assumed that you are creating a Django project and application. See below Until Django application is created in the terminal
After creating the application, register below ![Application Registration] (https://qiita.com/oporimaster/items/4a8941760dca8765cda3)
Use Bootstrap's free template with Django
https://startbootstrap.com/
Select a template from Thema and download it.
Create a static directory directly under your Django project
Copy only "css", "image" and "vendor" there
Directory structure after copying
As it is, Django can't figure out the location of the files under it, so Add the location to setting.py as follows.
STATICFILES_DIRS = (
os.path.join(BASE_DIR,'static'),
)
BASE_DIR is defined in Setting.py with an absolute path as shown below.
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
that's all
Recommended Posts