Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation README Ambiguity (dev/1.1.x) #1373

Closed
ekansa opened this issue Oct 19, 2023 · 10 comments · Fixed by #1375
Closed

Installation README Ambiguity (dev/1.1.x) #1373

ekansa opened this issue Oct 19, 2023 · 10 comments · Fixed by #1375
Assignees

Comments

@ekansa
Copy link
Contributor

ekansa commented Oct 19, 2023

In the installation README (https://github.com/archesproject/arches-for-science/blob/dev/1.1.x/README.md#2-project-configuration), there seems to be some ambiguity about the 'myappname' app added to the INSTALLED_APPS config in settings.py.

Should this be removed or updated?

@ekansa
Copy link
Contributor Author

ekansa commented Oct 19, 2023

The project settings.py that I created from dev/7.5.x doesn't have RENDERERS defined. Maybe we should add something like this?

# A hack to see if this exists.
try:
    RENDERERS
except NameError:
    RENDERERS = []

RENDERERS += [
    {
        "name": "xy-reader",
        "title": "XY Data File Reader",
        "description": "Use for all instrument outputs with x-y data",
        "id": "e93b7b27-40d8-4141-996e-e59ff08742f3",
        "iconclass": "fa fa-bolt",
        "component": "views/components/cards/file-renderers/xy-reader",
        "ext": "txt",
        "type": "text/plain",
        "exclude": "",
    },
]

@ekansa
Copy link
Contributor Author

ekansa commented Oct 20, 2023

Hmmm...

Maybe a Django version issue with this:

from django.conf.urls import path, include
ImportError: cannot import name 'path' from 'django.conf.urls' (/root/.local/lib/python3.10/site-packages/django/conf/urls/__init__.py)

Something like this work?

from django.urls import include, path, re_path
from django.conf import settings
from django.conf.urls.static import static


urlpatterns = [
    re_path(r'^', include('arches.urls')),
    re_path(r"^", include("arches_for_science.urls")),
    path("reports/", include("arches_templating.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

@jacobtylerwalls jacobtylerwalls self-assigned this Oct 20, 2023
@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Oct 20, 2023

Thanks, these are really helpful observations.

The project settings.py that I created from dev/7.5.x doesn't have RENDERERS defined.

Nice catch. settings.RENDERERS is defined in core arches and documented, so IMO it's safe to depend on, and we should just update the settings template and mention in the AFS readme that some projects may have been created without this setting. What do you think?

Maybe a Django version issue with this:

Ah, thanks. Yeah, the arches app feature was developed in tandem with the django upgrade and we didn't account for that here. DISCO is a good reference, except here I'll probably suggest just sticking with path() since we don't need a regex.

there seems to be some ambiguity about the 'myappname' app

Can you elaborate on what you found difficult to follow? I only see one reference to the myappname placeholder, and in your case it would be afs_plocal, so the README looks correct.

@ekansa
Copy link
Contributor Author

ekansa commented Oct 23, 2023

Thanks!! @jacobtylerwalls I'll to use your README update as a guide for my next attempts at deployment.

@ekansa
Copy link
Contributor Author

ekansa commented Oct 23, 2023

@jacobtylerwalls I think I'm still missing something critical. When I run Webpack, I get 500 errors on the workflow related templates:

arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/project-report-workflow/download-project-files.htm HTTP/1.1" 500 94187
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/chemical-analysis-workflow/ca-final-step.htm HTTP/1.1" 500 94127
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/create-project-workflow/add-things-step.htm HTTP/1.1" 500 94117
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/chemical-analysis-workflow/ca-upload-files-step.htm HTTP/1.1" 500 94197
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/chemical-analysis-workflow/ca-instrument-info-step.htm HTTP/1.1" 500 94227
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/project-report-workflow/project-report-select.htm HTTP/1.1" 500 94177
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/project-report-workflow/add-annotations.htm HTTP/1.1" 500 94117
arches                | [23/Oct/2023 19:49:00] "GET /templates/views/components/workflows/project-collection-workflow/project-collection-final-step.htm HTTP/1.1" 500 94297

Also:

arches                 | No module named 'arches_for_science_package'

@ekansa
Copy link
Contributor Author

ekansa commented Oct 23, 2023

Also, I'm puzzled about installation of cantaloupe? Shouldn't this be part of the README?

jacobtylerwalls added a commit that referenced this issue Oct 24, 2023
@jacobtylerwalls
Copy link
Member

arches | No module named 'arches_for_science_package'

Good catch, it should just be arches_for_science: see 396eacc.

@jacobtylerwalls
Copy link
Member

Added cantaloupe note in 4830b39.

@ekansa
Copy link
Contributor Author

ekansa commented Oct 24, 2023

@jacobtylerwalls Thanks so much for the updates!

I'm still getting build errors in webpack. I'm missing a FORMATS attribute in settings (should this be added to the README?) and the templates are giving me some issues. See below. The exact settings I'm using are here:

https://github.com/opencontext/arches-via-docker/blob/local-afs-dev-1-1-x/arches/settings.py

arches                 | [24/Oct/2023 18:40:04] "GET /templates/views/components/cards/map.htm HTTP/1.1" 500 94811
arches                 | [24/Oct/2023 18:40:04] "GET /templates/views/components/cards/file-viewer.htm HTTP/1.1" 500 94891
arches                 | 'Settings' object has no attribute 'FORMATS'
arches                 | Internal Server Error: /templates/views/components/map.htm
arches                 | Traceback (most recent call last):
arches                 |   File "/root/.local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
arches                 |     response = get_response(request)
arches                 |   File "/root/.local/lib/python3.10/site-packages/django/core/handlers/base.py", line 204, in _get_response
arches                 |     self.check_response(response, callback)
arches                 |   File "/root/.local/lib/python3.10/site-packages/django/core/handlers/base.py", line 332, in check_response
arches                 |     raise ValueError(
arches                 | ValueError: The view arches.app.views.main.templates didn't return an HttpResponse object. It returned None instead.

chiatt pushed a commit that referenced this issue Oct 24, 2023
* Update README with settings and url tweaks

* [README] Fix typos re #1373

* [skip ci] add cantaloupe note re #1373
@chiatt chiatt closed this as completed Oct 24, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in afs-pipeline Oct 24, 2023
@jacobtylerwalls
Copy link
Member

Good catch, looks a docs regression in d82bb80. I'll open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants