mindcurrent / djanky-django

Daniel's Janky Attempt at a Django RESTful API Server
0 stars 1 forks source link

Initialize the django admin interface (& hook up new Polls app) #12

Open dpcunningham opened 5 years ago

dpcunningham commented 5 years ago

Per Introducing the Django Admin:

dpcunningham commented 5 years ago
$ python3 manage.py createsuperuser
Username (leave blank to use 'dpc'): djadmin
Email address: daniel.cunningham@mindcurrent.io
Password: aint-dat-stoopid-yalls
Password (again): or-is-eye

Yay!

Screenshot from 2019-10-04 15-29-33

dpcunningham commented 5 years ago

Let's hook up the Polls app to the Admin Panel...

$ vi  ./polls/admin.py 
$ cat ./polls/admin.py

# Register your models here.

from django.contrib import admin

from .models import Question
admin.site.register(Question)

from .models import Choice
admin.site.register(Choice)
dpcunningham commented 5 years ago

NB: If the value of “Date published” doesn’t match the time when you created the question in Tutorial 1, it probably means you forgot to set the correct value for the TIME_ZONE setting. Change it, reload the page and check that the correct value appears.