northwest-knowledge-network / mdedit

A data-driven metadata editor front and back end |
http://northwest-knowledge-network.github.io/mdedit
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Hardcoded hostnames in views.py #138

Open flathers opened 8 years ago

flathers commented 8 years ago

In app/api/views.py on lines c. 209, 244, 495, there are hard-coded references to the hostname 'https://nknportal-dev.nkn.uidaho.edu'. Can we get this abstracted out into a config file? It's going to make mdedit a little harder to deploy in production.

flathers commented 7 years ago

Those hardcoded URLs are for simpleUpload and getUsername, both of which are running on portal-prod now. I also see hardcoded references to nknportal-dev in services.js and controllersSpec.js. Defining the locations of the external services in the .wsgi file seems to me to be the correct approach, since then it could be easily set in dev and production.

flathers commented 7 years ago

I created a branch, hostnameAbstraction. It looks like the right place to put these options is in config.py. I put in some settings for production and dev, but it's hard to say what will happen in locally running instances. I also believe I've changed the hardcoded URLs for getUsername and simpleUpload in all of the Python code, but there are a few references in the .js files that I'm not sure how to deal with.