Hi folks,
After some big frustration I did it! I converted my django app to an "exe" one to run as a single standalone app on windows (using cherrypy as a WSGI server)
But When I try to to set py2exe's option "bundle_files" to "1" (i.e. bundle the python interpreter Python25.dll inside the generated exe) the generated exe crashes with a...
I am trying to write a set of template tags that allow you to easily specify js and css files from within the template files themselves. Something along the lines of {% requires global.css %}, and later in the request, {% get_required_css %}.
I have this mostly working, but there are a couple of issues. We'll start with the 'timing' i...
I get an error message on this query
query = "select count(*) from pgns_game where raw_moves = %s"
params = ('a',)
total_rows = self.model.objects.raw(query, params)
and it says
InvalidQuery('Raw query must include the primary key')
I am clearly missing something but I don't know what. Any ideas?
...
Does django-reversion work well with south migrations?
Are django-reversion and south compatible?
Current versions:
- reversion - 1.2.1
- south - 0.7.1
...
Hi all,
This is my very first post on this awesome site, from which I have been finding answers to a handful of challenging questions. Kudos to the community!
I am new to the Django world, so am hoping to find help from some Django experts here. Thanks in advance.
Item model:
class Item(models.Model):
name = models.CharField(ma...
I have the following code in the urls.py in mysite project.
/mysite/urls.py
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^gallery/$', include('mysite.gallery.urls')),
)
This results in a 404 page when I try to access a url set in gallery/urls.py.
/mysite/gallery/urls.py
from django.conf.urls.defaults im...
So my site basically has 2 kinds of ways to login, one of them is for the common users, who get the regular screen that asks them for username and password, the other way its for staff.
The staff login should redirect them to the admin site after logging in, but for some reason the redirect doesnt happen, it stays on the same login page...
Drupal propose completely different approach in web development (comparing with RoR like frameworks) and it is extremely good from development speed perspective. For example, it is quite easy to clone 90% of stackoverflow functionality using Drupal. But it has several big drawbacks:
it is f''cking slow (100-400 requests per page)
db st...
Good afternoon! There are three essences. Product, Option and ProductOption. Product has link many to many to Option through ProductOption. Prompt how to create please for Product'a the form of addition/editing with these options (not on administration page)?
If simply to output {{product.options}} - will be SelectBox with a plural choi...
i am trying to build a virtual comunity, and i have a profile page, and a personal page. In the profile page, one can see only the posts of one user(the user whos profile is checked), in the personal page one can see his posts, plus all the posts he has subscribed to (just like in Facebook)
it's a little confusing for me how i can link ...
Hi,
I want to use django's admin filter on the list page.
The models I have are something like this:
class Location(model):
name = CharField()
class Inquiry(Model):
name = CharFiled()
location = ManyToManyField(Location)
Now I want to filter Inquiries, to display only those that contain relation to specific Location object. ...
Say there are navigations, nav1, nav2, nav3 and many subnavs within each of them.
For the css effect, you need to apply class=current to the currently selected navs.
What is the dry way to do that.
For the subnavs, you can check to see if request.get_full_path is the same as the url that subnav refers to, in the base template.
How ca...
I'm teaching myself Django and creating a personal portfolio site. I've setup a model called FolioItem which makes use of a Many-To-Many relation to another model called FolioImage. The idea being each FolioItem can have numerous FolioImages.
class FolioImage(models.Model):
image = models.FileField(upload_to='portfolio_images')
...
I feel like I'm missing something obvious here. I have a Django form with a TimeField on it. I want to be able to allow times like "10:30AM", but I cannot get it to accept that input format or to use the "%P" format (which has a note attached saying it's a "Proprietary extension", but doesn't say where it comes from). Here's the gist of ...
Hi,
if I have two simple models:
class Tag(models.Model):
name = models.CharField(max_length=100)
class Post(models.Model):
title = models.CharField(max_length=100)
tags = models.ManyToManyField(Tag, blank=True)
given a Post object with a number of Tags added to it, I know hot to remove any of them, but how to do a mass ...
I'm working on my first real Django project after years of PHP programming, and I am running into a problem with my models. First, I noticed that I was copying and pasting code between the models, and being a diligent OO programmer I decided to make a parent class that the other models could inherit from:
class Common(model.Model):
...
I have a Django form that is working fine. I'd like to save the data it submits to a CSV file. Is there a "best practice" way to do this?
I need to include blank fields in the CSV file where the user has not filled in a "required=False" field
...
I have django application, running under lighttpd via fastcgi. FCGI running script looks like:
python manage.py runfcgi socket=<path>/main.socket
method=prefork \
pidfile=<path>/server.pid \ ...
after I saved one item using MyModelClass.save() method of django in one view/page , at another view I use MyModelClass.objects.all() to list all items in MyModelClass but the newly added one always is missing at the new page. i am using django 1.1
i am using mysql
middleware setting
MIDDLEWARE_CLASSES = (
'django.middleware.common...
In Django, I have a model object in a list.
[object, object, object]
Each object has ".name" which is the title of the thing.
How do I sort alphabetically by this title?
This doesn't work:
catlist.sort(key=lambda x.name: x.name.lower())
...