Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango-experiments and Django 1.5: NoReverseMatch error
    text
    copied!<p>I've found a number of incompatibilities with Django 1.5 in django-experiments, nexus, and gargoyle. Fortunately, almost all of them have been fixed by quoting the first parameter to the "url" templatetag everywhere it occurred.</p> <p>I'm stuck against something I haven't been able to figure out -- I'm getting the following error when I go to my goal page:</p> <pre><code>NoReverseMatch at /trial/trial1/ Reverse for 'experiment_goal' with arguments '(u'clicktrynow',)' and keyword arguments '{}' not found. </code></pre> <p>I'm running Django 1.5.1 and Python 2.7.3 on runserver. I can also reproduce this in Python 2.7.4 on Heroku.</p> <p>My goal page (reaching this page is accomplishing the goal) has this line in it:</p> <pre><code>{% experiment_goal "clicktrynow" %} </code></pre> <p>The experiment_goal templatetag appears to automatically include the experiments/goal.html template at this point. experiments/goal.html contains:</p> <pre><code>&lt;img src="{% url 'experiment_goal' goal_name %}?v={{ random_number }}" height="1" width="1" /&gt; </code></pre> <p>(I've fixed quoting on 'experiment_goal'.)</p> <p>The urlpatterns for the django-experiments app contains this line:</p> <pre><code>url(r'^goal/(?P&lt;goal_name&gt;.*)$', 'record_experiment_goal', name="experiment_goal"), </code></pre> <p>Finally, my settings.py lines relevant to django-experiments are:</p> <pre><code>EXPERIMENTS_REDIS_HOST = get_env_variable('REDISTOGO_URL', default='redis://localhost:6379') EXPERIMENTS_REDIS_PORT = 6379 EXPERIMENTS_REDIS_DB = 0 INSTALLED_APPS += ('django.contrib.humanize', 'nexus', 'gargoyle', 'experiments', ) MIDDLEWARE_CLASSES += ('experiments.middleware.ExperimentsMiddleware', ) EXPERIMENTS_GOALS = ('clicktrynow', ) </code></pre> <p>I'm new to Django, but all of this seems like it should work. What am I missing?</p> <p>Update: My project's urls.py does not include a urls.py from django-experiments. Documentation doesn't say you need to. But perhaps I should. Investigating...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload