Filter not visible via nginx+uwsgi #248

Closed
opened 2025-12-29 16:20:05 +01:00 by adam · 11 comments
Owner

Originally created by @Farataa on GitHub (Jul 19, 2016).

  1. netbox $ ./manage.py runserver 0.0.0.0:8000 --insecure
    Tried http://netbox:8000/ipam/prefixes/ and seen Filter
  2. netbox $ ./manage.py runserver 0.0.0.0:8000 --insecure
    nginx:
server {
    listen 80;
    server_name netbox;

    access_log /var/log/nginx/netbox.access_log main;
    error_log /var/log/nginx/netbox.error_log info;


    location /static/ {
        alias /var/www/localhost/netbox/netbox/static/;
    }

    location / {
        proxy_pass http://127.0.0.1:8000/;
    }
}

Tried http://netbox/ipam/prefixes/ and seen Filter
3. /usr/bin/uwsgi --master --daemonize /var/log/uwsgi-netbox.log --ini /etc/uwsgi.d/netbox.ini --enable-threads --processes 1 --pidfile /run/uwsgi_netbox/netbox.pid
ini file:

[uwsgi] 
    chdir = /var/www/localhost/netbox/netbox/
    pythonpath = /var/www/localhost/netbox/netbox/
    pythonpath = /usr/lib64/python2.7/plat-linux2
    pythonpath = /usr/lib64/python2.7/lib-dynload
    pythonpath = /usr/lib64/python2.7/site-packages
    pythonpath = /usr/lib64/python2.7
    pythonpath = /usr/lib64/python2.7/site-packages/IPython/extensions
    module = netbox.wsgi:application
    home = /var/www/localhost/netbox/
    env = DJANGO_SETTINGS_MODULE=netbox.settings
    vacuum = true
    master = true
    processes = 10
    pidfile = /tmp/netbox.pid
    socket = /tmp/netbox.sock
    chmod-socket = 666
    gid = netbox
    uid = netbox
    plugins = python27

nginx:

upstream netbox {
    server unix:/tmp/netbox.sock;
}

server {
    listen 80;
    server_name netbox;

    access_log /var/log/nginx/netbox.access_log main;
    error_log /var/log/nginx/netbox.error_log info;


    location /static/ {
        alias /var/www/localhost/netbox/netbox/static/;
    }

    location / {
        uwsgi_pass netbox;
        include     uwsgi_params;
    }
}

Filter block is invisible on every page where presented on 1. or 2. Logs without errors. Other parts of site works fine.

Originally created by @Farataa on GitHub (Jul 19, 2016). 1. `netbox $ ./manage.py runserver 0.0.0.0:8000 --insecure` Tried http://netbox:8000/ipam/prefixes/ and seen Filter 2. `netbox $ ./manage.py runserver 0.0.0.0:8000 --insecure` nginx: ``` conf server { listen 80; server_name netbox; access_log /var/log/nginx/netbox.access_log main; error_log /var/log/nginx/netbox.error_log info; location /static/ { alias /var/www/localhost/netbox/netbox/static/; } location / { proxy_pass http://127.0.0.1:8000/; } } ``` Tried http://netbox/ipam/prefixes/ and seen Filter 3. `/usr/bin/uwsgi --master --daemonize /var/log/uwsgi-netbox.log --ini /etc/uwsgi.d/netbox.ini --enable-threads --processes 1 --pidfile /run/uwsgi_netbox/netbox.pid` ini file: ``` ini [uwsgi] chdir = /var/www/localhost/netbox/netbox/ pythonpath = /var/www/localhost/netbox/netbox/ pythonpath = /usr/lib64/python2.7/plat-linux2 pythonpath = /usr/lib64/python2.7/lib-dynload pythonpath = /usr/lib64/python2.7/site-packages pythonpath = /usr/lib64/python2.7 pythonpath = /usr/lib64/python2.7/site-packages/IPython/extensions module = netbox.wsgi:application home = /var/www/localhost/netbox/ env = DJANGO_SETTINGS_MODULE=netbox.settings vacuum = true master = true processes = 10 pidfile = /tmp/netbox.pid socket = /tmp/netbox.sock chmod-socket = 666 gid = netbox uid = netbox plugins = python27 ``` nginx: ``` upstream netbox { server unix:/tmp/netbox.sock; } server { listen 80; server_name netbox; access_log /var/log/nginx/netbox.access_log main; error_log /var/log/nginx/netbox.error_log info; location /static/ { alias /var/www/localhost/netbox/netbox/static/; } location / { uwsgi_pass netbox; include uwsgi_params; } } ``` Filter block is invisible on every page where presented on 1. or 2. Logs without errors. Other parts of site works fine.
adam closed this issue 2025-12-29 16:20:05 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 19, 2016):

