A Flatiron Student’s Guide

python3 -m venv blog_postsource blog_post/bin/activate
cd blog_post
pip install --upgrade pip
pip install django
pip install django-mssql-backend
mkdir srccd srcdjango-admin startproject blog_post
cd blog_postpython manage.py startapp postscode .
/BLOG_POST/src/posts/models.py
from django.db import models
from django.conf import settings
class Post(models.Model):
title = models.TextField()
content = models.TextField()
from django.contrib import admin

from .models import Post
admin.site.register(Post)
python manage.py makemigrationspython manage.py migrate
python manage.py makemigrationspython manage.py migrate
python manage.py createsuperuser
python manage.py runserver
mkdir templates
cd templates
touch index.html
code .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<body>

<h1>Hello World</h1>

</body>
</html>
from django.shortcuts import render
from django.http import HttpResponse


def index(request, *args, **kwargs):
return render(request, "index.html", {})
'DIRS': [os.path.join(BASE_DIR, "templates")],
from posts.views import index
path('', index, name="index"),
cd ..python manage.py runserver