Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment settings #93

Open
wernight opened this issue Feb 17, 2016 · 4 comments
Open

Deployment settings #93

wernight opened this issue Feb 17, 2016 · 4 comments

Comments

@wernight
Copy link

Looking at simple ways to have a different setting for bin/django (dev) and bin/django.wsgi (production).

The README here states briefly that there can be a production.cfg but an example and/or some more details would be really welcome.

I tried to follow mattbierner by creating a production.cfg like:

[buildout]
extends = buildout.cfg
django-setting-file = settings_production

And changing my buildout.cfg like:

[buildout]
django-setting-file = settings
...
settings = ${buildout:django-setting-file}
...

Then run bin/buildout but bin/django.wsgi still points to non-production settings.

@reinout
Copy link
Collaborator

reinout commented Feb 17, 2016

I looked up the mattbierner example. It looks fine.

You'll only get the production settings if you tell buildout to actually use the production settings, by the way. Are you doing that?

$ bin/buildout -c productioncfg

Just making sure... :-)

@wernight
Copy link
Author

No didn't do that. From the README it states "will use the right setting automatically", so I expected it'd use it for things like django.wsgi. Is there a way to have a different settings for bin/django.wsgi and bin/django?

@reinout
Copy link
Collaborator

reinout commented Feb 17, 2016

The recipe only has one settings = .... option, which it will use for everything that it generates.

The production.cfg that extends buildout.cfg is a common trick to overwrite certain things on the production server. Like using a different setting. This is what the README means.

If you really do not want to use a second buildout file for production, you could add a second djangorecipe part with your productionsettings? [devdjango] and [productiondjango]. That is not common usage, though. But it would give you a bin/devdjango and bin/productiondjango, each with different settings.

@wernight
Copy link
Author

Ah! Good idea. Thanks for the tip I think that'll do just fine.

May I suggest updating the README to clarify a little bit? May be just say something like: Using -c production.cfg will use production.cfg instead of the default buildout.cfg. If there is nothing specific for django receipe and it's only buildout code, could even be removed or linked to buildout.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants