Django  Level 1
Sunday, July 22, 2018
7:48 AM
django-admin startproject first_project
cd first_project
python [file] startapp first_app
[file]
def index(request)
my_dict = {'insert_content':"Hello I'm from FIRSTAPP!"}
return render(request, 'first_app/index.html',context=my_dict)
[file]
from django.conf.urls import url, include
from django.contrib import admin
from first_app import views
urlpatterns = [
url=('',admin.site.urls),
url=('first_app/',include('first_app.urls')),
]
BASE_DIR
[TEMPLATE_DIR,],
python [file] runserver
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'first_app'
]
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [TEMPLATE_DIR,],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]
STATIC_URL = '/static/'
STATICFILES_DIRS = [
    STATIC_DIR,
]