Hi all,
I'm doing some i18n on a web-based app using Django, which uses gettext as its i18n foundation. It seems like an obvious idea that translations should be stored in the database, and not difficult to do, but po files on the filesystem are still being used. Why is this?
My current suspicion is that the benefits of developing a d...
Hi all,
I need your advice on managing a Django application as it grows in terms of features and models.
For instance as a application grows, we often need to add in new features.
Adding new features involves adding new models, or adding a new field within a model.
How would you go about doing that without closing the web application...
I had to remove my Django Database (drop all the tables). Now when I try to run "manage.py syncdb" to recreate those tables I get the message "Table 'user_database.engine.city' doesn't exist"
Is there a file lingering that is telling djnago these tables still exist?
EDITED QUESTION:
I had to remove my Django Database (drop all the tab...
After uploading a file from the UI, how to create the a new directory with the current timestamp in /opt/files/ and copy the uploaded zip file to this directory, and unzip the zip file in the new directory and maintain the new directory name in a variable
def upload_info(request):
if request.method == 'POST':
fi...
class Machine(models.Model):
name= models.CharField( max_length=120)
class Meta:
abstract = True
class Car(Machine):
speed = models.IntegerField()
class Computer(Machine)
ram = models.IntegerField()
My question is, how can I understand what type is the Machine model. For instamce I know the incoming query is a...
Quite often the error reports coming via e-mail are less than useful in tracking bugs. Most often this is due to missing session data and username of the user triggering the error. Is there a project or a library I could use to get more complete error reports?
...
Hi, new to django, this might be a simple/obvious question, so I apologise in advance.
I have the following model
class Team(models.Model):
name = models.CharField(max_length=100)
members = models.ManyToManyField(User, related_name="members", blank=True, null=True)
And the following view (controller)
def my_teams(request):
...
For example, let's say there is a custom template tag
{% custom_tag "parameter" %}
This tag requires some serious database work to calculate.
Now I need to have something like that (pseudocode):
if {% custom_tag "parameter" %}
....
else
....
I know that with context variables I can do just:
{% with variable.x.y.z as v %}
{% i...
I've been tasked with setting up a society's website. I'm a full time Django (at al) web developer so I was happy to take on the task.
Going through the specs, they want to control memberships so that all applications need a "second" (read: sponsor, referee, etc) and then they need to pay a subscription fee to be part of the club.
Thi...
I have the following model
class Team(models.Model):
name = models.CharField(max_length=100)
members = models.ManyToManyField(User, related_name="members", blank=True, null=True)
And the following view (controller)
def my_teams(request):
my_list = Team.objects.filter(members=request.user).order_by('name')
return rende...
Trying to copy a Django model with ManyToManyField.
the model is
class Book(models.Model):
cats = models.ManyToManyField(Category)
the view:
for book in books:
book.name = "New Name"
messageinfo = message.save()
msg = Book(title=book.title, subject=book.subject)
msg.save()
sort of works till here, makes a co...
I'm trying to redirect users to custom url "/gallery/(username)/" after successfully logging in. It currently redirects to the default "/account/profile/" While I know what I can override the redirect url in my settings.py, my url is dynamic thus it will not work.
Documentation states that I need to use the "next" parameter and contex...
I'm about to create a site that has monitored registration in that only certain people are allowed to register. Undoubtedly some misfits will register despite any writing I put above the registration form so we're going with moderation.
Upon registration a django.contrib.auth User and profile will be created and an email will be sent to...
This is a follow-up to this question. How do I display properties defined on a child model in an inline on the parent? To illustrate, I have this model:
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True, primary_key=True, related_name='profile')
...
@property
def age(self):
if self.birth...
Hi,
Using the django admin application for a date it displays Today | CalendarSymbol. I am using a datefield in my form and I thought it would do this for me how would i go about doing this? As i would normally use the jquery datepicker plugin is this the way to go?
Thanks in Advance,
Dean
...
I have been having a problem where after my mongodb connection to mongohq via pymongo goes idle for awhile (no queries), it will timeout. This is fine, but the connection the database is only created when the Django app is started up. It seems like it is reconnecting fine, but it needs to reauthenticate then. When the connection has died...
ok so I have the following problem i`ve looked around but I cant find a solution ...
lets say I have the following forms.py
from django import forms
class LoginForm(forms.Form):
_username = forms.CharField()
_password = forms.CharField()
and in views.py I have
def index(request):
if request.method == 'POST':
fo...
What is the proper deployment configuration for a Django application that needs some pages served with HTTPS and others with HTTP?
I want to use HTTPS for the pages that involve registration and inputting passwords. I want to use HTTP for all other pages.
...
Hi folks,
is it possible to mark some fields/rows red in django admin interface if they achieve a expression?
For example, if there is a model "Group" with members and capacity, how can I visualize when they are full or crowded?
...
I have a python script that connects to an external host, fetches some data, and populates a Django database with the data. The python script that populates the database uses these lines to setup the django environment:
path = os.path.normpath(os.path.join(os.getcwd(), '..'))
sys.path.append(path)
from django.core.management import setu...