If I want to insert a variable %s into this
<p><img src= %s alt="tetris"/></p>
I have the problem that if I use "%s", it wont recognize it as the placholder it is.
But if just use %s it wont link to my image.
Is there a way around this?
I tried to insert the url that is inserted there like this in the database ''/url/''.
But that wo...
Hi Guys, Django and south newbie here
I need to change the encoding of a table I created, does anyone know a way to do so using a migration?
...
I have developed a small django web application. It still runs in the django development web server.
It has been decided that if more than 'n' number of users like the application, it will be approved.
I want to find out all the users who view my application.
How can find the user who views my application?
Since I was the user who ran ...
My Models:
class PromoNotification(models.Model):
title = models.CharField(_('Title'), max_length=200)
content = models.TextField(_('Content'))
users = models.ManyToManyField(User, blank=True, null=True)
groups = models.ManyToManyField(Group, blank=True, null=True)
I want to publish there items to templates with some p...
Hey Guys!
I am currently facing a serious problem.
I use the standard django admin interface incl. change list to display one of my models.
The model has got a field, which includes a link (e.g. in database: link).
What I want now is that this string is rendered unescaped and displayed as link. I already tried the following in "change_...
I have models:
class Site(models.Model):
profile = models.ForeignKey(User)
class Profile(models.Model):
blacklist = models.ManyToManyField(Site)
How can i do equivalent of this query via django orm?
SELECT * FROM site WHERE 2 NOT IN (SELECT site_id FROM profile_blacklist WHERE profile_site.profile_id=site.profile_id)
I nee...
How can I execute raw SQL after connect to database?
I need to run script once, after connect to DB.
Thanks.
UPD: question is not how to run raw SQL.
...
hi all
im using django with apache and mod_wsgi
i am facing a problem when i use WSGIApplicationGroup %{GLOBAL} in apache configuration file (.conf) . i dont know if i am using this directive correctly or i need to use it in another way , the problem is that i needed to add this directive to fix a problem for xapian as described in thi...
Hey,
I'm a long time Java programmer and I'm digging into Django recently to see what it offers.
It looks to me that Django doesn't fit Java web developers taste.
I mean in MVC Java web frameworks we have usually a controller class that receives the request, do the logic and then forwards the request to another destination.
Rails als...
I know that if I need a custom "selector" for a field in django-admin I need to create a custom widget.
But what if the widget have to produce two values, for example X and Y coordinates, how can I fill them in two different fields from the model?
...
Hi folks,
I have a nice admin panel setup so users can manage the data within the site.
Problem is that I need to implement a workflow, so saved models can be approved from and to various stages, to then be finally published.
As the model in question is just one, I thougth of adding a boolean 'approved_for_publishing' field and a 'a...
I use fileSystem caching in my django application
what I need is to clear the cache after any action(adding or editing or deleting) taken by the admin
is there any way to get an action (clearing the cache) to be executed after all the submission of any form in the admin site?
...
For some reason, every time I attempt to install a new module using easy_install, I'm getting the error:
AttributeError: 'module' object has no attribute '__getstate__'
I'm using setuptools-0.6c11-py2.6
...
I want to make a Django view that does the following:
Receive an HttpRequest on api/some/url/or/other
Passes this through to another server at some/url/or/other (rewrite the URL, basically)
Adding a cookie based on session data in Django
Using the same method, data, params, et al, that were in the original request
Returns verbatim th...
I want to generate a queryset to find mismatches. As an example
class Vehicle(models.Model):
car = models.CharField(max_length=100)
model= models.CharField(max_length=100)
passengers = models.IntegerField()
i want to generate a query where i can find cars erroneously listed with two different models.
something along th...
I am using Django Flatpages in a production site. I'd like to figure out the best way to make sure if an admin makes a mistake editing a file, old version of the page can be retrieved. We have backups and such, but that's a bit more cumbersome to recover from (i.e. involves sysadmin, not website editor).
First, is there a package that d...
I currently have a growing Django production server that has all of the front end and backend services running on it. I could keep growing that server larger and larger, but instead I want to try and leave that main server as my backend server and create multiple front end servers that would run apache/nginx and remotely connect to the ...
Hi,
I am using django auth module.Now,when user logs in I want to record users ipaddress in the admin_log table.How can I do this?
thanks
...
I have a django site running on 1.2.1, and once in a while my users lose a lot of work because the csrf_token cookie does not exist and the page errors out with a 403 error on post. I narrowed this down to another site (that my users frequent) deleting the cookie on me. The site does this with the ActiveX ClearAuthenticationCache command...
1) I am using a middleware to log users ipaddress,but this should happen only once,and also only after user is authenticated.How can I do this?
2)In my application,I have login for users which is different from admin login.Now,when admin clicks logout,he is directed to users login page.But,I want to direct to admin login page.How can I ...