Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django App Not Showing up in Admin Interface

I'm currently moving from my development server to an Apache web production server.

I've tried doing the following just by copying it over and I can login to the admin panel but it doesn't show up.

My admin.py in my app looks like this:

    import models
    from django.contrib import admin

    admin.site.register(models.Organization)

And here is my models.py

from django.db import models

class Organization(models.Model):
    name = models.CharField(max_length=100)
    website = models.URLField()
    azon_code = models.CharField(max_length=50)
    gooe_code = models.CharField(max_length=50)
    cj_code = models.CharField(max_length=50)

I've resyned the database and restarted apache as well thinking that might do something.

like image 817
Noah Clark Avatar asked Nov 07 '09 20:11

Noah Clark


People also ask

Why Django admin is not working?

'django-admin' is not recognized as an internal or external command, operable program or batch file. To fix this, first close the terminal window and relaunch it with administrator privileges. Once you launch the elevated terminal window change directory to where you wish to start your Django project.

What is Inlines in Django admin?

The admin interface is also customizable in many ways. This post is going to focus on one such customization, something called inlines. When two Django models share a foreign key relation, inlines can be used to expose the related model on the parent model page. This can be extremely useful for many applications.


1 Answers

Aren't you supposed to import like:

from mysite.myapp.models import Organization
admin.site.register(Organization)
like image 139
Andrei Serdeliuc ॐ Avatar answered Sep 28 '22 23:09

Andrei Serdeliuc ॐ