Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no admin.py file in new django app

I'm new to Django and i've already come across a problem. I'm using Django 1.4.3 on OSX Mountain lion.

When I start a new app using

    django-admin.py startapp "name" 

the app is created and all the necessary files are within it (__Init__.py, models.py, tests.py, views.py). However, the admin.py file which should be automatically created is not in the app folder. Without it, i cannot edit my administrator site preferences.

Any ideas as to why this may be happening?

like image 557
Gpivovarov Avatar asked Feb 14 '13 15:02

Gpivovarov


People also ask

Where is Django admin py located?

django-admin.py should be on your system path if you installed Django via python setup.py . If it's not on your path, you can find it in site-packages/django/bin , where site-packages is a directory within your Python installation.

Why Django admin is not working?

Problems running django-admin django-admin should be on your system path if you installed Django via pip . If it's not in your path, ensure you have your virtual environment activated and you can try running the equivalent command python -m django .

Why is manage py not found?

The reason of this problem is because you're in the first project directory "parent directory", and you have to go to your project "newproject" that has the manage.py file. The way to this is simple: cd "name of your project", E.g. cd newproject. python manage.py runserver.

What is admin py in Django app?

The admin.py file is used to display your models in the Django admin panel. You can also customize your admin panel.


1 Answers

You have to create the file manually since the django admin is disabled by default.

Instructions on what to put in admin.py are here.

like image 154
user1688936 Avatar answered Nov 06 '22 07:11

user1688936