Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy would Django get request with long url lock python?
    primarykey
    data
    text
    <p>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</p> <pre><code>http://localhost:8000/chargeback/checkDuplicateProject/Bexar%20Street%20Phase%20IV%20Brigham%20Ln%20to%20Myrtle%20St </code></pre> <p>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?</p> <p>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.</p> <p>urls:</p> <pre><code>url(r'^chargeback/checkDuplicateProject/(?P&lt;aProjectName&gt;(\w+)((\s)?(-)?(\w+)?)*)/$', 'chargeback.views.isProjectDuplicate'), </code></pre> <p>views:</p> <pre><code>def isProjectDuplicate(request, aProjectName): #count the number of matching project names p = Project.objects.filter(projectName__exact = aProjectName).count() #if &gt; 0, the project is a duplicate if p &gt; 0: return HttpResponse('{"results":["Duplicate"]}', mimetype='application/json') else: return HttpResponse('{"results":["Not Duplicate"]}', mimetype='application/json') </code></pre> <p>Model:</p> <pre><code>class Project(models.Model): projectName = models.TextField('project name') department = models.ForeignKey('Department') def __unicode__(self): return self.projectName </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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