Django - Splitting admin.py
<p>I tried to split admin.py with the following steps but failed.<br>
- Remove admin.py<br>
- Create folder named "admin"<br>
- Create files in folder "admin". modela.py, modelb.py<br>
- Create "_ <em>init</em> _.py" and leave it empty<br>
- In the "modela.py" file</p>

<pre><code>from django.contrib import admin
from myapp.models import *

@admin.register(ModelA)
class ModelAAdmin(admin.ModelAdmin):
    class Meta:
        model = ModelA
</code></pre>

<p>But the model is not showing in my admin site. What's wrong with the steps above or I missed anything?</p>

<p>Firstly, the file is called <code>__init__.py</code>, with two underscores each side. Secondly, leaving it empty won't do anything at all; you would need to import your admin classes into that file.</p>

python django