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

  • SEARCH
  • Home
  • 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 9212003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:25:35+00:00 2026-06-18T01:25:35+00:00

I have a strange error using the built in webserver in Django (haven’t tested

  • 0

I have a strange error using the built in webserver in Django (haven’t tested against Apache as I’m in active development). I have a url pattern that works for short url parameters (e.g. Chalk%20Hill), but locks up python on this one

http://localhost:8000/chargeback/checkDuplicateProject/Bexar%20Street%20Phase%20IV%20Brigham%20Ln%20to%20Myrtle%20St

The get request just says pending, and never returns, and I have to force quit python to get the server to function again. What am I doing wrong?

EDIT:
In continuing testing, it’s strange, if I just enter the url, it returns the correct json response. Then it locks python. While I’m in the website, though, it never returns, and locks python.

urls:

url(r'^chargeback/checkDuplicateProject/(?P<aProjectName>(\w+)((\s)?(-)?(\w+)?)*)/$', 'chargeback.views.isProjectDuplicate'),

views:

def isProjectDuplicate(request, aProjectName):
    #count the number of matching project names
    p = Project.objects.filter(projectName__exact = aProjectName).count()

    #if > 0, the project is a duplicate
    if p > 0:
        return HttpResponse('{"results":["Duplicate"]}', mimetype='application/json')
    else:
        return HttpResponse('{"results":["Not Duplicate"]}', mimetype='application/json')

Model:

class Project(models.Model):
    projectName = models.TextField('project name')
    department = models.ForeignKey('Department')

    def __unicode__(self):
        return self.projectName
  • 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-06-18T01:25:36+00:00Added an answer on June 18, 2026 at 1:25 am

    Since you are going to check whether aProjectName already exists in the database, there’s no need for you to make the regex so complicated.

    I suggest you simplify the regex to

    url(r'^chargeback/checkDuplicateProject/(?P<aProjectName>[\w+\s-]*)/$', 'chargeback.views.isProjectDuplicate'),
    

    For a further explanation, see the question url regex keeps django busy/crashing on the django-users group.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a strange error using jQuery 1.3.2 and Firefox. I have created
I have just started getting a very strange error when using jQueryMobile for my
I have found here on stackoverflow a method to extend django's built-in authentication using
I have a strange multiple definitions error in my project. I'm using the #ifndef
I have a website that I built using Django. Using the settings.py file, I
I have a very strange error using NSMutableArray in cocos2d/xcode In my code, I
I have strange error and not sure how to tackle it without wasting too
I have a strange error where my jquery ajax request doesn't submit all the
I have this strange error, When I call $element_attrs = $element -> attributes(); I
I have come across a strange error. I have an Android project that uses

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.