Wednesday, December 8, 2010

UTF-8

Having some issues with UTF-8 files with illegal characters. Trying to make a filter, or at least a problem reporter. Good info by dwheeler.

Sunday, December 5, 2010

Using Scomp

I'm working on a project that deals with XMPP information. I'm using xmlbeans scomp to compile xsd files into java classes. I got the source code to work, but scomp failed to generate a jar file. I got the error described by Three Wise Men and Celinio Fernandes. I'm working on Windows XP.

With the scomp src I built an Eclipse project and could build against it, but got this run time exception:
ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54
In trying to solve it I learned to use javac from the command line (I have only used the Eclipse JDE until now.) I installed Ant (I thought there was a dependency) and learned to use. I learned how to produce a jar in Eclipse. None of these solved the problem.

Three Wise Men set me on the right track. The problem is a space in the javac path. Three Wise Men fix it by using scomp's -compiler option. However, for me, scomp still choked on the space. So I found out about junction (see Wikipedia). I used junction to make Program-Files link to Program Files (skip the md step in the junction example). Put the hypen in my JAVA_HOME and path. Still scomp failed to make jar. Finally used compiler option with hypen and it worked. Added jar to my build path in Eclipse and finally my project ran correctly.

Whew! Lotta work just for that.

Wednesday, December 1, 2010

Lots!

Learned this morning that Python compiles when a module is called up. However, Apache, default Windows settings with wsgi, seems to cache Python code. Need to stop and start server after every Python change.

Learned more than I can describe at new job today. Much more to pickup. Need to shelve home Django & Python stuff for a while. Two projects at work, lower priority uses Dj & Py, so may be back to it soon.

Tuesday, November 30, 2010

Django install on Apache server

Django doc on using with wsgi server.

Learned that the base wsgi file (django.wsgi) needs to be in a legal server path. On my machine that's c:/xampp/htdocs. Otherwise get 403 error. However, the wsgi file can refer to projects anywhere on computer. The project does need to be on the path, as the doc says (and shows how to do. However, the setting of DJANGO_SETTINGS_MODULE is a little misleading. I added my project to the path (c:/xampp/django/avppng). Then DJANGO_SETTINGS_MODULE = 'settings' because it is relative to the path. The doc shows setting path to django (c:/xampp/django) and DJANGO_SETTINGS_MODULE='avppng.settings'. But this makes some relative paths in the project not work.

Python errors produce 500 errors. Look at Apache error log file c:/xampp/apache/logs/error.log to see Python errors. The doc mentioned setting LogLevel info in httpd.conf, but the default warn setting worked fine for me. Tried to use sys.stderr.write to write to log file, but didn't work.

Now I see something disturbing. I just saw an error that my administration module couldn't be found in avppng.urls. So in wsgi file I changed the path to c:/xampp/django/avppng/ and DJANGO_SETTINGS_MODULE to settings. Shut down, made a change. Then it told me a django py couldn't find avppng.urls. So I changed path back to c:/xampp/django and DJANGO_SETTINGS_MODULE to avppng.settings and it worked! How can one way work then not and visa versa?? (Slash at end of path doesn't seem to make a difference.)


Django tag cloud

Tag clouds for Django. Stackoverflow post has info. Logarithmic tag algorithm. Napes intro to using tag clouds. Django-tagging package.

Django social authorization

Post about package to allow login through social media (Facebook, Google, etc) ids.