Re: Deployment with Subversion

2007-03-20 Thread [EMAIL PROTECTED]

Thanks everyone for the suggestions.  I might have "over-done" my
solution, but it works and my colleagues, clients and myself are
satisfied.  If you're interested, I use JSON to specify some settings
with should override those in settings.py.  See http://gnuvince.net/?p=371
for more information.

Vincent.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-15 Thread Robert Coup

ScottB wrote:
> One thing to consider when serving a working copy is all those .svn
> directories could be accessible via your web server.  Assuming your
> code isn't within your web server's root (which it shouldn't be),
> there's probably not much that can go wrong.  Still, it might be worth
> checking if you can see anything interesting with something like:
>
> http://www.example.com/myapp/.svn/text-base/
>
> I normally prefer an svn export instead of serving a working copy, for
> that reason.
>   
Another option is to put something like this in your apache config which 
will redirect .svn requests to a 404 error.

RedirectMatch 404 /\.svn(/|$)

Although an export is generally a better solution IMO.

Rob :)

-- 
One Track Mind Ltd.
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Mobile +64-21-572 632
Web http://www.onetrackmind.co.nz 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-15 Thread Jens Diemer

Kenneth Gonsalves schrieb:
> never ever put settings.py under version control
ack.

In PyLucid i put only a settings-example.py into my svn:
http://pylucid.net/trac/browser/branches/0.8%28django%29/PyLucid/settings-example.py

In the handler file (here a CGI handler), i check this:
-
try:
 from PyLucid.settings import DEBUG
except ImportError:
 print "Content-type: text/plain; charset=utf-8\r\n\r\n"
 print "Low-Level-Error!"
 print
 print "Can't import 'settings'!"
 print
 print "You must rename ./PyLucid/settings-example.py to 
./PyLucid/settings.py"
 print
 print "You must setup this file for your config!"
 import sys
 sys.exit()
-

-- 
Mfg.

Jens Diemer



CMS in pure Python CGI: http://www.pylucid.org


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-15 Thread ScottB

Hi Vincent.

On Mar 14, 5:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Does anyone have tricks to make this process a bit more efficient and
> not catastrophic in case we forget to copy the settings.py file?

I use conditionals inside my settings.py so that one lot of paths/
settings get used on the dev server and another lot get used on the
live server.  You could check automatically if the machine is the dev
server and if not, use the settings for the live server.  That way the
settings get overwritten intentionally.

e.g.

# Check if we are running on the dev server.
# Defaults to using live settings in case live server name changes.
DEV_HOSTNAME = 'dev-server'
from socket import gethostname
LIVE = gethostname() != DEV_HOSTNAME

if LIVE:
DATABASE_ENGINE = 'postgresql_psycopg2'
...etc
else:
DATABASE_ENGINE = 'sqlite3'
...etc

One thing to consider when serving a working copy is all those .svn
directories could be accessible via your web server.  Assuming your
code isn't within your web server's root (which it shouldn't be),
there's probably not much that can go wrong.  Still, it might be worth
checking if you can see anything interesting with something like:

http://www.example.com/myapp/.svn/text-base/

I normally prefer an svn export instead of serving a working copy, for
that reason.

Scott


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-14 Thread Kenneth Gonsalves


On 14-Mar-07, at 10:46 PM, [EMAIL PROTECTED] wrote:

> how do people deploy Django projects with subversion?  We did a simple
> checkout at a client's and when we need to do updates, we copy his
> settings.py file somewhere outside the directory, do the svn update,
> we copy the settings.py

never ever put settings.py under version control - the risk of it  
showing up on some trac or other gui and exposing your passwords is  
too great. Most of us keep a dummy file like settings.default in the  
repo and manually maintain the settings.py file. Anyway, there will  
be differences between your development copy of settings.py and the  
production copy.

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-14 Thread Ned Batchelder
Also, keep in mind that you can tell svn to ignore a particular file 
even though it is located in a working directory.  We keep a settings.py 
under svn control, and have it import a local.py which is ignored.  This 
way, each developer can make local modifications without fear of 
accidentally polluting the common pool.

--Ned.

Malcolm Tredinnick wrote:
> On Wed, 2007-03-14 at 17:16 +, [EMAIL PROTECTED] wrote:
>   
>> Hello,
>>
>> how do people deploy Django projects with subversion?  We did a simple
>> checkout at a client's and when we need to do updates, we copy his
>> settings.py file somewhere outside the directory, do the svn update,
>> we copy the settings.py file back in and do a graceful restart of
>> Apache.
>>
>> Does anyone have tricks to make this process a bit more efficient and
>> not catastrophic in case we forget to copy the settings.py file?
>> 
>
> There's no compulsion to have settings.py inside the project directory
> (it also doesn't have to be called settings.py, so you can put the
> settings files for a number of projects in the same directory if you
> name them carefully).
>
> For my personal work, I keep my settings.py files for production
> settings outside of the project directory so that I can just untar the
> new version of the code, update a symlink to the latest version and
> reload the webserver process, without needing to remember to update the
> settings file.
>
> Regards,
> Malcolm
>
>
> >
>
>
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-14 Thread Malcolm Tredinnick

On Wed, 2007-03-14 at 17:16 +, [EMAIL PROTECTED] wrote:
> Hello,
> 
> how do people deploy Django projects with subversion?  We did a simple
> checkout at a client's and when we need to do updates, we copy his
> settings.py file somewhere outside the directory, do the svn update,
> we copy the settings.py file back in and do a graceful restart of
> Apache.
> 
> Does anyone have tricks to make this process a bit more efficient and
> not catastrophic in case we forget to copy the settings.py file?

There's no compulsion to have settings.py inside the project directory
(it also doesn't have to be called settings.py, so you can put the
settings files for a number of projects in the same directory if you
name them carefully).

For my personal work, I keep my settings.py files for production
settings outside of the project directory so that I can just untar the
new version of the code, update a symlink to the latest version and
reload the webserver process, without needing to remember to update the
settings file.

Regards,
Malcolm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-14 Thread Bob T.

Hi Vincent,

Check out http://code.djangoproject.com/wiki/DosAndDontsForApplicationWriters.

Bob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-14 Thread Bob T.

This one is a bit more direct: http://code.djangoproject.com/wiki/SplitSettings

Bob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Deployment with Subversion

2007-03-14 Thread [EMAIL PROTECTED]

Hello,

how do people deploy Django projects with subversion?  We did a simple
checkout at a client's and when we need to do updates, we copy his
settings.py file somewhere outside the directory, do the svn update,
we copy the settings.py file back in and do a graceful restart of
Apache.

Does anyone have tricks to make this process a bit more efficient and
not catastrophic in case we forget to copy the settings.py file?

Vincent.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-14 Thread Bob T.

This one is a bit more direct: http://code.djangoproject.com/wiki/SplitSettings

Bob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---