summaryrefslogtreecommitdiff
path: root/tutorial_2_django_proj
diff options
context:
space:
mode:
authorankitjavalkar2017-05-18 17:06:26 +0530
committerGitHub2017-05-18 17:06:26 +0530
commit7a5d6d3a65ec695ab2d19934bea6a3bf14c778c6 (patch)
tree924f533dd92dbf532252571c6c1f64445185ab4b /tutorial_2_django_proj
parent282fd03e10acf60b6d749c24d3a53ea27f245118 (diff)
downloadlearn_django-7a5d6d3a65ec695ab2d19934bea6a3bf14c778c6.tar.gz
learn_django-7a5d6d3a65ec695ab2d19934bea6a3bf14c778c6.tar.bz2
learn_django-7a5d6d3a65ec695ab2d19934bea6a3bf14c778c6.zip
Create slides for Django project and app initializing
Diffstat (limited to 'tutorial_2_django_proj')
-rw-r--r--tutorial_2_django_proj/slides.md82
1 files changed, 82 insertions, 0 deletions
diff --git a/tutorial_2_django_proj/slides.md b/tutorial_2_django_proj/slides.md
new file mode 100644
index 0000000..cc28f8f
--- /dev/null
+++ b/tutorial_2_django_proj/slides.md
@@ -0,0 +1,82 @@
+Tutorial: Creating Your First Django Project & App
+=====================================
+
+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 2:
+------------
+ - Activate the virtual environment
+ - Create a new directory in your 'home' directory
+ - mkdir ~/myproject
+
+Slide 3:
+------------
+ **Initializing Django Project**
+ - Go to the directory
+ - cd ~/myproject
+ - Run the command
+ - *django-admin startproject mysite*
+
+Slide 4:
+-------------
+ - You will see such a File structure
+
+ myproject/
+ |-> manage.py
+ `-> mysite/
+ |-> __init__.py
+ |-> settings.py
+ |-> urls.py
+ `-> wsgi.py
+
+Slide 5:
+---------------
+ - Check if you have setup Django project correctly;
+ - *python manage.py runserver*
+ - Show output screen
+
+Slide 6
+------------
+**Initializing a Django App**
+ - Create a blogging app called blog
+ - Run the command;
+ - *python manage.py startapp blog*
+
+Slide 7
+------------
+ - A new directory 'blog' is created.
+ - Execute *cd blog/*
+ - You will see the file structure
+ blog/
+ |-> __init__.py
+ |-> admin.py
+ |-> apps.py
+ |-> migrations/
+ `-> __init__.py
+ |-> models.py
+ |-> tests.py
+ `-> views.py
+ - Return to the parent directory
+ - *cd ..*
+
+Slide 8
+------------
+ - Open the *settings.py* file
+ - Go to *INSTALLED_APPS* and add *'blog.apps.BlogConfig',* to the list so it should now look like this;
+
+ INSTALLED_APPS = [
+ 'blog.apps.BlogConfig',
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ ]