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?
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.
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 .
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.
The admin.py file is used to display your models in the Django admin panel. You can also customize your admin panel.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With