Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1024281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:45:22+00:00 2026-05-16T11:45:22+00:00

I’ve been trying to add the django-lean app to my project. The django-lean app

  • 0

I’ve been trying to add the django-lean app to my project.
The django-lean app is not located in the project I’m working on, it is on the PYTHONPATH.

I have not been able to get the django-lean tests to pass.

It seems the issue is that the TestCase defines a value for urls:

 urls = 'django_lean.experiments.tests.urls'

As best as I can tell, the tests are only getting the urls located @ ‘django_lean.experiments.tests.urls’, but not
the urls from the rest of the project.

This is causing error messages like:

NoReverseMatch: Reverse for 'index' with arguments '()' and keyword arguments '{}' not found.

These are triggered by {% url %} template tags in the project.

How can I make sure that the all the urls of the project are available for the tests?

EDIT:
Someone showed me a script to print the visible URLs:

import urls

def show_urls(urllist, depth=0):
  for entry in urllist:
    print "  " * depth, entry.regex.pattern
    if hasattr(entry, 'url_patterns'):
        show_urls(entry.url_patterns, depth + 1)

I called this script from ipdb, this was the output:

   ipdb> import urls
   ipdb> show_urls(urls.urlpatterns)
    ^test-experiment/(?P<experiment_name>.*)$
    ^test-clientsideexperiment/(?P<experiment_name>.*)$
    ^admin/
      ^(?P<experiment_name>.+)/$
      ^$
    ^main-app/
      ^goal/(?P<goal_name>.*)$
      ^confirm_human/$

This corresponds to the urls located @ ‘django_lean.experiments.tests.urls’

urlpatterns = patterns('django_lean.experiments.tests.views',
  url(r'^test-experiment/(?P<experiment_name>.*)$', 'experiment_test'),
  url(r'^test-clientsideexperiment/(?P<experiment_name>.*)$', 'clientsideexperiment_test'))

urlpatterns += patterns('',
   url(r'^admin/', include('django_lean.experiments.admin_urls')),
   url(r'^main-app/', include('django_lean.experiments.urls')),

The issue that I’m having is that my tests all fail because of the named urls from other apps in the project are called by URL template tags are not accessible to the tests.

I’m running Python 2.7 with Django 1.2.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:45:22+00:00Added an answer on May 16, 2026 at 11:45 am

    The solution was pretty simple. Just import the URLs from the main project into the urls.py for the app.

    from forum.urls import urlpatterns
    

    or for a more generic solution:

    from settings import ROOT_URLCONF as project_urls
    urlpatterns = __import__('forum.urls').urls.urlpatterns
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.