开发者

How to use admin interface if I have no application?

开发者 https://www.devze.com 2023-01-06 05:31 出处:网络
I am creating a Django based app and I\'d like to put everything under the root in the following structure:

I am creating a Django based app and I'd like to put everything under the root in the following structure:

/path/to/my/app/
    settings.py
    models.py
    urls.py
    admin.py
    ...

One problem that I run into is the admin interface doesn't include whatever models I have that are registerd in admin.py usin

admin.site.register(models.MyModel)

Usually that's done by using auto discover in urls.py, but now I have no registered "app", the auto discover doesn't work anymore. Is there anyway I can still use th开发者_JS百科e admin interface?

Thanks.


Django simply doesn't work without apps. They're the fundamental building block of a Django site. A whole range of things, not just the admin, will fail to work. Why do you want to do this?


Putting the app in the django-style directory structure will make your project easily extensible if you decide to add functionality later.

0

精彩评论

暂无评论...
验证码 换一张
取 消