WebFaction
Community site: login faq

right now i have:

~/webapps/django
~/webapps/django_static
~/webapps/django_admin

right now my working copies look like:

~/working/myreponame/trunk ~/working/myreponame/tags ~/working/myreponame/branches

i would like to have a production environment and a development environment where:

www.mywebsite.com => production (symlink to ~/working/myreponame/tags/current) beta.mywebsite.com => dev (symlink to ~/working/myreponame/trunk)

what is the best way to set this up?

i've tried creating a symlink for ~/webapps/django/myproject to point to trunk, but then i had problems doing python2.7 manage.py syncdb; it would say things like ImportError: No module named django.core.management

any advice would be greatly appreciated. thanks

asked 16 Apr '11, 04:44

razic3k
1313
accept rate: 0%


There's no reason that your symlink approach shouldn't work.

Regarding the ImportError message, you need to either:

  • Ensure that your working directory is ~/webapps/django/myproject (the symlink) and not ~/working/myreponame/trunk (the source). We have some Python magic that automatically puts your ~/webapps/django/lib/python2.7 directory on your sys.path if the working directory is at or below ~/webapps/django, so Python will be able to locate your Django libraries. Or...
  • Explicitly set your PYTHONPATH environment variable if you're running the commands from your trunk directory.

An example of the latter:

export PYTHONPATH=$HOME/webapps/django/lib/python2.7
cd ~/working/myreponame/trunk
python2.7 manage.py syncdb

If you see more ImportError messages regarding other Python modules, then make sure that those modules' parent directories are on your PYTHONPATH also.

Hope that helps!

permanent link

answered 16 Apr '11, 13:09

seanf
12.1k21736
accept rate: 37%

Are you using Virtual Environments at all? If not, that might be something for you to look into. I use it with GIT, but not quite the same way you are asking.

permanent link

answered 16 Apr '11, 12:30

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×900
×40

question asked: 16 Apr '11, 04:44

question was seen: 3,622 times

last updated: 16 Apr '11, 13:09

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM