django

App Engine Authentication Error

I have an app hosted by google app engine, and I am having trouble with authentication. When I login using my admin account and try to access the admin page or members pages, I just get a blank screen. I can login, and the members only menu shows when I login, but I just can't see any data from the members pages. I'm not really sure ...

Django-based skill implementation

I'm working on a RPG using django and am considering different options for implementing part of the skill system. Say I have a base skill class ie, something like: class Skill (models.Model): name = models.CharField() cost = models.PositiveIntegerField() blah blah blah What would be some approaches to implementing s...

How to get restructuredText to add a class to every html <p> tag?

Hey all, I'm using Django's markup package to transform restructuredText into html. Is there a way to customize the HTML writer to add a class attribute to each <p> tag? I could use the class directive for each paragraph, but I'd like to automate this process. For example, I want this restructured text: hello ===== A paragraph of t...

Is Pinax alive?

I've seen Pinax in the past and I'd like to use it today. It's on version 0.7. I wonder know if it's still in development. ...

Django m2m and saving objects

I have a couple of simple objects that have a many-to-many relationship. Django has joined them using obj1_obj2 table and it looks like this in mysql; id | person_id | nationality_id ----------------------------------- 1 | 1 | 1 2 | 1 | 2 Now when I save obj1 (which shows obj2 in as Multi-...

How to filter/exclude inactive comments from my annotated Django query?

I'm using the object_list generic view to quickly list a set of Articles. Each Article has comments attached to it. The query uses an annotation to Count() the number of comments and then order_by() that annotated number. 'queryset': Article.objects.annotate(comment_count=Count('comments')).order_by('-comment_count'), The comments a...

How to disable email activation in django-registration app?

Please help me. Thanks! ...

Is there a way DJANGO to create a specific Form instance ?

I have a form with a ModelMultipleChoiceField() field. The form is used to send a message to user's friends. That means that instead of a generic queryset (e.g. Friends.objects.all()) I want to put something like queryset = user.friends.all(). Is this possible? ...

Django HttpResponsePermanentRedirect don't process my view

If I put this in my view: if slug == 'old-path': return HttpResponsePermanentRedirect('new-path') it skips my slugbased view and returns 404. How do I easily return 301 and "reprocess" my view so I don't get a 404? EDIT @Pydev UAs comment was the correct answer in this case, but I appreciated the detailed answer by John Debs, w...

Django deprecated tags / Beginner

The senior developer (and the only person experienced with Django in our company) has moved away and left us. Shortly after this (following his instructions) we pushed a site live onto a shared server (we have full control over the server) and updated the version of Django to the latest release for the new site to work. Since then we ha...

How to enforce account based separation in Django

I have a Django app which has a single-account model. We are converting this to be multi-account, so almost every model will have a ForeignKey(Account). What is the easiest way to make sure that each Account (each account is in its own subdomain) can only access its own data? We have a middleware that populates the subdomain, and the cu...

Registered models do not show up in admin

I added a model to admin via admin.site.register, and it does not show up in admin. Sice admin is so "It just works", I have no idea of how to debug this. POinters? ...

Python split value of a string

Hello, I am working on a site in Python built on the back of Django(awesome framework, cant get my head around python), I looking to split a string that is returned from a database and I want it to be split when the first space occurs so I tried something like this, {{product.name.split(' ' ,1)}} This did not work and I get this st...

Django Development server, found something in console like virus?

I was running Django Development server, and found same access message shown up again and again: [03/Dec/2009 21:02:30] "GET http://222.186.27.9/R.asp?P=58.50.245.72:8000 HTTP/1.1" 500 717 Traceback (most recent call last): File "d:\www\lib\django\django\core\servers\basehttp.py", line 279, in run self.result = application(self.envi...

Can you check the internet protocol from Django's template?

Right now, if I want to check whether the current page is accessed through http:// or https://, I will use the following Javascript in my templates and write html from document.write: <script type="text/javascript"> var protocol = document.location.protocol; if (protocol == "http:") document.write("regular"); else document.write...

How can I organize each scraped item into a csv row?

What is the best way to organize scraped data into a csv? More specifically each item is in this form url "firstName middleInitial, lastName - level - word1 word2 word3, &amp; wordN practice officeCity." JD, schoolName, date Example: http://www.examplefirm.com/jang "Joe E. Ang - partner - privatization mergers, media &amp; technology...

How to properly query a ManyToManyField for all the objects in a list (or another ManyToManyField)?

I'm rather stumped about the best way to build a Django query that checks if all the elements of a ManyToMany field (or a list) are present in another ManyToMany field. As an example, I have several Persons, who can have more than one Specialty. There are also Jobs that people can start, but they require one or more Specialties to be el...

Django name field: is it better to have the whole name in one field?

Hello, Is it better to have 3 fields in django model, "first", "initial" and "last" or is it better to have "name" and put first name, last name and initial in the "name" field? If I put all three in one "name" field can I still search for last names? I am asking because it will be easier to extract the "first, initial, last" from the ...

Reverse for '*' with arguments '()' and keyword arguments '{}' not found.

Caught an exception while rendering: Reverse for 'products.views.'filter_by_led' with arguments '()' and keyword arguments '{}' not found. I was able to successfully import products.views.filter_by_led from the shell and it worked so the path should be correct. Here is the urls.py: (r'^led-tv/$', filter_by_led ), This is where...

Timer object in Django

Hi, I'm using Django to create registration/payment application for a limited number of products. I want to create a timer so that when a user chooses to purchase a product, that product will then displayed as "already taken". But, if the user the user does not go through with the purchase and the timer runs out, the product goes ba...