Code Monkey home page Code Monkey logo

Comments (3)

ciur avatar ciur commented on May 18, 2024

Hi @langimike

Thank you for opening this discussion.

The thing is, Papermerge used to have a configuration system very similar to django environ that you mentioned. To be honest, I really love that approach (.env file + read settings from environment variables)!

But in practice, those approaches (dotenv, django environ) have drawbacks.
One drawback (and least problematic) is that .env file limits variables syntax. I encountered this issue when I introduced metadata plugins. Metadata plugins are declared as list. IMHO python syntax is very user friendly in that regard - while .env syntax, well, it depends...

Another drawback, which I find as very is serious one - it is when it comes to deploying Papermerge/Django project in production under Apache (mod_wsgi + apache2). Passing environment variables from under apache is, to say the least - not as flexible as compared to deploying from nginx + gunicorn (or even docker containers). Apache Web server has little bit weird way of working with environment variables and it does not pass to django application variables as say gunicorn does.

So, my point is that I won't mess around with configuration system at this moment - as it is flexible enough to work in different environments (development, test, production: gunicorn, uwsgi, apache2 + mod_wsgi).

from papermerge.

langimike avatar langimike commented on May 18, 2024

I definitely understand your points.

I think, it's primarily a matter of taste, because for the first drawback django-environ supports all sorts of python datatypes and the second drawback comes from one's preferred way of deployment (apache2+mod_wsgi vs. nginx+uwsgi or nginx+daphne).

My ideas/suggestions source in me trying to configure database settings (host, user, password) within the containers. The only way I found to override them, is mounting modified app.production.py and worker.production.py to /opt/app/config/settings/production.py.

But don't mind, I got it running.

Thank you!

from papermerge.

ciur avatar ciur commented on May 18, 2024

Great that you have Papermerge up and running!
I will close this issue then.
Thank you!

from papermerge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.