mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-18 14:10:59 +00:00
1 line
5.8 KiB
JSON
1 line
5.8 KiB
JSON
[{"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303282613.3252859, "message": "I saw in a number of articles and tutorial that people recommend splitting the settings file to development/testing/production, etc.", "group_id": 81, "id": 752667}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303282622.4491129, "message": "I've done that and it works fine for me.", "group_id": 81, "id": 752668}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303282687.964602, "message": "However, I was wondering if people are using these files to store env information like hosts, ports, db passwords, etc. If not, what's the alternative? OS env settings? A separate configuration file? (INI? YAML?)", "group_id": 81, "id": 752677}, {"user_id": 13403, "stars": [], "topic_id": 20487, "date_created": 1303291321.8110199, "message": "There\u2019s a number of ways to do this. One way is to have configs per environment, with a common settings file and specific files for each environment importing from it. A version of this approach can be seen in Gareth Rushgrove\u2019s Django project templates <https://github.com/garethr/django-project-templates>, although this is probably overkill for most projects.", "group_id": 81, "id": 753358}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303292413.7143791, "message": "Thanks for the info. It does look like an overkill. I'll probably start using Puppet soon (somehow it makes more sense to me).", "group_id": 81, "id": 753423}, {"user_id": 13403, "stars": [], "topic_id": 20487, "date_created": 1303291642.8146241, "message": "Another approach is to have common settings, with environment-specific settings in a config file on each host, probably in a separate directory to the project itself. The advantage here is that it\u2019s easier to integrate with an infrastructure tool like Chef or Puppet. You can have this config file in any format you like, but it seems to be most consistent with \u201cthe Django Way\u201d simply to have it in Python and (attempt to) import it from your settings file.", "group_id": 81, "id": 753378}, {"user_id": 13403, "stars": [], "topic_id": 20487, "date_created": 1303302216.24808, "message": "Agreed. At Glasses Direct (my employer) we're using override directories for our site, with multiple projects across multiple environments, all managed by Puppet, and it's working out very nicely.", "group_id": 81, "id": 754132}, {"user_id": 22386, "stars": [], "topic_id": 20487, "date_created": 1303304970.882401, "message": "You might check out https://github.com/robmadole/django-sunset. It allows you to seperate settings my host, function or local dev.", "group_id": 81, "id": 754511}, {"user_id": 22386, "stars": [], "topic_id": 20487, "date_created": 1303307710.8053579, "message": "well you can configure it to ignore if a hostname is not found", "group_id": 81, "id": 754912}, {"user_id": 22386, "stars": [], "topic_id": 20487, "date_created": 1303307744.5788031, "message": "then you could create a production.py for your settings", "group_id": 81, "id": 754922}, {"user_id": 22386, "stars": [], "topic_id": 20487, "date_created": 1303307748.311101, "message": "and add them", "group_id": 81, "id": 754924}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303307637.4742889, "message": "@supercodepoet thanks. It doesn't really work in Amazon EC2, since hostnames are very fluid there.", "group_id": 81, "id": 754892}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303308660.57478, "message": "I didn't go into too much details, but it seems to lose the edge at this point. All my envs are on EC2, including testing, staging and production. It will help with running on my development machine, but that's the least of my worries.", "group_id": 81, "id": 755086}, {"user_id": 1127, "stars": [{"date_created": 1303397274.9815719, "user_id": 1963}, {"date_created": 1303412057.111325, "user_id": 12620}], "topic_id": 20487, "date_created": 1303348684.715421, "message": "@zvikico here's how we generally handle it: http://justcramer.com/2011/01/13/settings-in-django/", "group_id": 81, "id": 763928}, {"user_id": 1127, "stars": [], "topic_id": 20487, "date_created": 1303367257.8066931, "message": "@zvikico we use Fabric, and for things like our CI server, we simply have a localsettings.py which says \"from disqus.conf.settings.test import*\" -- with the way ours is setup, at least in this example, we could also just use DJANGO_SETTINGS_MODULE", "group_id": 81, "id": 766982}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303366113.966476, "message": "@zeeg much appreciated. I'll go over it.", "group_id": 81, "id": 766797}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303367167.1597559, "message": "@zeeg btw, are you using any configuration management or deployment tool?", "group_id": 81, "id": 766973}, {"user_id": 11827, "stars": [], "topic_id": 20487, "date_created": 1303370480.2912951, "message": "@zeeg I went over your article. Impressive. I already have something in place, which is not as powerful, so thanks for educating me. However, I still didn't get an answer to the hosts/ports/users question. Suppose you have several testing/staging envs and a constantly changing production env. I'm assuming you would want to separate the highly-fluid settings from the main project and manage it separately.", "group_id": 81, "id": 767367}, {"user_id": 1127, "stars": [], "topic_id": 20487, "date_created": 1303435881.590219, "message": "@zvikico Right, so we set sane defaults in default.py, and nearly every system is configured the same way. We might use a different username to connect to our database, and a different host, but its still the same database, same engine, etc. Default.py specifies the production values, dev.py specifies the \"everywhere that's isolated\" values", "group_id": 81, "id": 777265}] |