Using Django framework only with admin backend without any apps

defoe

I want to use Django only with admin backend without any apps. So actually all I want to do is to use the admin backend to CRUD my database. Now apparently the admin backend does not have a models.py and no views.py.

Do I really need the models.py from an app, or can I easily use only the admin backend to CRUD my database. How would I do this, add a models.py to the admin backend?

wcosta

First of all, if you want to CRUD something, you will need a model so you can interact with your database (SQLite, Postgres, etc).

However, a model belongs to an app, once this is the core of Django. So, take a look at https://docs.djangoproject.com/en/2.2/topics/db/models/ where you can read more about that.

If you need a tutorial, take a look at https://docs.djangoproject.com/en/2.1/intro/tutorial02/

In summary, yes, you need an app. However, you do not need a view, once there will be no router, I suppose. Just expose your model to the admin, for instance:

from django.contrib import admin

from .models import YourModel

admin.site.register(YourModel)

Hope it helps

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Using Django REST Framework as an authentication backend for Django

Using the Django sites framework in the Django admin

How to use django only a backend and post with django-rest-framework

How to populate html input in Django framework without using a any of Django form?

Writing webapps in python without Django or any framework

Django - Using a different email backend for admin error emails

Multiple apps in Django admin

How to access a ManyToManyField between two apps using ContentTypes for Django admin?

100% disk usage on Windows 10 without any apps using it

Is there any way to login to Django admin interface using username or email?

Authenticating a User, without using Django rest framework?

Django Admin: Using a custom widget for only one model field

Django Signals not triggering when only using apps.py

can we give if else condition in css without using any framework

Is it possible to program web app using python without "any" framework?

how to use django restframework as a backend for mobile apps

Django: How to hide Sites framework from Django Admin while using django-allauth?

Uploading Multiple Files using Django rest framework without using Forms

Count row only by date without time using Entity Framework

Need to group the apps under labels for the sidebar of django admin using the package jazzmin

create backend API for Mobile Apps using wordpress

Remove default apps from Django-admin

Django admin view without model

Django Admin loading without css

Filter only by years in django admin

how to display large list of data using reactJS as frontend and django rest framework as backend

How can I highlight a section of an article in the backend using django rest framework

Django Type Error adding data to model via django admin backend

Django Migrations - How can I migrate my own django models without any inbuild models like auth,sessions,sites,admin etc