Vlad Krab
Vlad Krab

Reputation: 113

Django: troubles because of not having admin.py

OK, I`m writing an app using this link: https://docs.djangoproject.com/en/1.5/intro/tutorial02/

The whole article says that I must work with admin.py which does not exist in my directory (it wasn`t created). For example, here is the class

class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3

I work in models.py. I`ve change the word 'admin' to a word 'models'.

Imports I have:

from django.db import models
from django.contrib import admin
from django.contrib.auth.models import AbstractUser

Manage.py syncdb says:

AttributeError: 'module' object has no attribute 'StackedInline'

So what should I do?

Thanks a lot.

P.S. Actually, I couldn`t just create admin.py in my directory, could I?

Upvotes: 0

Views: 99

Answers (2)

Sholomitcky
Sholomitcky

Reputation: 397

I`ve change the word 'admin' to a word 'models'.

You should not do that.

Upvotes: 0

meshy
meshy

Reputation: 9116

I couldn`t just create admin.py in my directory, could I?

Yes, you could... and you should :)

The tutorial says:

...create a file called admin.py in your polls directory...

Upvotes: 1

Related Questions