Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#21706 closed Cleanup/optimization (worksforme)

Outdated Instructions - admin.py is not created from 1.6 onwards

Reported by: vincentwoon@… Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords: admin.py
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Following documentation needs to be updated for 1.6:

  1. Tutorial 1 -> startapp does not create admin.py

URL: https://docs.djangoproject.com/en/1.6/intro/tutorial01/
Documentation Text: "python manage.py startapp polls"

  1. Tutorial 2 -> admin.py is not present in folder.

URL: https://docs.djangoproject.com/en/1.6/intro/tutorial02/
But where’s our poll app? It’s not displayed on the admin index page.
Documentation Text: "Just one thing to do: we need to tell the admin that Poll objects have an admin interface. To do this, open the polls/admin.py file, and edit it to look like this:"

Attachments (1)

Inline images 1-3.zip (55.1 KB ) - added by woonzai 10 years ago.
in-line images file

Download all attachments as: .zip

Change History (7)

comment:1 by Aymeric Augustin, 10 years ago

Can you double-check the version of Django you're using?

This ticket describes exactly the behavior of Django < 1.6.

by woonzai, 10 years ago

Attachment: Inline images 1-3.zip added

in-line images file

comment:2 by woonzai, 10 years ago

I'm using 1.6.1.

admin.py is not created when I run "startapp".

Inline image 1

However the documentation for 1.6 assumes that admin.py still gets created.

Inline image 2

Part 2 assumes that polls/admin.py can be found, when in reality we need to create the file from scratch.

Inline image 3

Let me know if I have missed out anything.

comment:3 by Simon Charette, 10 years ago

I just tried startapp with 1.6 and admin.py was created correctly.

simon@simon-laptop:~$ mktmpenv 
New python executable in 50d988b1f14121f7/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
This is a temporary environment. It will be deleted when you run 'deactivate'.
(50d988b1f14121f7)simon@simon-laptop:~/.virtualenvs/50d988b1f14121f7$ pip install "django==1.6.1"
Downloading/unpacking django==1.6.1
  Using download cache from /home/simon/.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FD%2FDjango%2FDjango-1.6.1.tar.gz
  Running setup.py egg_info for package django
    
    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
Installing collected packages: django
  Running setup.py install for django
    changing mode of build/scripts-2.7/django-admin.py from 644 to 755
    
    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
    changing mode of /home/simon/.virtualenvs/50d988b1f14121f7/bin/django-admin.py to 755
Successfully installed django
Cleaning up...
(50d988b1f14121f7)simon@simon-laptop:~/.virtualenvs/50d988b1f14121f7$ django-admin.py startapp app
(50d988b1f14121f7)simon@simon-laptop:~/.virtualenvs/50d988b1f14121f7$ ls app/
admin.py  __init__.py  models.py  tests.py  views.py
(50d988b1f14121f7)simon@simon-laptop:~/.virtualenvs/50d988b1f14121f7$ deactivate
Version 0, edited 10 years ago by Simon Charette (next)

comment:4 by Aymeric Augustin, 10 years ago

I suspect your installation mixes Django 1.5 and 1.6, and manage.py / django-admin.py don't point to the same version as import django.

What does manage.py --version return?

comment:5 by Tim Graham, 10 years ago

Resolution: worksforme
Status: newclosed

comment:6 by woonzai, 10 years ago

aaugustin - Thanks! You are correct. My manage.py --version returns 1.5.1.

Apologies all for the inconvenience caused.

Note: See TracTickets for help on using tickets.
Back to Top