Audrey M. Roy

Art, design, Python, JavaScript, and general silliness 
Filed under

webfaction

 

Pinax setup on WebFaction Part 2

I scrapped everything I did in part 1 and followed this pretty much
exactly: http://code.pinaxproject.com/wiki/DetailedPinaxWebfaction/

 (note: I spent several hours trying to get my setup to work before I
deleted everything and started from scratch following the
DetailedPinaxWebfaction procedure. I recommend that you do the same
if you're struggling. However, this may be outdated shortly as the
Pinax folks are hard at work on the new release.)

 What I did differently from DetailedPinaxWebfaction:
- Used Pinax-0.7beta3, not beta2
- Used Django-1.0.3, not 1.0.2
- mysql insted of postgresql in myproject/local_settings.py
- Made slight variations to my ~/webapps/pinax07server/apache2/conf/httpd.conf:

 ServerRoot "/home/insert_user_account_here/webapps/pinax07server/apache2"

 LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule wsgi_module modules/mod_wsgi.so

 KeepAlive Off
Listen 37968
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
CustomLog logs/access_log combined
ServerLimit 2

 WSGIPythonPath /home/insert_user_account_here/webapps/pinax07server/pinax-env/lib/python2.5/site-packages/
WSGIScriptAlias /
/home/insert_user_account_here/webapps/pinax07server/myproject/deploy/pinax.wsgi

 LoadModule alias_module modules/mod_alias.so
WSGIDaemonProcess pinaxWSGI user=insert_user_account_here
group=insert_user_account_here threads=25
python-path=/home/insert_user_account_here/webapps/pinax07server/pinax-env/lib/python2.5/site-packages
WSGIProcessGroup pinaxWSGI

 NameVirtualHost 127.0.0.1:insert_your_port_here

  ServerName insert_your_domain_here.com
  WSGIScriptAlias /
/home/insert_user_account_here/webapps/pinax07server/myproject/deploy/pinax.wsgi
  ErrorLog "logs/myproject_2009_05_06.log"

       SetHandler none

     Alias /site_media /home/insert_user_account_here/webapps/static

Filed under  //   Apache   Django   Pinax   Webfaction  
Posted by email 

Comments [1]

WebFaction hosting for Pinax projects, and GIT installation troubles

From a quick bit of research, WebFaction seems like the best host for Pinax projects.  The GIT installation problems I was having are mentioned here and should hopefully be resolved soon now that I opened a support ticket.

Update: the WebFaction folks resolved this.

Filed under  //   Pinax   Webfaction  
Posted by email 

Comments [0]

My notes on installing Pinax 0.7rc1 and integrating my Django art catalog app into it

This post is a mess and mainly for my own personal records.  I've been up all night installing Pinax v0.7rc1, integrating my Django art cataloguing app with one of the Pinax sample projects, and trying to deploy it on Webfaction. 

I installed Pinax 0.7rc1 locally as per the "development version" instructions on their documentation site

Installation notes:
- Install virtualenv and virtualenvwrapper before pinax, if you haven't already
- When you create the pinax-env directory, do it inside of ~/.virtualenvs/
- I ran into a dependency conflict - I had simplejson 1.9.2 installed, and it wanted 2.0.9.  I removed the old one via synaptic and then deleted the old egg.  When I tried rerunning the Pinax script that installs all the external dependencies, it completed successfully.

Then, I cloned their sample social networking website social_project and played with the site (at localhost:8000).  Its admin site at localhost:8000/admin also worked as expected.  This is great, I thought.  I was kind of surprised that I got it working so fast.  The trick is to read every word of the installation docs carefully - I was running into problems until I forced myself to stop skimming the instructions over.

Next, I decided to integrate my Django art cataloguing app with social_project. 

I did the following:
- added this to socialsite/urls.py: "    (r'^artpieces/', include('artapp.urls')),"
- dropped my artapp's urls.py into socialsite/apps/artapp/ and removed the 'artpieces/' start of each url since it's already relative now
- put artapp/ into socialsite/apps/
- put my artpieces/ (the artapp template folder) into socialsite/templates/.  I just put all the artpiece display code inside {% block body %}.  At the top I added {% extends "site_base.html" %} and {% load artapp_extras %}, where the latter loads my custom filters.  I believe I looked at social_project's tag_app and modeled these after its templates, but I don't remember and don't feel like looking it up.
- dropped media/ into site_media/ for local testing purposes.  media/ contains my css files.
- added 'artapp' to INSTALLED_APPS in socialsite/settings.py  (as well as a bunch of Amazon S3 stuff)
- dropped templatetags/ into socialsite/apps/artapp/.  this contains my Django custom filters.
- (I may have forgotten a couple other things)

This worked for the most part.  My art cataloguing app & its admin interface are now fully functional inside of the Pinax social_project app, except for the fact that thumbnails don't get uploaded to S3.  This is probably because of MEDIA_URL and MEDIA_ROOT in settings.py - they point to the just-for-testing site_media/ right now, I could imagine.  I didn't bother to look because I figured I had gotten far enough to try deploying my app on webfaction.

So, after getting it mostly working locally, I tried to get it working on Webfaction.  I really, really hope Webfaction starts supporting Pinax out-of-box because this is where I got stuck. 
1. I easy_installed virtualenv & virtualenvwrapper in my webfaction acct
2. $ wget http://kernel.org/pub/software/scm/git/git-1.6.4.1.tar.bz2
$ tar -xvjf git-1.6.4.1.tar.bz2
$ cd git-1.6.4.1
$ ./configure --prefix=$HOME
$ make && make install

and then kaboom...this is where I got stuck:
    LINK git-upload-pack
    CC var.o
    LINK git-var
    CC http-push.o
http-push.c:14:19: error: expat.h: No such file or directory
http-push.c:852: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
http-push.c: In function ‘lock_remote’:
http-push.c:936: error: ‘XML_Parser’ undeclared (first use in this function)
http-push.c:936: error: (Each undeclared identifier is reported only once
http-push.c:936: error: for each function it appears in.)
http-push.c:936: error: expected ‘;’ before ‘parser’
http-push.c:943: error: ‘parser’ undeclared (first use in this function)
http-push.c:946: error: ‘xml_cdata’ undeclared (first use in this function)
http-push.c: In function ‘remote_ls’:
http-push.c:1179: error: ‘XML_Parser’ undeclared (first use in this function)
http-push.c:1179: error: expected ‘;’ before ‘parser’
http-push.c:1186: error: ‘parser’ undeclared (first use in this function)
http-push.c:1189: error: ‘xml_cdata’ undeclared (first use in this function)
http-push.c: In function ‘locking_available’:
http-push.c:1262: error: ‘XML_Parser’ undeclared (first use in this function)
http-push.c:1262: error: expected ‘;’ before ‘parser’
http-push.c:1269: error: ‘parser’ undeclared (first use in this function)
make: *** [http-push.o] Error 1

(How do I install Git? https://help.webfaction.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=169&nav=0,33
WebFaction Django/mod_wsgi forum post: http://forum.webfaction.com/viewtopic.php?id=1119)

This is where I've left off for now.  I guess I have to install some XML library on webfaction in order to install git, and then I can get back to installing git on webfaction and continue through the rest of the instructions.

Filed under  //   Django   Pinax   programming   Python   virtualenv   Webfaction  
Posted by Audrey M Roy 

Comments [1]