labhackercd / wikilegis

Collaborative editing of legislative texts. See what we're up to on Trello: https://trello.com/b/b4hyvcH2/wikilegis (in portuguese)
GNU General Public License v3.0
68 stars 22 forks source link

Is the settings.ini file required? #127

Open seanahrens opened 5 years ago

seanahrens commented 5 years ago

I'm doing a first-time install/running of the software.

I performed the following operations successfully:

$ git clone https://github.com/labhackercd/wikilegis.git
$ cd wikilegis
$ npm install
$ pip install -r requirements.txt

The readme seems to indicate that adding settings.ini is merely a customization step, so I skipped it. However, then the next action of "./wikilegis/manage.py list_plugins" fails.

(base) seans-MacBook:wikilegis sean$ ./wikilegis/manage.py list_plugins
Traceback (most recent call last):
  File "./wikilegis/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/anaconda3/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/anaconda3/lib/python3.7/site-packages/django/core/management/__init__.py", line 308, in execute
    settings.INSTALLED_APPS
  File "/anaconda3/lib/python3.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/anaconda3/lib/python3.7/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/anaconda3/lib/python3.7/site-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/sean/Code/wikilegis/wikilegis/wikilegis/settings/wikilegis.py", line 13, in <module>
    module = import_module('..' + name, package=__name__)
  File "/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/sean/Code/wikilegis/wikilegis/wikilegis/settings/apps.py", line 39, in <module>
    plugins_dict = plugins.load_current_plugins()
  File "/Users/sean/Code/wikilegis/wikilegis/core/plugins.py", line 24, in load_current_plugins
    create_config_file()
  File "/Users/sean/Code/wikilegis/wikilegis/core/plugins.py", line 15, in create_config_file
    os.mknod(PLUGINS_CONFIG_FILE)
PermissionError: [Errno 1] Operation not permitted

If the answer is that settings.ini is required, would someone like me to make a pull request for a clarified readme?

seanahrens commented 5 years ago

I went ahead and assumed settings.ini is required in order to keep moving forward with the install. I copied the sample settings.ini file in the readme into settings/settings.ini. However, that results in several errors.

configparser.ParsingError: Source contains parsing errors: '/Users/solo/Code/wikilegis/wikilegis/wikilegis/settings/settings.ini'
    [line  6]: 'FORCE_SCRIPT_NAME\n'
    [line 11]: 'DATABASE_USER\n'
    [line 12]: 'DATABASE_PASSWORD\n'
    [line 13]: 'DATABASE_HOST\n'
    [line 14]: 'DATABASE_PORT\n'
    [line 29]: 'EMAIL_HOST_USER\n'
    [line 30]: 'EMAIL_HOST_PASSWORD\n'
    [line 31]: 'EMAIL_USE_TLS\n'
    [line 32]: 'DEFAULT_FROM_EMAIL\n'
    [line 49]: 'LEGACY_DATABASE_USER\n'
    [line 50]: 'LEGACY_DATABASE_PASSWORD\n'
    [line 51]: 'LEGACY_DATABASE_HOST\n'
    [line 52]: 'LEGACY_DATABASE_PORT'

What is the minimum set of values that I can set up to get the software up and running to see it function? Can I comment out all the email vars? All the legacy_database vars? What is the type of FORCE_SCRIPT_NAME? Is that a boolean which should be 1 or 0? What is the meaning of 1 or 0 if so?

I'm happy to update the readme to smooth out the installation, answering these questions for people installing for the first time, if I can understand the answers myself.