TypeError: __init__() got an unexpected keyword argument 'current_app' with CentOS 7, Python 2.7.5 and Django 1.10.6 #737

Closed
opened 2025-12-29 16:25:19 +01:00 by adam · 2 comments
Owner

Originally created by @glennake on GitHub (Mar 2, 2017).

Hi there,

I've tried installing Netbox on a CentOS 7 server by following the documentation. I used pip and the requirements file to install Django and dependencies:

[root@server netbox]# pip install -r requirements.txt
...
Collecting Django>=1.10 (from -r requirements.txt (line 3))
  Downloading Django-1.10.6-py2.py3-none-any.whl (6.8MB)
    100% |████████████████████████████████| 6.8MB 189kB/s
...
  Found existing installation: Django 1.8.11
    Uninstalling Django-1.8.11:
      Successfully uninstalled Django-1.8.11
...
Successfully installed Django-1.10.6 Markdown-2.6.8 django-debug-toolbar-1.6 django-rest-swagger-0.3.10 django-tables2-1.4.1 natsort-5.0.2 psycopg2-2.7 py-gfm-0.1.3 sqlparse-0.2.2

Software combination is as below:
CentOS Linux release 7.2.1511 (Core)
Python 2.7.5
Django 1.10.6
Netbox 1.8.4

Have tried cloning from the Git repo (master branch) and downloading zip archive, both do not appear to be working, error as below:

[root@server netbox]# ./manage.py runserver 0.0.0.0:8000 --insecure
Performing system checks...

System check identified no issues (0 silenced).
March 02, 2017 - 00:53:31
Django version 1.10.6, using settings 'netbox.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Traceback (most recent call last):
  File "/usr/lib64/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
    return self.application(environ, start_response)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
    response = self.get_response(request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
    response = self._middleware_chain(request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 44, in inner
    response = response_for_exception(request, exc)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 94, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 143, in handle_uncaught_exception
    return callback(request, **param_dict)
  File "/opt/netbox/netbox/views.py", line 58, in handle_500
    }, status=500)
  File "/usr/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 49, in render
    context_instance = RequestContext(request, current_app=current_app)
TypeError: __init__() got an unexpected keyword argument 'current_app'
[02/Mar/2017 00:53:34] "GET /login/ HTTP/1.1" 500 59

However, if I downgrade Django to 1.9 (as test server ouput on the install docs shows 1.9.7) as below:

[root@server netbox]# pip install django==1.9
Collecting django==1.9
  Downloading Django-1.9-py2.py3-none-any.whl (6.6MB)
    100% |████████████████████████████████| 6.6MB 170kB/s
Installing collected packages: django
  Found existing installation: Django 1.10.6
    Uninstalling Django-1.10.6:
      Successfully uninstalled Django-1.10.6
Successfully installed django-1.9

Then it seems to work without issues:

[root@server netbox]# ./manage.py runserver 0.0.0.0:8000 --insecure
Performing system checks...

System check identified no issues (0 silenced).
March 02, 2017 - 00:55:08
Django version 1.9, using settings 'netbox.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[02/Mar/2017 00:55:11] "GET /login/ HTTP/1.1" 200 11737
Originally created by @glennake on GitHub (Mar 2, 2017). Hi there, I've tried installing Netbox on a CentOS 7 server by following the [documentation](http://netbox.readthedocs.io/en/stable/installation/netbox/). I used pip and the requirements file to install Django and dependencies: ``` [root@server netbox]# pip install -r requirements.txt ... Collecting Django>=1.10 (from -r requirements.txt (line 3)) Downloading Django-1.10.6-py2.py3-none-any.whl (6.8MB) 100% |████████████████████████████████| 6.8MB 189kB/s ... Found existing installation: Django 1.8.11 Uninstalling Django-1.8.11: Successfully uninstalled Django-1.8.11 ... Successfully installed Django-1.10.6 Markdown-2.6.8 django-debug-toolbar-1.6 django-rest-swagger-0.3.10 django-tables2-1.4.1 natsort-5.0.2 psycopg2-2.7 py-gfm-0.1.3 sqlparse-0.2.2 ``` Software combination is as below: CentOS Linux release 7.2.1511 (Core) Python 2.7.5 Django 1.10.6 Netbox 1.8.4 Have tried cloning from the Git repo (master branch) and downloading zip archive, both do not appear to be working, error as below: ``` [root@server netbox]# ./manage.py runserver 0.0.0.0:8000 --insecure Performing system checks... System check identified no issues (0 silenced). March 02, 2017 - 00:53:31 Django version 1.10.6, using settings 'netbox.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. Traceback (most recent call last): File "/usr/lib64/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__ response = self.get_response(request) File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response response = self._middleware_chain(request) File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 44, in inner response = response_for_exception(request, exc) File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 94, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 143, in handle_uncaught_exception return callback(request, **param_dict) File "/opt/netbox/netbox/views.py", line 58, in handle_500 }, status=500) File "/usr/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 49, in render context_instance = RequestContext(request, current_app=current_app) TypeError: __init__() got an unexpected keyword argument 'current_app' [02/Mar/2017 00:53:34] "GET /login/ HTTP/1.1" 500 59 ``` However, if I downgrade Django to 1.9 (as test server ouput on the install docs shows 1.9.7) as below: ``` [root@server netbox]# pip install django==1.9 Collecting django==1.9 Downloading Django-1.9-py2.py3-none-any.whl (6.6MB) 100% |████████████████████████████████| 6.6MB 170kB/s Installing collected packages: django Found existing installation: Django 1.10.6 Uninstalling Django-1.10.6: Successfully uninstalled Django-1.10.6 Successfully installed django-1.9 ``` Then it seems to work without issues: ``` [root@server netbox]# ./manage.py runserver 0.0.0.0:8000 --insecure Performing system checks... System check identified no issues (0 silenced). March 02, 2017 - 00:55:08 Django version 1.9, using settings 'netbox.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. [02/Mar/2017 00:55:11] "GET /login/ HTTP/1.1" 200 11737 ```
adam closed this issue 2025-12-29 16:25:19 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 2, 2017):

GitHub issues are intended for bug reports and feature requests only. If you'd like assistance with installing NetBox, please post to the mailing list. Thanks!

@jeremystretch commented on GitHub (Mar 2, 2017): GitHub issues are intended for bug reports and feature requests only. If you'd like assistance with installing NetBox, please post to the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss). Thanks!
Author
Owner

@glennake commented on GitHub (Mar 2, 2017):

I raised as it appears to be an issue with netbox and Django 1.10, which is what pip installs with the requirements.txt.

@glennake commented on GitHub (Mar 2, 2017): I raised as it appears to be an issue with netbox and Django 1.10, which is what pip installs with the requirements.txt.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#737