Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django register models

from django.contrib import admin
from .models import <modelname>

admin.site.register(<modelname>)
Comment

How to register a model in Django

# in admin.py
from django.contrib import admin
#if you have a model called Post
from .models import Post

admin.site.register(Post)
Comment

PREVIOUS NEXT
Code Example
Python :: seaborn orient 
Python :: add title to tkinter window python 
Python :: django form custom validation 
Python :: dictionary from two list 
Python :: channels_redis 
Python :: astype float across columns pandas 
Python :: looping over lists in python 
Python :: how to chose right epoch 
Python :: python request body json 
Python :: name is not defined python 
Python :: convert 2 lists into dictionary 
Python :: nrf24l01 arduino to raspberry pi struct 
Python :: python loop to a tuple 
Python :: python tkinter programming project ideas 
Python :: python all but the last element 
Python :: python re.sub() 
Python :: handling timezone in python 
Python :: python reverse dictionary 
Python :: python file exists 
Python :: run python module from command line 
Python :: python count appearances in list 
Python :: How to use Counter() Function 
Python :: how to make loops in python 
Python :: what does the .item() do in python 
Python :: Example of break, continue and pass statements in python 
Python :: flask form options 
Python :: extend python 
Python :: swarm plot 
Python :: Use operator in python list 
Python :: python ravel function 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =