Django does not create admin.py file in new app

Asked

Viewed 105 times

0

I’m following some video lessons about Django to make some changes to a project started some time by someone else. However, when starting a new app in this project with the command

django-admin start app mad 

the files are created: __init__.py, models.py, testes.py and views.py, but not the admin.py.

My version of Django is 1.3.4 and Python 2.7

What to do in this case? I can create the file manually, or it is possible there is something wrong in the settings?

1 answer

1


Wilker,

Probably the version of Django you are using, I am with version 1.10 and the admin.py file is created.

Also check in the file py Settings. in INSTALLED_APPS if there is the value 'Django.contrib.admin'.

Anyway you can create the admin.py file manually, with the initial content as below:

from django.contrib import admin
  • Perfect, as I could see here looks like it is created by default from version 1.6. I created the file manually and added the line you said and it worked perfectly. .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.