Categories:
Posted by: bjb

The pressure to know stuff quickly in high tech is enormous. I was glad to run across this article about the absurdity of it.

Categories:
Posted by: bjb

The byteflow community has a user mailing list and a hacker mailing list:

  1. users mailing list
  2. hackers mailing list

There is more info on the byteflow wiki and in the docs directory of the sources.

Also they talk on jabber: byteflow@conference.jabber.ru (logs)

Categories: ,
Posted by: bjb

The first two steps in fixing the html on my page have been taken. I’ve decided that no, I’m not going to fix it the easy way (by getting rid of the category cloud). And I upgraded my byteflow to the latest development version.

I looked at mercurial, and decided I didn’t want to learn yet another revision control system, so created a local git repository for my copy of byteflow, and checked the latest byteflow into it. Then created a branch for my changes and put my customizations into it. I have a separate sandbox where I can check out the latest from hg, test it, and check in to the main git repo. That’ll be fun.

Next, will be to report the problem to the byteflow people, and possibly try to fix it myself (if they don’t do it first).

UPDATE:

byteflow ticket 152

Categories: ,
Posted by: bjb

The Redhat-ish way to start and stop daemons is to use the service command. I just learned the Debian-ish way to do that is with the invoke-rc.d command. For example:

$ sudo invoke-rc.d apache2 reload

04/7: byteflow

Categories: , ,
Posted by: bjb

I tried validating (see below) the html on my new(ish) blog — it didn’t validate. It seems the category cloud is non-compliant. But I fixed up the CSS and that validates now.

I will check into the category cloud later.

<a href="/bjb/tag/android/"
title="Click to filter by android"
alt="count: 2"
class="tag-2"
rel="tag">android</a>

<a href="/bjb/tag/apache/"
title="Click to filter by apache"
alt="count: 1"
class="tag-1"
rel="tag">apache</a>

...

The validator doesn’t like “alt” tags on the “a” elements, for starters. The question is, why is it there? Of course it could be commented out (it’s in templates/tagging/tag_cloud.html) but what would break? … Stay tuned.

 continue reading
Categories:
Posted by: bjb

I just learned how to do a couple of things in emacs:

  1. put the line that has point in it at the top of the window: M-0 C-l (meta-zero control-ell)
  2. toggle the buffer to read-only or writeable ( M-x view-mode )
Categories:
Posted by: bjb

I was trying to integrate django’s user model with my application. I had extended the user with extra data in a UserProfile class, and had made a view require login. The web page was successfully redirected to the login page when visited for the first time, but upon logging in the user was not redirected to the original page. The user was redirected to the /accounts/profile page.

It was because I had not noticed that you had to add something to the login template — you need to add a hidden field called “next” to your login form. Once I added that, and changed the form action to “./?next={{ next }}” it started working correctly.

 continue reading
Categories: , ,
Posted by: bjb

Running django under wsgi wasn’t hard … You make a script called xxx.wsgi, and it has a function called ‘application’ that is the entry point to your application. Django supplies an entry point called @django.core.handlers.wsgi.WSGIHandler()@, so you just have to:

application = django.core.handlers.wsgi.WSGIHandler()

(with a little setup beforehand)

You also should configure Apache to handle the appropriate URL location with mod wsgi:

    WSGIScriptAlias /cp /home/bjb/work/credil-bjb/clientportal/wsgi/clientportal.wsgi

There was a little more stuff so that apache would serve some files statically (what django calls the “media” files and “static” files), but that was standard apache config. The other thing is to enable the wsgi module, and (because I’m using django auth) ensure that all the right modules are loaded and all the wrongs ones are disabled.

I started with this documentation (found a pointer to a parent page in the django docs): http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

Categories: ,
Posted by: bjb

To get rid of all the data in your database (but keep the tables):

./manage.py flush

That is pretty much equivalent to:

sudo -u postgres dropdb appdb
sudo -u postgres createdb -O me appdb
./manage.py syncdb

I even got asked the questions about creating the superuser after running the ./manage.py flush command.

Categories: ,
Posted by: bjb

Another error made at the same time as the previous one was to call the model constructors with positional args:

mm = MyModel ('name', 'description')

This resulted in creating a MyModel instance like this:

mm.id = 'name' 
mm.name = 'description'
mm.description = None

I should have called them with keyword args so the passed values would be assigned to the right attributes:

mm = MyModel (name = 'name', description = 'description')