18π
β
The admin
is just a python module. So the right way of splitting it would be as follows:
- Create a folder called
admin
instead ofadmin.py
- Use multiple files within the admin folder, like your
Some_Model_admin.py
- Create a
__init__.py
in theadmin
folder and import * all the files into it. - You might also want to include an
__all__
to provide a clean interface.
π€lprsd
1π
you should be importing from Some_Model_admin instead.
from my_app.seperated_admins.Some_Model_admin import *
things should be working fine then
alternatively you can import all the split files into the init in which case
from my_app.seperated_admins import *
should work
π€Kausikram
- Django favicon.ico in development?
- Nginx 504 Gateway Timeout Error for Django
- Object of type 'AuthToken' is not JSON serializable
Source:stackexchange.com