I have to display a HTML page with its supporting css, js and images. So i create a template folder to put HTML in it then i create a static folder in which i create css, js and img folder and put related files into these folders.
then I configure the
Settings.py
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_URL = '/static/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
.html file
{% load staticfiles %}
<link href="{% static 'css/style.css' %}" rel="stylesheet">
views.py
def Index(request):
return render(request,'Teenager Startup.html')
please help me where i'm not getting the point.