Just now I tried to use django-admin.py makemessages to create a language file and got the following error:
/bin/sh: xgettext: command not found. After a search on my system it turns out I don't have gettext installed.
I did some searching and found mac-ports solutions, but I'm not a big fan of them. I tried compiling myself and got the following errors:
stpncpy.c:34: error: expected declaration specifiers or ‘…’ before numeric constant
stpncpy.c:34: error: expected ‘)’ before ‘!=’ token
stpncpy.c:34: error: expected ‘)’ before ‘?’ token
make[3]: *** [stpncpy.lo] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
I …continue.
And here's how to reset it if you can still reach the installation via SSH or similar.
Start a Django shell:
python manage.py shell
Use the following code to change the password:
from django.contrib.auth.models import User
u = User.objects.get(username__exact='[username]')
u.set_password('[fill in new password here]')
u.save()
exit()
That's all!
When I was working with Django the other day I had a model which contained 3 textareas (models.TextField()). I only wanted 2 of the 3 to use TinyMCE for mark-up in the Admin. I worked out how to achieve this and here’s a quick guide.
Install TinyMCE as explained in an earlier post.
Make sure the tiny_mce folder, the one you downloaded from tinymce.moxiecode.com, is also in your site-media javascript folder (/[sitemedia]/js/tiny_mce/) or change TINYMCE_JS_URL in your settings.py to the correct folder.
In your settings.py define what you want the default tinymce to look like, for example:
TINYMCE_DEFAULT_CONFIG = {
…continue.
A while ago when I was working with Django I had a really hard time trying to figure out how to get TinyMCE to work in Django. Now it isn't difficult, you just have to know how to do it. So I've written a quick guide on how to make it all work.