Forums

Model Template customization

I am having a hard time understanding what the equivalent of this would be since PythonAnywhere is a remote system. Should I even be trying to do this as the tutorial says or is there a preferred method for this site?

The tutorial need me to locate the root directory and copy the admin templates.

Then specify a customize the template with a link and put the file in a the root directory, i think.

I am still learning so any help is appreciated. thanks in advance for your patients.

http://lightbird.net/dbe/todo_list.html#customizing-model-template

Yes, you can do what it says in the tutorial. You'll need to run the commands that they give there from a bash console, and the directory they give is almost right -- you need python2.7 instead of python2.6.

I was unable to achieve success with the following:

19:05 ~ $ cp -r usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin

I recieved the error message:

cp: missing destination file operand after usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin
Try 'cp --help' for more information.

You're missing part of the command there. The format for the cp command is cp *from* *to*. The *to* in the tutorial page you link to is dbe/templates/. Also, you need to put a slash before the first parameter.

Finally, one thing that might not have been obvious -- you need to use cd to navigate to the root directory of your project before running the command.

I got the file to work. after creating a target folder for the templates, called templates.

 01:08 ~/mysite $ cp -r /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin  todo/templates/                                                             
 01:16 ~/mysite $

Thanks giles