ODM2 / CZ-Manager

CZ Manager (formerly ODM2 Admin) is an application for site level data management of environmental observations using Observation Data Model 2 (ODM2) for documentation and a detailed walkthrough see:
http://odm2.github.io/CZ-Manager
MIT License
9 stars 12 forks source link

Changed settings.py and how settings are used #87

Closed lsetiawan closed 7 years ago

lsetiawan commented 7 years ago

This is step towards extracting settings out of the main code settings.py. I removed any imports that uses templatesAndSettings.settings, but rather used from django.core.management import settings. @miguelcleon I did this with my previous development branch, but didn't ping you on it, and many changes has happened, so I had to rebase, and redo my changes. Let me know if this is okay. Thanks.

miguelcleon commented 7 years ago

great, I've been wanting to do this. I'll want to test some.

lsetiawan commented 7 years ago

Awesome! More changes are coming your way, but I want to do it in small increments rather than one big push. Let me know if anything broke. One question I have is regarding base.py Is this being used? I noticed it's used in the .travis.yml, but seems like base.py is a repeat of settings.py can I change it to settings.py in .travis.yml and get rid of base.py? I'm not familiar with travis. Thanks.

miguelcleon commented 7 years ago

The idea was to have standard django settings in base.py (apps every instance of odm2 admin should have installed) and system or site specific settings in settings.py - name of the site (LCZO or CZIMEA for instance) map coordinates and appropriate zoom level. So I guess my question is what are you proposing instead? I had found an example of another django app that did it this way and it seemed like a good idea.

lsetiawan commented 7 years ago

@miguelcleon That makes sense. I think separating base settings from site specific settings is a good idea. We just gotta make this more clear. My thought is that I will set the global settings within base.py and then import that into settings.py but have settings.py read from a yaml file for any custom settings from a user? This will separate the actual code from the user input. Does that make sense? Thanks.

miguelcleon commented 7 years ago

Yes, that would work.

lsetiawan commented 7 years ago

@miguelcleon I am not familiar with the whole Email hosting stuff. Could you please give me an example of your configuration? possibly by email. Also, where do I get the recaptcha public and private keys? Thanks. I'd like to test my copy as I develop things. Thank you.

miguelcleon commented 7 years ago

Ok, I sent you an email. What I sent minus the specific settings:

Here are my email settings. Right now I’m using sendgrid to deliver the emails, this allows me to easily review what was sent. https://sendgrid.com

Google recaptcha can be found here https://www.google.com/recaptcha/intro/ For local development, you are supposed to be able to use any key combination you like, let me know if you have any problems. http://stackoverflow.com/questions/3232904/using-recaptcha-on-localhost

miguelcleon commented 7 years ago

looks good. I tested out the changes. @lsetiawan

miguelcleon commented 7 years ago

I have updated http://odm2admin.cuahsi.org/CZIMEA/ with the latest changes and updated django to version 1.10.5 @lsetiawan @emiliom

emiliom commented 7 years ago

Thanks, @miguelcleon !