From 5f04ba268534e6195b9d1c0205006b4efc79ac3e Mon Sep 17 00:00:00 2001 From: King Date: Thu, 18 May 2017 17:55:22 +0530 Subject: Update slides.md --- tutorial_2_django_proj/slides.md | 91 ++++++++++++++++++++++++++++------------ 1 file changed, 65 insertions(+), 26 deletions(-) (limited to 'tutorial_2_django_proj/slides.md') diff --git a/tutorial_2_django_proj/slides.md b/tutorial_2_django_proj/slides.md index cc28f8f..21e3afc 100644 --- a/tutorial_2_django_proj/slides.md +++ b/tutorial_2_django_proj/slides.md @@ -1,29 +1,59 @@ -Tutorial: Creating Your First Django Project & App +Tutorial: Creating Your First Django Project ===================================== -Slide 1: ------------- - - What is a Django Project? - - collection of settings for an instance of Django - - Includes; - - database configuration - - Django-specific options - - Application-specific settings +Slide 1 [00:10 | 00:10] +------------- +** Creating Your First Django Project ** -Slide 2: ------------- - - Activate the virtual environment - - Create a new directory in your 'home' directory - - mkdir ~/myproject +Slide 2 [00:15 | 00:25] +-------------- + +**Learning Objectives** + +In this tutorial, we will learn to; + - create django project + - create django app + +Slide 3 [00:15 | 00:40] +--------------- + +**System Requirements** + - Ubuntu 16.10 + - Python 3.5 or higher version + - python3.4-venv + +Slide 4 [00:15 | 00:55] +--------------- + +**Pre-requisites** -Slide 3: +In order to follow this tutorial, you need to know; + - django installation and virtual environment + - If not, see the relevant django tutorial on http://spoken-tutorial.org + +Demonstration: ------------ - **Initializing Django Project** +- Revist the virtual environment created in previous tutorial. + - Activate the virtual environment + - Create a new directory + - mkdir myproject - Go to the directory - - cd ~/myproject + - cd myproject - Run the command - *django-admin startproject mysite* + This will create a django project 'mysite' +Demonstrations: +------------- + - So django project is + - collection of settings for an instance of Django + - Includes; + - database configuration + - Django-specific options + - Application-specific settings + + **(Not for narration) Note: For this demonstration we can navigate through project files ** + Slide 4: ------------- - You will see such a File structure @@ -36,24 +66,25 @@ Slide 4: |-> urls.py `-> wsgi.py -Slide 5: +Demonstration --------------- - Check if you have setup Django project correctly; - *python manage.py runserver* - - Show output screen + You will see that the server is running at the address shown. + Go to the address via web browser + We see the django's index page- "It works" -Slide 6 ------------- +Demonstration +-------------- **Initializing a Django App** - Create a blogging app called blog - Run the command; - *python manage.py startapp blog* - -Slide 7 ------------- + This creates an app 'blog' - A new directory 'blog' is created. - Execute *cd blog/* - - You will see the file structure + + - You will see the file structure(This can be in slide or terminal) blog/ |-> __init__.py |-> admin.py @@ -66,8 +97,9 @@ Slide 7 - Return to the parent directory - *cd ..* -Slide 8 +Demonstration ------------ +** Adding the app to the settings file** - Open the *settings.py* file - Go to *INSTALLED_APPS* and add *'blog.apps.BlogConfig',* to the list so it should now look like this; @@ -80,3 +112,10 @@ Slide 8 'django.contrib.messages', 'django.contrib.staticfiles', ] + +Slide 13 [00:15 | 05:55] +--------------- +** Assignment ** + - Create a new project and app + + ** Followed by standard concluding slides ** [02:15 | 08:10] -- cgit