No Django.urls

21 views
Skip to first unread message

Robert Ross

unread,
Feb 11, 2021, 8:24:09 AM2/11/21
to OpenREM
Hi

I'm installing OpenREM on a Windows 2012 server using the offline installation instructions at:


I've downloaded the software and copied everything over and worked through the instructions until it says to go to Localhost:8000 in a broswer on the server.  The browser tells me 'a server error occurred.  Please contact the administrator, and the command line produces the following trace:

[11/Feb/2021 13:18:27] "GET / HTTP/1.1" 500 59
Traceback (most recent call last):
  File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "C:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 63, in __call__
    return self.application(environ, start_response)
  File "C:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 189, in __call__
    response = self.get_response(request)
  File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 209, in get_response
    response = self.get_exception_response(request, resolver, 400)
  File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 90, in get_exception_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 264, in handle_uncaught_exception
    if resolver.urlconf_module is None:
  File "C:\Python27\lib\site-packages\django\core\urlresolvers.py", line 395, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Python27\Lib\site-packages\openrem\openremproject\urls.py", line 10, in <module>
    url(r'^{0}'.format(VIRTUAL_DIRECTORY), include('remapp.urls')),
  File "C:\Python27\lib\site-packages\django\conf\urls\__init__.py", line 33, in include
    urlconf_module = import_module(urlconf_module)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Python27\Lib\site-packages\openrem\remapp\urls.py", line 33, in <module>
    from remapp.views import DicomStoreCreate, DicomStoreUpdate, DicomStoreDelete
  File "C:\Python27\Lib\site-packages\openrem\remapp\views.py", line 64, in <module>
    from remapp.forms import SizeUploadForm
  File "C:\Python27\Lib\site-packages\openrem\remapp\forms.py", line 34, in <module>
    from crispy_forms.helper import FormHelper
  File "C:\Python27\lib\site-packages\crispy_forms\helper.py", line 3, in <module>
    from django.urls import NoReverseMatch, reverse
ImportError: No module named urls

It seems to be the syntax of 'django.urls' is for django version 1.9, but the packages use Django 1.8.9.  I've tried changing:

> from django.urls import NoReverseMatch, reverse

to 

>from django.core.urlresolvers import NoReverseMatch, reverse

which is working,  but I get another error:

Traceback (most recent call last):
  File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response
  File "C:\Python27\lib\site-packages\django\contrib\staticfile
    return self.application(environ, start_response)
  File "C:\Python27\lib\site-packages\django\core\handlers\wsgi
    response = self.get_response(request)
  File "C:\Python27\lib\site-packages\django\core\handlers\base
    response = self.get_exception_response(request, resolver, 4
  File "C:\Python27\lib\site-packages\django\core\handlers\base
    response = self.handle_uncaught_exception(request, resolver
  File "C:\Python27\lib\site-packages\django\core\handlers\base
    if resolver.urlconf_module is None:
  File "C:\Python27\lib\site-packages\django\core\urlresolvers.
    self._urlconf_module = import_module(self.urlconf_name)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in imp
    __import__(name)
  File "C:\Python27\Lib\site-packages\openrem\openremproject\ur
    url(r'^{0}'.format(VIRTUAL_DIRECTORY), include('remapp.urls
  File "C:\Python27\lib\site-packages\django\conf\urls\__init__
    urlconf_module = import_module(urlconf_module)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in imp
    __import__(name)
  File "C:\Python27\Lib\site-packages\openrem\remapp\urls.py",
    from remapp.views import DicomStoreCreate, DicomStoreUpdate
  File "C:\Python27\Lib\site-packages\openrem\remapp\views.py",
    from remapp.forms import SizeUploadForm
  File "C:\Python27\Lib\site-packages\openrem\remapp\forms.py",
    from crispy_forms.helper import FormHelper
  File "C:\Python27\lib\site-packages\crispy_forms\helper.py",
    from crispy_forms.layout import Layout
  File "C:\Python27\lib\site-packages\crispy_forms\layout.py",
    **kwargs,
            ^
SyntaxError: invalid syntax

Can anyone help resolve this? Thanks!

Kind regards
Robert

Ed McDonagh

unread,
Feb 11, 2021, 10:45:23 AM2/11/21
to Robert Ross, OpenREM
Hi Robert

Which version of django-crispy-forms do you have installed?

Ed

--
You received this message because you are subscribed to the Google Groups "OpenREM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrem+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openrem/318e9ae4-cb0b-4ee5-88e3-9a19b07a146cn%40googlegroups.com.

Ed McDonagh

unread,
Feb 11, 2021, 11:26:56 AM2/11/21
to OpenREM
Hi Robert.

I think that is your problem then. On the Offline instructions, there was a line 
pip download -d django-crispy-forms==1.8.1
Which probably was missed?

Hope that helps!

Kind regards

Ed 

On Thu, 11 Feb 2021 at 16:24, Robert Ross <robert...@gmail.com> wrote:
Hi Ed

Thanks for the quick response!

If I import crispy_forms in python, help(crispy_forms) tells me it's 1.9.0

Kind regards
Robert
Reply all
Reply to author
Forward
0 new messages