From a7676aca7ad6401e012bed9504a69b204500da8d Mon Sep 17 00:00:00 2001 From: sohanmer Date: Sat, 1 May 2021 22:44:12 +0530 Subject: [PATCH 1/5] readme added --- Python/Django/BOOTSTRAP-INTEGRATION.md | 46 ++++++++++++++++++++++++++ Python/Django/README.md | 25 ++++++++++++++ Python/Django/index.md | 12 +++++++ 3 files changed, 83 insertions(+) create mode 100644 Python/Django/BOOTSTRAP-INTEGRATION.md create mode 100644 Python/Django/README.md create mode 100644 Python/Django/index.md diff --git a/Python/Django/BOOTSTRAP-INTEGRATION.md b/Python/Django/BOOTSTRAP-INTEGRATION.md new file mode 100644 index 0000000..2c68609 --- /dev/null +++ b/Python/Django/BOOTSTRAP-INTEGRATION.md @@ -0,0 +1,46 @@ +# Django-Bootstrap Integration + +This document covers steps to integrate bootstrap in django. +This is to help new comers to easily integrate bootstrap in Django module including Django Admin. + +### Integration Steps + +- [Download Bootstrap](https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta3/bootstrap-5.0.0-beta3-dist.zip) +Extract the downloaded folder and you will get two folder named css and js. + +Now create a folder name staic in your created app and paste the above extracted folder in it. + +Again create a folder named template inside the app and make file index.html can copy the file content to it [index.html]() + +Now copy the below code in your setting.py +``` +STATIC_URL = '/static/' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'app_name/static') +] +STATIC_ROOT = os.path.join(BASE_DIR, 'assets') +``` +Note: app_name will contain your application name. + +After that run command python manage.py collectstatic to collect all your static file under assests directory. + +Congratulation! you have integrated bootstrap in your django project. Now you only have to extends index.html in your templates to use bootstrap. + +### Additional Step for Django Admin + +Integration with admin is almost same but in place of creating index.html follow the below instructions. + +Create a folder named admin inside your template folder. +Create a file name base_site.html and paste the below code +``` +{% extends 'admin/base_site.html' %} + +{% load static %} + +{% block extrastyle %} + + +{% endblock %} +``` + +Now extend base_site.html in order to use bootstrap in your templates. \ No newline at end of file diff --git a/Python/Django/README.md b/Python/Django/README.md new file mode 100644 index 0000000..4ac9d48 --- /dev/null +++ b/Python/Django/README.md @@ -0,0 +1,25 @@ +# Django + +This document covers the resources needed to learn Django. +They are designed in a way that a newcomer can easily know where to look for resources and links. + +### Prerequisites + +- Basic knowledge of Web technologies: HTML, CSS, and JavaScript. +- [Python](https://docs.python.org/3.9/tutorial/index.html). + +### Getting Started + +[What is Django?](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Introduction). +[What is MVT?](https://medium.com/@jaychaturvedi18/a-brief-introduction-to-django-mvt-framework-8ef46cc321ab). + +### Where Should I Start? + +You can start from the official website [tutorial](https://docs.djangoproject.com/en/3.2/). It's a great learning curve which covers all the basics of Django. + +### Projects Done + + +### Video Tutorials + +- You can also watch [youtube](https://www.youtube.com/watch?v=OTmQOjsl0eg). \ No newline at end of file diff --git a/Python/Django/index.md b/Python/Django/index.md new file mode 100644 index 0000000..123f285 --- /dev/null +++ b/Python/Django/index.md @@ -0,0 +1,12 @@ + + + + + Title + {% load staticfiles %} + + + + + + \ No newline at end of file From f1db9cce527fa82108c89f26e7bd12ba560ce9fa Mon Sep 17 00:00:00 2001 From: sohanmer Date: Sun, 2 May 2021 16:56:54 +0530 Subject: [PATCH 2/5] cleaning up --- Python/Django/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Python/Django/README.md b/Python/Django/README.md index 4ac9d48..4a35694 100644 --- a/Python/Django/README.md +++ b/Python/Django/README.md @@ -6,12 +6,15 @@ They are designed in a way that a newcomer can easily know where to look for res ### Prerequisites - Basic knowledge of Web technologies: HTML, CSS, and JavaScript. -- [Python](https://docs.python.org/3.9/tutorial/index.html). +- [Python](https://docs.python.org/3.9/tutorial/index.html) ### Getting Started -[What is Django?](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Introduction). -[What is MVT?](https://medium.com/@jaychaturvedi18/a-brief-introduction-to-django-mvt-framework-8ef46cc321ab). +Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Checkout this [What is Django?](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Introduction) to know more about this amazing technology. + + +Also have a look at:- +[What is MVT?](https://medium.com/@jaychaturvedi18/a-brief-introduction-to-django-mvt-framework-8ef46cc321ab) ### Where Should I Start? @@ -22,4 +25,4 @@ You can start from the official website [tutorial](https://docs.djangoproject.co ### Video Tutorials -- You can also watch [youtube](https://www.youtube.com/watch?v=OTmQOjsl0eg). \ No newline at end of file +- You can also checkout [this](https://www.youtube.com/watch?v=OTmQOjsl0eg). \ No newline at end of file From 9a394096640022dbeec2e559a1ac114b4a7e22ca Mon Sep 17 00:00:00 2001 From: sohanmer Date: Sun, 2 May 2021 17:01:55 +0530 Subject: [PATCH 3/5] clean up --- Python/Django/BOOTSTRAP-INTEGRATION.md | 32 ++++++++++++++++++-------- Python/Django/index.md | 12 ---------- 2 files changed, 23 insertions(+), 21 deletions(-) delete mode 100644 Python/Django/index.md diff --git a/Python/Django/BOOTSTRAP-INTEGRATION.md b/Python/Django/BOOTSTRAP-INTEGRATION.md index 2c68609..10f6acb 100644 --- a/Python/Django/BOOTSTRAP-INTEGRATION.md +++ b/Python/Django/BOOTSTRAP-INTEGRATION.md @@ -8,11 +8,25 @@ This is to help new comers to easily integrate bootstrap in Django module includ - [Download Bootstrap](https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta3/bootstrap-5.0.0-beta3-dist.zip) Extract the downloaded folder and you will get two folder named css and js. -Now create a folder name staic in your created app and paste the above extracted folder in it. +- Now create a folder name static in your created app and paste the above extracted folder in it. -Again create a folder named template inside the app and make file index.html can copy the file content to it [index.html]() +- Again create a folder named template inside the app and make file index.html can copy the given code to it +``` + + + + + Title + {% load staticfiles %} + + + + + + +``` -Now copy the below code in your setting.py +- Now copy the below code in your setting.py ``` STATIC_URL = '/static/' STATICFILES_DIRS = [ @@ -22,16 +36,16 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'assets') ``` Note: app_name will contain your application name. -After that run command python manage.py collectstatic to collect all your static file under assests directory. +- After that run command python manage.py collectstatic to collect all your static file under assests directory. -Congratulation! you have integrated bootstrap in your django project. Now you only have to extends index.html in your templates to use bootstrap. +- Congratulation! you have integrated bootstrap in your django project. Now you only have to extends index.html in your templates to use bootstrap. ### Additional Step for Django Admin -Integration with admin is almost same but in place of creating index.html follow the below instructions. +- Integration with admin is almost same but in place of creating index.html follow the below instructions. -Create a folder named admin inside your template folder. -Create a file name base_site.html and paste the below code +- Create a folder named admin inside your template folder. +- Create a file name base_site.html and paste the below code ``` {% extends 'admin/base_site.html' %} @@ -43,4 +57,4 @@ Create a file name base_site.html and paste the below code {% endblock %} ``` -Now extend base_site.html in order to use bootstrap in your templates. \ No newline at end of file +- Now extend base_site.html in order to use bootstrap in your templates. \ No newline at end of file diff --git a/Python/Django/index.md b/Python/Django/index.md deleted file mode 100644 index 123f285..0000000 --- a/Python/Django/index.md +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Title - {% load staticfiles %} - - - - - - \ No newline at end of file From e0f9985c2ae9c26b72078a9cf1a7ea910bad5688 Mon Sep 17 00:00:00 2001 From: sohanmer Date: Sun, 2 May 2021 17:07:06 +0530 Subject: [PATCH 4/5] minor changes --- Python/Django/BOOTSTRAP-INTEGRATION.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Python/Django/BOOTSTRAP-INTEGRATION.md b/Python/Django/BOOTSTRAP-INTEGRATION.md index 10f6acb..167def2 100644 --- a/Python/Django/BOOTSTRAP-INTEGRATION.md +++ b/Python/Django/BOOTSTRAP-INTEGRATION.md @@ -5,12 +5,11 @@ This is to help new comers to easily integrate bootstrap in Django module includ ### Integration Steps -- [Download Bootstrap](https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta3/bootstrap-5.0.0-beta3-dist.zip) -Extract the downloaded folder and you will get two folder named css and js. +- [Download Bootstrap](https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta3/bootstrap-5.0.0-beta3-dist.zip) from here and extract the downloaded folder and you will get two folder named css and js. - Now create a folder name static in your created app and paste the above extracted folder in it. -- Again create a folder named template inside the app and make file index.html can copy the given code to it +- Again create a folder named template inside the app and make file index.html and copy the given code to it ``` @@ -36,7 +35,7 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'assets') ``` Note: app_name will contain your application name. -- After that run command python manage.py collectstatic to collect all your static file under assests directory. +- After that run command ```python manage.py collectstatic``` to collect all your static file under assests directory. - Congratulation! you have integrated bootstrap in your django project. Now you only have to extends index.html in your templates to use bootstrap. From 280df90a773240e8d2f247a96d448db8341c5e31 Mon Sep 17 00:00:00 2001 From: Satendra Rawat Date: Tue, 31 Aug 2021 13:13:37 +0530 Subject: [PATCH 5/5] Updates on readme, removed project listing heading --- Python/Django/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Python/Django/README.md b/Python/Django/README.md index 4a35694..ddfe1b1 100644 --- a/Python/Django/README.md +++ b/Python/Django/README.md @@ -20,9 +20,7 @@ Also have a look at:- You can start from the official website [tutorial](https://docs.djangoproject.com/en/3.2/). It's a great learning curve which covers all the basics of Django. -### Projects Done - ### Video Tutorials -- You can also checkout [this](https://www.youtube.com/watch?v=OTmQOjsl0eg). \ No newline at end of file +- You can also checkout [this](https://www.youtube.com/watch?v=OTmQOjsl0eg).