django-urls

A django problem that doesn't show up in runserver

In runserver, I can view my website no problems. (viewing it through lynx on the same machine) But when I view the same thing through apache, (passenger) I get an error like the following: Could not import PROJ.APP.views Error was: No module named PROJ.views It looks like a problem with the urlconf, but again that is the same between...

Working programmatically with an HTTPResponse in Django

I am working on an app which would enable a preview function for a model. Models marked as preview-able would allow for changes to be made in the Django admin interface and previewed on site using the same view as would an object of that type normally use to render itself, but rendered instead with the new (unsaved) object in it's place....

uwsgi / mod_wsgi handling pylons redirect_to & error pages

My stack is nginx > uwsgi > pylons. If I use redirect_to on a controller, the app throws a 302 error. Also I don't see any 404 or 500 error pages anymore that worked fine in paste. Any pointers would be greatly appreciated. Thanks. ...

Django sitemaps with no associated object (just a view)

Hi, I'm setting up some Django sitemaps. It works really well for all the objects I have, but I'm curious about how I should do it if I'd like to put something in the sitemap that has no object associated with it. For instance, I have a category listing, and I can just return a queryset of all categories. URLs would be example.com/cats...

Django Url Not Resolving with Query Parameters

I have an issue where I need to pass in query parameters for a GET request, but Django is not resolving the URL correctly to the view. My urls.py looks like this: from django.conf.urls.defaults import * urlpatterns = patterns('', url(r'^confirm_cancel', 'myapp.views.confirm_cancel_method', name='myapp...

Django: Applying permissions in the URL dispatcher?

In my Django application, I have certain permissions which users need in order to access certain views (using django.contrib.auth). This works fine, using the @permission_required decorator on my view functions. However, some of my URLs resolve to views which I did not write, such as the built-in django.contrib.auth.views.password_chan...

How to pass object_id to generic view object_detail in Django

I'm using django.views.generic.list_detail.object_detail. According to the documentation the view takes the variable object_id. To do this I added the following to my urlconf: (r'^(?P<object_id>\d+)$', list_detail.object_detail, article_info), The above line is in a separate urlconf that is included in the main urlconf. If I leave t...

Django cannot find url pattern in URLConf although it is defined

I type the following url in my browser: http://localhost:8000/en/weblog/2010/aug/10/wie-baue-ich-ein-weblog/ an I get a "Page Not Found (404)" error, although the 10th entry (r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-\w]+)/$', 'django.views.generic.date_based.object_detail', entry_info_dict), in my URLCon...

How can reverse('opensearch') work in the shell, but fails in a Test?

I'm trying to install django-lean into my application. Open search is used in my app App. I can reverse('opensearch') in the Python shell. However, in the test, reverse('opensearch') * NoReverseMatch: Reverse for 'opensearch' with arguments '()' and keyword arguments In [47]: reverse('opensearch') Out[47]: '/opensearch.xml' In [48]:...

Passing an array in django urls

Can we pass an array to a django url <script> function save() { window.location = "/display/xlsdisplay/" + objarr ; } var objarr = new Array(); </script> Urls.py (r'^xlsdisplay/(?P<qid>\d+)$', 'xlsdisplay'), There is an error saying http://192.168.1.11/display/xlsdispla...

How to add app to all pages in django?

I have an app called lastapp that I would like it to be viewable on all pages. It renders base.html so it's available on all apps. So far I've tried adding it to the urls.py like this: urlpatterns = patterns('', (r'^first/$', firstapp, lastapp), (r'^last/$', lastapp), ) But when I go to /first/ it gives me the error: Error,...

URL template tags fail in Test mode, but work in Dev and Production ( Django 1.2.1 )

I've been trying to add the django-lean app to my project. I have not been able to get the tests to pass. It took me a few days with a debugger to determine what the problem was. It seems that all the URL template tags fail in Test mode, but not in Production nor Developement. Failure happens in django.template.defaulttags.URLNode.ren...

Django Admin application no working on URL

Hi, In my urls file I have configured the django admin application to run off the url /adminDJ/. However it doesn't run. It loads up my own admin stuff. Here is my urls.py: (r'^admin/add/member/$', 'astonomyStuff.attendance.views.newMember'), (r'^admin/add/$', 'astonomyStuff.attendance.views.addPage'), (r'^admin/$', 'astonomyStuff....

Why are the Django project URLs not all available to the Django test client?

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...

Django chat App..

How to integrate http://ajaxim.com/ to a django module Small piece of code would be helpful ...

How to do reverse URL search in Django namespaced reusable application

Consider that I include namespaced reusable application: urlpatterns = patterns('', # ella urls url('^ella/', include('ella.core.urls', namespace="ella")), ) Now, the Ella applications has urls like that: urlpatterns = patterns( '', url( r'^(?P<category>[a-z0-9-/]+)/$', category_detail, name="category_detail" ), # obj...

HowTo Install the Django emailauth App into a New Project

Hello, I'm a Django newbie and am interesting in understanding how to install the EmailAuth app into my new project: http://github.com/redvasily/django-emailauth Seems like Django apps are meant to be plug in play so I must be missing something.... Here's what I tried. I created a new project copied the emailauth directory over Updat...

django permalink error

Hi all! I have a page with some years. I want to click over the year, for instance 2000, to see all the information. What I have in urls is this: url(r'^browse/time/(\d{4})/$', 'TBDBsite.tb.views.data_time', name="yr"), In models: @permalink def get_absolute_url(self): return('year', [str(self.date.year)]) And in the tem...

Locating django app resources

Hello all, tl:dr How would a hosted django app correctly transform resource paths to match any hosted location (/ or /test or /testtest)? Full Description Let me try to explain what I am trying to do. I am trying to write a somewhat re-usable django app which I intend to use from within multiple projects. This app is called systems...

Django failing to route url (simple question)

I'm doing something stupid, and I'm not sure what it is. I have a the following urls.py in the root of my django project: from django.conf.urls.defaults import * from django.conf import settings urlpatterns = patterns('', (r'^$', include('preview_signup.urls')), ) In my preview_signup module (django app) I have the following url...