[Django]-Django custom admin dashboard error

17๐Ÿ‘

โœ…

Ok, it got working. dashboard.py needed to move to myproj/myproj

๐Ÿ‘คbsr

3๐Ÿ‘

Iโ€™ve encountered the same problem! Thank you for your answer, but it seems that your answer is so simplified that I initially could not understand it. Allow me to elaborate so that others may be able to resolve similar issues.

Suppose you have a directory structure like this:

 myproj
    โ”œโ”€โ”€ myproj

    โ”œโ”€โ”€ settings.py
    โ”œโ”€โ”€ manage.py
    โ”œโ”€โ”€ urls.py
    โ”œโ”€โ”€ grappelli
    โ”‚   โ”œโ”€โ”€ ...
    โ”œโ”€โ”€ myapp
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”œโ”€โ”€ __init__.pyc

After you execute the following:

    python manage.py customdashboard 

The dashboard.py is generated in the myproj (the first one) directory, the directory structure will look something like this:

myproj
โ”œโ”€โ”€ myproj
โ”œโ”€โ”€ dashboard.py
โ”œโ”€โ”€ settings.py
โ”œโ”€โ”€ manage.py
โ”œโ”€โ”€ urls.py
โ”œโ”€โ”€ grappelli
โ”‚   โ”œโ”€โ”€ ...
โ”œโ”€โ”€ myapp
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ __init__.pyc

You should put the dashboard.py file in the myproj/myproj directory. Then you login to the adminsite and you will find it works. This is not clearly described in the Dashboard Setup

๐Ÿ‘คJeremyBai

Leave a comment