The symptoms:
Could not import tinycomm.views. Error was: No module named models
The line of code:
from tinycomm.models import *
Project structure:
/tinycomms
/tinycomm
models.py
views.py
etc.
/other apps.
On Mac OS X in development I can fix this by putting tinycomms.tinycomm.models and then another similar ...
I am about to embark a major django project. If I install the latest stable release... is the a suggested setup ie. this OS, this RDBMS, this version of python etc?? I'm normally a CentOS man but their repos don't play too well with the django requirements...
...
Hi there.
Just a dumb question...
Is there any way you can create an image, say png, with the content of an html page, with a simple click of a button?
Thanks to anyone who cares to answers.
...
I need to filter database by default every time that I see it (when I save changes or when I open database first time).
Can anybody tell me how to do it?
...
Hello,
I'm trying to store Django data on MS SQL Server 2005 using:
http://code.google.com/p/django-pyodbc/
(pyodbc + FreeTDS)
As long as I'm storing string consist of ASCII characters everything is ok.
When I'm using unicode (ex. '\xc5\x82'), django throws ProgrammingError on:
ProgrammingError at /admin/cli/punktrejestracji/add/
('4...
Hi,
I'd like to know how I can change the blank value of ForeignKey in admin site's forms. There blank is showed as "-----". I wanna replace it by a word.
Does someone know how to do it?
...
Hi, I know how to build filters and Q objects in django, but I don't know how to negate the operators that the API provides, for example for the contains operator I would like something like notcontains.
e.g.
q=Q(name__notcontains="SomeString")
This would get me all objects whose name do not contain "SomeString".
Is there some synt...
Django's website seems good but for some reason I couldn't find where to download the documentation:
http://docs.djangoproject.com/en/1.1/
(Yes, I need the docs for 1.1)
Does anyone know?
...
how do I know if a remote user is connected in django?, like gmail chat, or facebook chat... I need that in the templates system. Sorry for my english
...
Am I doing this right? (probably not...someone correct? thanks)
@register.filter('addslashes')
@stringfilter
def addslashes(text, arg):
return text.replace('\'','\\'')
{{ query|addslashes }}
...
{% if is_loggedin OR is_anonymous %}
test message
{% endif %}
...
I have a Django model for a sweater and want to be able to enter the composition of materials used in the admin panel (say: "100% wool" or "50% wool, 50% cotton" or "50% wool, 45% cotton, 5% acryl").
I have this model:
class Sweater(models.Model):
wool = models.IntegerField(max_length=3, default=100, verbose_name="wool (%)"...
Hello All,
Disclaimer:
I'm very new to Django. I must say that so far I really like it. :)
(now for the "but"...)
But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions error when trying to create th...
Hi,
how do you prepare i18n in your websites? I mean what do you do avoid the situation when you search for i18ned websites in Polish you get English description cause English is the default one.
Thanks in advance,
Etam.
...
Hello guys,
I'm using the i18n feature of Django. I have noticed that even though I have translated everything on django.po and compiled it to django.mo, some parts of my website are always appearing in english instead of the selected language (portuguese). For example:
I have a page with these fields:
Tag
Name
Matches Played
Created...
How do I internationalize my Django website into other languages like Spanish from English?
...
I have a category tree, with Items entry related to the category. So this is my model file:
from django.db import models
import mptt
class Category(models.Model):
nombre=models.CharField(max_length=70)
padre=models.ForeignKey('self', blank=True, null=True)
def __unicode__(self):
return self.nombre
class Meta:
ordering = ['tre...
Hi, I am using Django PyFacebook Middleware to allow users to connect.
def index(request):
FBGRABLIST = ['name', 'pic','uid','first_name','last_name', 'email']
fbdata = []
if request.facebook.check_session(request):
fbdata = request.facebook.users.getInfo(request.facebook.uid, FBGRABLIST)[0]
print fbd...
I'd like to know how can I add .error class to input elements (to registration app) when the form validation fails.
...
Let's say I have a view:
def pony_view(request, arg1, arg2):
... Make ponies, etc ...
And a middleware:
class MyMiddleware(object):
def process_request(request):
# How do I access arg1, arg2 here?
Of course arg1, and arg2 will be passed in via URL params with urls.py.
The reason I need to do this is because I want ...