1. 程式人生 > >Part 2 - Fundamentals(4-10)

Part 2 - Fundamentals(4-10)

rip tree mod () pre code python shell url

https://simpleisbetterthancomplex.com/series/2017/09/11/a-complete-beginners-guide-to-django-part-2.html
https://github.com/sibtc/django-beginners-guide/tree/v0.2-lw
python manage.py makemigrations
python manage.py sqlmigrate boards 0001
python manage.py migrate

python manage.py shell

from boards.models import Board
board 
= Board(name=Django, description=This is a board about Django.) board.save() board = Board.objects.create(name=Python, description=General discussion about Python.) boards_list = Board.objects.all() for board in boards_list: print(board.description)
from django.conf.urls import url
from
django.contrib import admin from boards import views urlpatterns = [ url(r^$, views.home, name=home), url(r^admin/, admin.site.urls), ]
from django.contrib import admin
from .models import Board

admin.site.register(Board)

Part 2 - Fundamentals(4-10)