Sorry, it's not clear what you mean by "filter block." Could you perhaps provide a screenshot?

@jeremystretch commented on GitHub (Jul 19, 2016): Sorry, it's not clear what you mean by "filter block." Could you perhaps provide a screenshot?
Author
Owner

@Farataa commented on GitHub (Jul 19, 2016):

no filter block
with filter block

@Farataa commented on GitHub (Jul 19, 2016): ![no filter block](https://cloud.githubusercontent.com/assets/10272761/16963537/f7ea9590-4e07-11e6-8389-50d5a25213d7.png) ![with filter block](https://cloud.githubusercontent.com/assets/10272761/16963538/f817ae72-4e07-11e6-9aaf-ae3a6363da15.png)
Author
Owner

@Farataa commented on GitHub (Jul 19, 2016):

Netbox versions: 1.2.2 / 1.3.0
Used browsers: Firefox / Opera

@Farataa commented on GitHub (Jul 19, 2016): Netbox versions: 1.2.2 / 1.3.0 Used browsers: Firefox / Opera
Author
Owner

@jeremystretch commented on GitHub (Jul 20, 2016):

That's very strange. The filter panel is simply an included template, and I can't think of anything that would prevent it from appearing. Can you post the contents of netbox/templates/inc/filter_panel.html please?

@jeremystretch commented on GitHub (Jul 20, 2016): That's very strange. The filter panel is simply an included template, and I can't think of anything that would prevent it from appearing. Can you post the contents of `netbox/templates/inc/filter_panel.html` please?
Author
Owner

@bellwood commented on GitHub (Jul 20, 2016):

It looks like your export button is visible which is included in the same fashion as the filter panel.

Maybe an issue inside form_helpers? It appears it wants a "widget_type" passed:

@register.filter(name='widget_type')
def widget_type(field):
    """
    Return the widget type
    """
    try:
        return field.field.widget.__class__.__name__.lower()
    except AttributeError:
        return None

...and calling the filter:

{% include 'inc/filter_panel.html' %}

...passes no type where as, say the export button passes:

{% include 'inc/export_button.html' with obj_type='VLANs' %}

...which renders (albeit a different include)

I'm likely way off base here

@bellwood commented on GitHub (Jul 20, 2016): It looks like your export button is visible which is included in the same fashion as the filter panel. Maybe an issue inside form_helpers? It appears it wants a "widget_type" passed: ``` @register.filter(name='widget_type') def widget_type(field): """ Return the widget type """ try: return field.field.widget.__class__.__name__.lower() except AttributeError: return None ``` ...and calling the filter: ``` {% include 'inc/filter_panel.html' %} ``` ...passes no type where as, say the export button passes: ``` {% include 'inc/export_button.html' with obj_type='VLANs' %} ``` ...which renders (albeit a different include) I'm likely way off base here
Author
Owner

@jeremystretch commented on GitHub (Jul 20, 2016):

I don't think that's relevant. widget_type is a template filter, called like {% field|widget_type %} (the variable it's applied to serves as the argument).

@jeremystretch commented on GitHub (Jul 20, 2016): I don't think that's relevant. `widget_type` is a template filter, called like `{% field|widget_type %}` (the variable it's applied to serves as the argument).
Author
Owner

@bellwood commented on GitHub (Jul 20, 2016):

Gotcha, the return none on no name made me think that might be why it's silently excluding the panel.

Being that other includes are working, e.g the export button I'm a bit befuddled.

@Farataa can you do the following:

-set DEBUG = True in configuration.py and then restart netbox

-load up /ipam/prefixes/ in your browser

-expand the debug pane from the top right of the page and choose"templates" from it then scroll to the bottom of the page.

Right above the text "context processors" you should see:

inc/filter_panel.html
/opt/netbox/netbox/templates/inc/filter_panel.html
▶ Toggle context

Can you click "toggle content" and then past the content to this issue?

@bellwood commented on GitHub (Jul 20, 2016): Gotcha, the return none on no name made me think that might be why it's silently excluding the panel. Being that other includes are working, e.g the export button I'm a bit befuddled. @Farataa can you do the following: -set `DEBUG = True` in `configuration.py` and then restart netbox -load up `/ipam/prefixes/` in your browser -expand the debug pane from the top right of the page and choose"templates" from it then scroll to the bottom of the page. Right above the text "context processors" you should see: ``` inc/filter_panel.html /opt/netbox/netbox/templates/inc/filter_panel.html ▶ Toggle context ``` Can you click "toggle content" and then past the content to this issue?
Author
Owner

@Farataa commented on GitHub (Jul 21, 2016):

In debug mode I cannot to find templates and 'toggle content' because got errors.

Trace:

UnicodeEncodeError at /ipam/prefixes/

'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)

Request Method:     GET
Request URL:    http://netbox/ipam/prefixes/
Django Version:     1.9.7
Exception Type:     UnicodeEncodeError
Exception Value:    

'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)

Exception Location:     /var/www/localhost/netbox/netbox/ipam/forms.py in prefix_site_choices, line 269
Python Executable:  /usr/bin/uwsgi
Python Version:     2.7.10
Python Path:    

['/usr/lib64/python2.7/site-packages/IPython/extensions/',
 '/usr/lib64/python2.7/',
 '/usr/lib64/python2.7/site-packages/',
 '/usr/lib64/python2.7/lib-dynload/',
 '/usr/lib64/python2.7/plat-linux2/',
 '/var/www/localhost/netbox/netbox/',
 '.',
 '',
 '/var/www/localhost/netbox/lib64/python27.zip',
 '/var/www/localhost/netbox/lib64/python2.7',
 '/var/www/localhost/netbox/lib64/python2.7/plat-linux2',
 '/var/www/localhost/netbox/lib64/python2.7/lib-tk',
 '/var/www/localhost/netbox/lib64/python2.7/lib-old',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/var/www/localhost/netbox/lib/python2.7/site-packages']

Server time:    Thu, 21 Jul 2016 11:25:09 +0300

Traceback:

Environment:


Request Method: GET
Request URL: http://netbox/ipam/prefixes/

Django Version: 1.9.7
Python Version: 2.7.10
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'debug_toolbar',
 'django_tables2',
 'rest_framework',
 'rest_framework_swagger',
 'circuits',
 'dcim',
 'ipam',
 'extras',
 'secrets',
 'users',
 'utilities')
Installed Middleware:
(u'debug_toolbar.middleware.DebugToolbarMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'utilities.middleware.LoginRequiredMiddleware')


Template error:
In template /var/www/localhost/netbox/netbox/templates/ipam/prefix_list.html, error at line 23
   ascii   13 :         </a>
   14 :         <a href="{% url 'ipam:prefix_import' %}" class="btn btn-info">
   15 :             <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
   16 :             Import prefixes
   17 :         </a>
   18 :     {% endif %}
   19 :     {% include 'inc/export_button.html' with obj_type='prefixes' %}
   20 : </div>
   21 : <h1>Prefixes</h1>
   22 : <div class="row">
   23 :     <div cl ass="col-md -9">
   24 :         {% include 'utilities/obj_table.html' with bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' %}
   25 :     </div>
   26 :     <div class="col-md-3">
   27 :         <div class="panel panel-default">
   28 :             <div class="panel-heading">
   29 :                 <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 
   30 :                 <strong>Search</strong>
   31 :             </div>
   32 :             <div class="panel-body">
   33 :                 <form action="{% url 'ipam:prefix_list' %}" method="get">


Traceback:

File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib64/python2.7/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/usr/lib64/python2.7/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/var/www/localhost/netbox/netbox/utilities/views.py" in get
  85.         return render(request, self.template_name, context)

File "/usr/lib64/python2.7/site-packages/django/shortcuts.py" in render
  67.             template_name, context, request=request, using=using)

File "/usr/lib64/python2.7/site-packages/django/template/loader.py" in render_to_string
  97.         return template.render(context, request)

File "/usr/lib64/python2.7/site-packages/django/template/backends/django.py" in render
  95.             return self.template.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  206.                     return self._render(context)

File "/usr/lib64/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
  92.     return self.nodelist.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  992.                 bit = node.render_annotated(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated
  959.             return self.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py" in render
  173.         return compiled_parent._render(context)

File "/usr/lib64/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
  92.     return self.nodelist.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  992.                 bit = node.render_annotated(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated
  959.             return self.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py" in render
  69.                 result = block.nodelist.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  992.                 bit = node.render_annotated(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated
  959.             return self.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py" in render
  209.                 return template.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  208.                 return self._render(context)

File "/usr/lib64/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
  92.     return self.nodelist.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  992.                 bit = node.render_annotated(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated
  959.             return self.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/defaulttags.py" in render
  220.                     nodelist.append(node.render_annotated(context))

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated
  959.             return self.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/defaulttags.py" in render
  326.                 return nodelist.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  992.                 bit = node.render_annotated(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated
  959.             return self.render(context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render
  1049.         return render_value_in_context(output, context)

File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_value_in_context
  1026.     value = force_text(value)

File "/usr/lib64/python2.7/site-packages/django/utils/encoding.py" in force_text
  78.                 s = six.text_type(s)

File "/usr/lib64/python2.7/site-packages/django/utils/html.py" in <lambda>
  381.         klass.__unicode__ = lambda self: mark_safe(klass_unicode(self))

File "/usr/lib64/python2.7/site-packages/django/forms/boundfield.py" in __str__
  43.         return self.as_widget()

File "/usr/lib64/python2.7/site-packages/django/forms/boundfield.py" in as_widget
  101.         return force_text(widget.render(name, self.value(), attrs=attrs))

File "/usr/lib64/python2.7/site-packages/django/forms/widgets.py" in render
  600.         options = self.render_options(choices, value)

File "/usr/lib64/python2.7/site-packages/django/forms/widgets.py" in render_options
  554.         for option_value, option_label in chain(self.choices, choices):

File "/usr/lib64/python2.7/site-packages/django/forms/fields.py" in __iter__
  786.         for e in self.choices_func():

File "/var/www/localhost/netbox/netbox/ipam/forms.py" in prefix_site_choices
  269.     return [(s.slug, '{} ({})'.format(s.name, s.prefix_count)) for s in site_choices]

Exception Type: UnicodeEncodeError at /ipam/prefixes/
Exception Value: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)
TEMPLATES   

[{'APP_DIRS': True,
  'BACKEND': 'django.template.backends.django.DjangoTemplates',
  'DIRS': ['/var/www/localhost/netbox/netbox/templates/'],
  'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
                                     'django.template.context_processors.request',
                                     'django.contrib.auth.context_processors.auth',
                                     'django.contrib.messages.context_processors.messages',
                                     'utilities.context_processors.settings']}}]

TEMPLATE_CONTEXT_PROCESSORS     

['django.contrib.auth.context_processors.auth',
 'django.template.context_processors.debug',
 'django.template.context_processors.i18n',
 'django.template.context_processors.media',
 'django.template.context_processors.static',
 'django.template.context_processors.tz',
 'django.contrib.messages.context_processors.messages']
@Farataa commented on GitHub (Jul 21, 2016): In debug mode I cannot to find templates and 'toggle content' because got errors. Trace: ``` UnicodeEncodeError at /ipam/prefixes/ 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128) Request Method: GET Request URL: http://netbox/ipam/prefixes/ Django Version: 1.9.7 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128) Exception Location: /var/www/localhost/netbox/netbox/ipam/forms.py in prefix_site_choices, line 269 Python Executable: /usr/bin/uwsgi Python Version: 2.7.10 Python Path: ['/usr/lib64/python2.7/site-packages/IPython/extensions/', '/usr/lib64/python2.7/', '/usr/lib64/python2.7/site-packages/', '/usr/lib64/python2.7/lib-dynload/', '/usr/lib64/python2.7/plat-linux2/', '/var/www/localhost/netbox/netbox/', '.', '', '/var/www/localhost/netbox/lib64/python27.zip', '/var/www/localhost/netbox/lib64/python2.7', '/var/www/localhost/netbox/lib64/python2.7/plat-linux2', '/var/www/localhost/netbox/lib64/python2.7/lib-tk', '/var/www/localhost/netbox/lib64/python2.7/lib-old', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/var/www/localhost/netbox/lib/python2.7/site-packages'] Server time: Thu, 21 Jul 2016 11:25:09 +0300 ``` Traceback: ``` Environment: Request Method: GET Request URL: http://netbox/ipam/prefixes/ Django Version: 1.9.7 Python Version: 2.7.10 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'debug_toolbar', 'django_tables2', 'rest_framework', 'rest_framework_swagger', 'circuits', 'dcim', 'ipam', 'extras', 'secrets', 'users', 'utilities') Installed Middleware: (u'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'utilities.middleware.LoginRequiredMiddleware') Template error: In template /var/www/localhost/netbox/netbox/templates/ipam/prefix_list.html, error at line 23 ascii 13 : </a> 14 : <a href="{% url 'ipam:prefix_import' %}" class="btn btn-info"> 15 : <span class="glyphicon glyphicon-import" aria-hidden="true"></span> 16 : Import prefixes 17 : </a> 18 : {% endif %} 19 : {% include 'inc/export_button.html' with obj_type='prefixes' %} 20 : </div> 21 : <h1>Prefixes</h1> 22 : <div class="row"> 23 : <div cl ass="col-md -9"> 24 : {% include 'utilities/obj_table.html' with bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' %} 25 : </div> 26 : <div class="col-md-3"> 27 : <div class="panel panel-default"> 28 : <div class="panel-heading"> 29 : <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 30 : <strong>Search</strong> 31 : </div> 32 : <div class="panel-body"> 33 : <form action="{% url 'ipam:prefix_list' %}" method="get"> Traceback: File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response 149. response = self.process_exception_by_middleware(e, request) File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response 147. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib64/python2.7/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/usr/lib64/python2.7/site-packages/django/views/generic/base.py" in dispatch 88. return handler(request, *args, **kwargs) File "/var/www/localhost/netbox/netbox/utilities/views.py" in get 85. return render(request, self.template_name, context) File "/usr/lib64/python2.7/site-packages/django/shortcuts.py" in render 67. template_name, context, request=request, using=using) File "/usr/lib64/python2.7/site-packages/django/template/loader.py" in render_to_string 97. return template.render(context, request) File "/usr/lib64/python2.7/site-packages/django/template/backends/django.py" in render 95. return self.template.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 206. return self._render(context) File "/usr/lib64/python2.7/site-packages/django/test/utils.py" in instrumented_test_render 92. return self.nodelist.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 992. bit = node.render_annotated(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated 959. return self.render(context) File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py" in render 173. return compiled_parent._render(context) File "/usr/lib64/python2.7/site-packages/django/test/utils.py" in instrumented_test_render 92. return self.nodelist.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 992. bit = node.render_annotated(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated 959. return self.render(context) File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py" in render 69. result = block.nodelist.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 992. bit = node.render_annotated(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated 959. return self.render(context) File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py" in render 209. return template.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 208. return self._render(context) File "/usr/lib64/python2.7/site-packages/django/test/utils.py" in instrumented_test_render 92. return self.nodelist.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 992. bit = node.render_annotated(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated 959. return self.render(context) File "/usr/lib64/python2.7/site-packages/django/template/defaulttags.py" in render 220. nodelist.append(node.render_annotated(context)) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated 959. return self.render(context) File "/usr/lib64/python2.7/site-packages/django/template/defaulttags.py" in render 326. return nodelist.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 992. bit = node.render_annotated(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_annotated 959. return self.render(context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render 1049. return render_value_in_context(output, context) File "/usr/lib64/python2.7/site-packages/django/template/base.py" in render_value_in_context 1026. value = force_text(value) File "/usr/lib64/python2.7/site-packages/django/utils/encoding.py" in force_text 78. s = six.text_type(s) File "/usr/lib64/python2.7/site-packages/django/utils/html.py" in <lambda> 381. klass.__unicode__ = lambda self: mark_safe(klass_unicode(self)) File "/usr/lib64/python2.7/site-packages/django/forms/boundfield.py" in __str__ 43. return self.as_widget() File "/usr/lib64/python2.7/site-packages/django/forms/boundfield.py" in as_widget 101. return force_text(widget.render(name, self.value(), attrs=attrs)) File "/usr/lib64/python2.7/site-packages/django/forms/widgets.py" in render 600. options = self.render_options(choices, value) File "/usr/lib64/python2.7/site-packages/django/forms/widgets.py" in render_options 554. for option_value, option_label in chain(self.choices, choices): File "/usr/lib64/python2.7/site-packages/django/forms/fields.py" in __iter__ 786. for e in self.choices_func(): File "/var/www/localhost/netbox/netbox/ipam/forms.py" in prefix_site_choices 269. return [(s.slug, '{} ({})'.format(s.name, s.prefix_count)) for s in site_choices] Exception Type: UnicodeEncodeError at /ipam/prefixes/ Exception Value: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128) ``` ``` TEMPLATES [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/var/www/localhost/netbox/netbox/templates/'], 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'utilities.context_processors.settings']}}] TEMPLATE_CONTEXT_PROCESSORS ['django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages'] ```
Author
Owner

@bellwood commented on GitHub (Jul 21, 2016):

Try changing:

<div cl ass="col-md -9">

...to:

<div class="col-md-9">

...in:

/var/www/localhost/netbox/netbox/templates/ipam/prefix_list.html

...on line 23.

It looks like you have some rogue spaces there in the "class" and "col-md-9"

@bellwood commented on GitHub (Jul 21, 2016): Try changing: `<div cl ass="col-md -9">` ...to: `<div class="col-md-9">` ...in: `/var/www/localhost/netbox/netbox/templates/ipam/prefix_list.html` ...on line 23. It looks like you have some rogue spaces there in the "class" and "col-md-9"
Author
Owner

@jeremystretch commented on GitHub (Jul 21, 2016):

The spaces that seem to appear there are probably an artifact from syntax highlighting in the debug report. This looks like yet another Unicode issue.

@Farataa I just pushed 8ee083f. Please try pulling down the latest copy of the develop branch (git pull origin develop) and restarting the service to see if it fixes the issue.

@jeremystretch commented on GitHub (Jul 21, 2016): The spaces that seem to appear there are probably an artifact from syntax highlighting in the debug report. This looks like yet another Unicode issue. @Farataa I just pushed 8ee083f. Please try pulling down the latest copy of the `develop` branch (`git pull origin develop`) and restarting the service to see if it fixes the issue.
Author
Owner

@Farataa commented on GitHub (Jul 21, 2016):

Yes issue was solved on developed branch. Thank you.

@Farataa commented on GitHub (Jul 21, 2016): Yes issue was solved on developed branch. Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#248