Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django register models

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

admin.site.register(<modelname>)
Comment

Register Model In Admin Django

#admin.py

from django.contrib import admin


from .models import Question

admin.site.register(Question)
 
Comment

register admin django

from django.contrib import admin
from myproject.myapp.models import * # * means importing every class name of models

admin.site.register(Author)
Comment

register models in admin

admin.site.register(Book)
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 :: printing float number python 
Python :: python [remote rejected] master - master (pre-receive hook declined) 
Python :: pyautogui color 
Python :: how to add delay in python 
Python :: what is pypy 
Python :: Insert missing data in pandas 
Python :: pandas filter every column not null 
Python :: python - remove duplicate items from the list 
Python :: changing axis labels matplotlib 
Python :: python open excel application 
Python :: erase % sign in row pandas 
Python :: virtual enviroment 
Python :: how to take input in 2d list in python 
Python :: python - iterate with the data frame 
Python :: random id python 
Python :: pass variable in subprocess run python 
Python :: networkx path between two nodes 
Python :: python space separated input 
Python :: password generator in python 
Python :: python fibonacci 
Python :: python correlation between features and target 
Python :: python number and name of weekday 
Python :: or condition in pandas 
Python :: python download youtube video 
Python :: int object is not subscriptable in python 
Python :: power level in google colab 
Python :: how to make a pause in python 
Python :: how to use inverse trigonometric functions in python 
Python :: discord.py embeds 
Python :: pandas profile 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =