About Blog Gallery Twit

All articles, tagged with “byteflow”

Photologue Installed

Wow, I was quite surprised how easy it was to get photologue installed on byteflow. I know a lot of people have been making comments in the groups about getting byteflow to be a application instead of a project, but it’s quite easy to get things installed on it. Photologue only took about 3 minutes. Here’s the steps I did to install it.

I keep a downloads directory in my home path for bringing in projects and files, but you can dump your checked out dir anywhere.

cd ~/downloads
svn checkout http://django-photologue.googlecode.com/svn/trunk/ django-photologue
cd ~/django_projects/byteflow/apps
mv ~/downloads/django-photologue/photologue .
cd ../templates
mv ../apps/photologue/templates/photologue .

That’s the hard part, now the django side. Follow normal procedures of commenting out all the INSTALLED_APPS and add photologue. I find it easier to do in settings.py directly.

INSTALLED_APPS = (
    #'django.contrib.auth',
    #'django.contrib.contenttypes',
    #'django.contrib.sessions',
    #'django.contrib.sites',
    #'django.contrib.admin',
    #'django.contrib.sitemaps',
    #'django.contrib.flatpages',
    #'django.contrib.markup',
    #'lib',
    #'pytils',
    #'accounts',
    #'blog',
    #'discussion',
    #'openidconsumer',
    #'pingback',
    #'tagging',
    #'typogrify',
    #'render',
    #'robots',
    #'textblocks',
    #'livejournal',
    #'blogroll',
    #'openidserver',
    #'recaptcha',
    'photologue',
)

Run ./manage.py syncdb. Uncomment all the apps that you just commented out in settings.py. Now decide what you want to do with the urls, I just decided to keep photologue in my path.

url(r'^photologue/', include('photologue.urls')),

Then I edited the settings_local.py and added to the STATIC_PAGES this:

('Gallery', '/photologue/gallery/', 'Photos'),

That simple, and everything looks like it worked. Created a test gallery, but going to move over a bunch of photos to see how well it works.

BBCode on Byteflow

I am not a markdown user by default, and I was excited to see that BBCode was included in the drop down for my blog post. I noticed that my code blocks were getting additional carriage return in my posts, taking up some extra real estate on the page. I know this doesn’t do it in places that I’ve used BBCode before, like phpBB.

I converted my existing posts into Markdown for the time being, and I’ll probably dive into the BBCode parser and see if I can fix what’s going on with the additional br tags.

Update — If you’re using some similar CSS to mine here and you experience the oddness with BBCode you can edit the BBCode.py. On line 565 just comment out the replace statement.

def _prepare(self, bbcode):
    # Replace newlines with 'soft' brs
    #bbcode = bbcode.replace("\n", '[softbr]')

    # Replace emoticons with context-sensitive emoticon tags
    #for emoticon in _EMOTICON_LIST:
        #bbcode = bbcode.replace(emoticon,
            #'[emoticon]' + emoticon + '[/emoticon]')
    return bbcode

Byteflow on Dreamhost

I have been hacking at my Dreamhost account for some time now. I’ve installed my own copy of Python so I can have 2.5 compatibility on my account.

[homer]$ python
Python 2.5.1 (r251:54863, Jan 30 2008, 04:48:32)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
[homer]$

My dispatch.fcgi file looks like this:

#!/home/wstearns/opt/bin/python
import sys
sys.path += ['/home/wstearns/django_src']
sys.path += ['/home/wstearns/django_projects/byteflow']
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
WSGIServer(WSGIHandler()).run()

I was a bad boy and edited a file I’m not supposed to in Byteflow, settings.py. I suppose I could have overrode the settings in my local, but I’m still learning.

STATIC_ROOT = '/home/wstearns/media.wstearns.com/static'
STATIC_URL = 'http://media.wstearns.com/static/'
ADMIN_MEDIA_PREFIX = 'http://media.wstearns.com/admin-media/'

Pretty much everything else I followed the directions linked on the wiki.

UPDATE — The overridden section can be placed anywhere in the settings_local.py file. Oh, and my CSS skills suck. As always you can consult the wiki entry at Dreamhost for Django.