okfde / froide

Freedom Of Information Portal
MIT License
357 stars 86 forks source link

Failing to setup up local development environment sample data #461

Closed moritzgloeckl closed 2 years ago

moritzgloeckl commented 2 years ago

Hi,

I'm trying to setup my local development environment for running froide locally. The application is running and I've set up Postgres, PostGIS and all migrations.

When trying to run python manage.py loaddata publicbody.json this fails with the following error:

Traceback (most recent call last):
  File "/workspaces/froide/venv/lib/python3.8/site-packages/django/db/models/options.py", line 608, in get_field
    return self.fields_map[field_name]
KeyError: 'letter_start'

Ok it seems no one updated the publicbody.json lately since it seems some properties are residing in the FoiLawTranslation model.

I've then tried to add some sample data using the admin panel. I was able to add a Jurisdiction but I cannot add a Freedom of Information Law:

TemplateDoesNotExist at /admin/publicbody/foilaw/add/
admin/parler/change_form.html

Request Method: | GET
-- | --
http://127.0.0.1:8000/admin/publicbody/foilaw/add/
3.2.7
TemplateDoesNotExist
admin/parler/change_form.html
/workspaces/froide/venv/lib/python3.8/site-packages/django/template/loader.py, line 19, in get_template
/workspaces/froide/venv/bin/python
3.8.6
['/workspaces/froide',  '/workspaces/froide',  '/opt/python/3.8.12/lib/python38.zip',  '/opt/python/3.8.12/lib/python3.8',  '/opt/python/3.8.12/lib/python3.8/lib-dynload',  '/workspaces/froide/venv/lib/python3.8/site-packages',  '/workspaces/froide/venv/src/django-filingcabinet']
Tue, 05 Oct 2021 18:22:37 +0200

Of course I could now go the database route and manually add some content to the tables but it seems something is wrong here and I'd like to fix that before proceeding.

Any inputs on how to solve this? Thanks!

stefanw commented 2 years ago

Hey, sorry for that experience. The fixtures file is unfortunately outdated. I removed it and the section in the documentation.

I pushed a commit that adds parler to installed apps where it should have been before. This should fix the TemplateDoesNotExist error.

Please note that froide – even though it technically can be run as its own project – is better used as a suite of apps in a separate Django project. The main example how to do that is the FragDenStaat repo.