I've recently pushed a Django app live. We built the app in a staging subdomain on the server. When I went live, I copied the files of the staging subdomain to the main site, created a staging database and pointed the old staging site at the new staging database (leaving the new live site pointed at the original database). This is on mod...
I can currently run either Django through mod_wsgi or PHP on my Apache server.
My Django projects run at: http://localhost and source is at C:/django_proj
My PHP projects run at: http://php.localhost and source is at C:/web
If I turn both on, php.localhost and localhost go to the Django project. I've already set them up through Apache...
django-admin.py makemessages dies with errors "warning: unterminated string" on cases where really long strings are wrapped:
string = "some text \
more text\
and even more"
These strings don't even need to be translated - e.g. sql query strings.
The problem goes away when I concatenate the string, but the result l...
I have two models that looks like this:
class RouteBase(models.Model):
base = models.ForeignKey("Base")
route = models.ForeignKey("Route")
sequence = models.IntegerField()
class Route(models.Model):
bases = models.ManyToManyField("Base", through="RouteBase", blank=True)
description = models.TextField(blank=True)
#and a few oth...
How do you fix the following Django bug when working with forms?
TypeError at /url/
argument of type 'WSGIRequest' is not iterable
...
Hello people,
I would like to add a field to the Django FlatPage database model, but I do not really know how to extend this without editing the original application.
What I want to do is to add the following field to the model:
from django.db import models
from django.contrib.flatpages.models import FlatPage as FlatPageOld
class Fl...
We are looking for a way to publish articles in different languages, including differences in writing direction (RTL/LTR) and of course character sets. The maintainer of the current site works with Mambo/Joomla, but has already found severe restrictions in terms of extensibility.
A similar question has already been asked, but I will add...
Very basic question, but I'm having trouble tracking down the answer on the web. I have a template, which I want to link to the django admin site (i.e. localhost:8000/admin). What is the code for this?
I'm imagining something like
<a href="{% url admin.site.root %}">link to admin panel</a>
However, when I try the above snippet I get:...
I was wondering if the django admin page can be used for external users.
Let's say that I have these models:
class Publisher(models.Model):
admin_user = models.ForeignKey(Admin.User)
..
class Publication(models.Model):
publisher = models.ForeignKey(Publisher)
..
I'm not exactly sure what admin_user would be -- perhaps it cou...
When finding web hosting for Rails apps, the hoster must have support for ruby on rails -- that is evident. What about hosting for Django? What support does the hoster need to provide? Python, or more than just Python?
This might seem like an obvious question, but I'm new to web development frameworks so I must ask :)
...
Hi.
So I just met a strange so-called bug. Because this work on my other .py files, but just on this file it suddenly stopped working.
from tuttobelo.management.models import *
The above used to work, but it stopped working all of a sudden, and I had to replace it with the bottom.
from tuttobelo.management.models import Preferences,...
i am working with python django framework but in model part is sqlalchemy and back end data base is mysql how i will configure them???
...
In django templates, it's common to do the following:
<img src="{{ MEDIA_URL }}/img/someImage.jpg">
How would you accomplish this in a CSS file which is not served as a template?
.someClass {
/* can't do this this */
background: url("{{ MEDIA_URL }}/img/someImage.jpg");
/* either this */
background: url("http:...
I have a base.html template that contains a list of links.
Example:
<div id="sidebar1">
<ul>
<li><a href="/" title="">Index</a></li>
<li><a href="/stuff/" title="" class="current">Stuff</a></li>
<li><a href="/about/" title="">About Me</a></li>
<li><a href="/contact/" title="">Contact Me</a></l...
I want to include things like twitter status, or delicious tags, in my django templates.
These things are dynamic, yet regular. How would this be done?
...
I need to generate name of uploaded image with mask
images/{{ uploaded_image.id }}.jpg
I think the best way to do this is *FileField.upload_to* property, but it is written Here:
In most cases, this object will not have been saved to the database yet, so if it uses the default AutoField, it might not yet have a value for its prima...
I am using the standard User model (django.contrib.auth) which comes with Django. I have made some of my own models in a Django application and created a relationship between like this:
from django.db import models
from django.contrib.auth.models import User
class GroupMembership(models.Model):
user = models.ForeignKey(User, null =...
So I am just starting out on learning Django, and I'm attempting to complete one of the sample applications from the book. I'm getting stuck now on creating DRY URL's. More specifically, I cannot get my context processor to work. I create my context processor as so:
from django.conf import settings
#from mysite.settings import ROOT_URL
...
Basically I have a model with a ManyToMany field, and then a modelform derived from that model where that field is rendered as a "multiple choice" selectbox. In my template I'm having that field omitted, electing instead to prepare the values for that field in the view, then pass those prepared values into request.POST (actually a copy ...
I'm using the row-level permission model known as django-granular-permissions (http://code.google.com/p/django-granular-permissions/). The permission model simply has just two more fields which are content-type and object id.
I've used the following query:
User.objects.filter(Q(row_permission_set__name='staff') | \
Q(row_permissi...