Hi!
Doug Warren wrote:
> Is there a way to run a django app that's being served on the local
> machine via Apache and mod_wsgi using the integrated debugger in wsgi?
> I did a few google searches but nothing popped out as being the
> obvious solution, other than a suggestion from google to run ap
Hi,
I need to show a javascript lightbox popup for new visitors to my
site.
I presume using a cookie is the best way to achieve this. But how can
i check whether the cookie exists in my template, so i can call some
javascript code if it's a new visitor ?
I hope i have been clear,
Thanks
--
Yo
You'll need to do the test in the view and then pass the result of the
test into the template.
On Jul 7, 10:13 am, grimmus wrote:
> Hi,
>
> I need to show a javascript lightbox popup for new visitors to my
> site.
>
> I presume using a cookie is the best way to achieve this. But how can
> i check
I'm not entirely sure whether you're asking one question or two here.
Firstly, I think that in the RESTful sense, there's nothing wrong with
having a confirmation page that uses the same URL to perform an action
*providing* the HTTP verb is different. In this case the confirmation
page is accessed
As stated there is no way to filter on any non-field attribute,
property or method.
However, don't despair. If the result of your permission check can be
expressed as another Django query then it should be possible to
construct something in the ORM that uses this. That said, we have had
trouble wi
Hi again,
I've had a read over your blog tutorial and have the following
suggestions:
1) Make it PEP-8 (http://www.python.org/dev/peps/pep-0008/) compliant
- it's a lot easier to read.
2) Except only the error that might occur in the paginatior example.
Bare excepts are BAD.
3) Maybe consider ena
On Sat, Jul 3, 2010 at 7:20 PM, Wiiboy wrote:
> Is there a way to filter based on the result of a model instance
> method?
>
> I've got a Permission model with a one-to-one relationship with an
> Article. The Permission model stores the different groups that the
> Article author said could read t
Hello,
In my tests.py file I have two classes (TestCases). Each one of them
must be run using different settings file.
Of course setting
def setUp(self):
os.environ['DJANGO_SETTINGS_MODULE'] =
'project.settings_module'
won't work, as the environment is already ready at this point.
How
> Everytime you call exclude (btw, this should be q =
> q.exclude(pk=item.pk), no?),
Yes =) I wrote that quickly with my post.
> articles = [article for article in
> Article.objects.all().select_related('permission') if
> article.permission.can_view_article(request.user)]
Good idea.
--
You r
The 'from gather import login, logout' line at the bottom of the stack
trace looks pretty suspicious. Could you post the code to 'gather' and
explain how your files are laid out?
On Jul 7, 12:51 am, reduxdj wrote:
> Thanks, It looks like still have this nagging n00b issue, the problem
> seems to
Hi all,
I'm getting the following error n the apache error log:
[Wed Jul 07 09:53:12 2010] [error] [client 152.16.223.251] mod_wsgi
(pid=425): Exception occurred processing WSGI script
'/Library/WebServer/testing123/apache/django.wsgi'.
[Wed Jul 07 09:53:12 2010] [error] [client 152.16.223.251]
Hi,
Are you sure the syntax error isn't in the wsgi file itself?
/Library/WebServer/testing123/apache/django.wsgi
Nuno
On Wed, Jul 7, 2010 at 3:02 PM, Bradley Hintze
wrote:
> Hi all,
>
> I'm getting the following error n the apache error log:
>
> [Wed Jul 07 09:53:12 2010] [error] [client 152.1
Hi all
I'm trying to combine two querysets, and having a difficult time
explaining why one bit of code works, and why similar code doesn't.
I'm probably doing something wrong..
This is a customer management system:
User objects are arranged into UserGroup objects, with a through table
called User
BINGO.
Thanks! The newbie didn't think of the syntax error being in the file,
thought it was in httpd.conf. Found it, fixed it, all is well. I'm
sure I'll be posting more.
Thanks for the help again,
Bradley
On Wed, Jul 7, 2010 at 10:06 AM, Nuno Maltez wrote:
> Hi,
>
> Are you sure the syntax er
Just as a followup:
http://code.djangoproject.com/ticket/8906
Looks like they will never fix this or recognize it as a bug.
I find this kind of disappointing and confusing.
If they're going to do that why not just get rid of the {% url %} tag and
make people always declare their absolute URL (i
On Fri, Jul 2, 2010 at 9:02 PM, felix wrote:
> you might have already seen this ticket:
>
> http://code.djangoproject.com/ticket/7561
>
> re: post-sync isn't actually post sync
If you search the django-dev archives, you'll find some discussion
around this ticket. Any proposal in this area needs t
Actually, the confirmation page is not accessed via a GET. Using the
admin's auth model as an example: the user does a GET to something
like www.example.com://admin/auth/user to get a list of users. Then
they checkmark the users they want to delete, select the "delete"
action, and then click on "
Hi,
I'm a begginer with django. I had a probleme inserting an image
I did this in the template:
the image is inthe same directory but at the output there is no image
please help
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gr
On Jul 7, 4:26 pm, Imad Elharoussi wrote:
> Hi,
> I'm a begginer with django. I had a probleme inserting an image
> I did this in the template:
>
> the image is inthe same directory but at the output there is no image
> please help
http://docs.djangoproject.com/en/1.2/howto/static-files/#howto-s
I think in the strict REST sense, it would be best to POST to one URL
with the list of object IDs to delete to set this action up and then
redirect to another URL with a GET which asks for confirmation based
on the previous setup and then POSTs to delete. This keeps it RESTful
in the sense of one U
I thought that {% cycle 'a' 'b' as mycycle %} was supposed to just set
the variable {{ mycycle }} and not output anything to the template.
However, the following template (with myrange=[1, 2, 3]):
{* start template *}
{% for i in myrange %}
{% cycle 'a' 'b' as mycycle %}
{{ mycycle }}
Er, that was sloppy of me. Actual output:
a
a
b
b
a
a
On Jul 7, 11:53 am, ringemup wrote:
> I thought that {% cycle 'a' 'b' as mycycle %} was supposed to just set
> the variable {{ mycycle }} and not output anything to the template.
>
> However, the following template (with myrang
This is the desired behavior. Until the loop is done it cycles the
given values you provided in your case 'a' 'b' and since the loop is
running 3 times it cycles back to 'a' again.
Cheers,
Thusjanthan
On Jul 7, 8:55 am, ringemup wrote:
> Er, that was sloppy of me. Actual output:
>
>
> a
>
When I combine two query sets I use the chain command. You might want to try
it.
Here is my code snippet
from itertools import chain
# Get current station configuration records
stationlist =
StationConfig.objects.filter(StationId=result.StationId,
StartDate__lte= result.Ex
On Wed, Jul 7, 2010 at 5:06 PM, Jeff Green wrote:
> When I combine two query sets I use the chain command. You might want to try
> it.
>
> Here is my code snippet
>
> from itertools import chain
chain is useful when you want to concatenate two lists together. In
this case though, I want distinct
Yes, sorry, I know the values are correct.
What's concerning me is that the {% cycle ... as ... %} statement is
*outputting* the value each time through the cycle instead of just
*setting* the {{ mycycle }} variable so that it can be output as
needed.
On Jul 7, 12:00 pm, thusjanthan wrote:
> T
On Wed, Jul 7, 2010 at 5:00 PM, thusjanthan wrote:
> This is the desired behavior. Until the loop is done it cycles the
> given values you provided in your case 'a' 'b' and since the loop is
> running 3 times it cycles back to 'a' again.
>
> Cheers,
> Thusjanthan
>
Thats not precisely what he was
I guess that's a workaround. It would be a bit less tricky if HTML
comments in the wrong place didn't break output in IE6[1] (no, I can't
drop IE 6 support yet).
This behavior just seems odd to me, since other tags with an "as"
option ( e.g. {% url ... as ... %}) do not output when they're called
I agree that the "as" clause makes me expect it to render nothing, but it
has worked this way at least back to 1.0, so I guess changing it is not
an option.
On Wed, Jul 7, 2010 at 11:55 AM, ringemup wrote:
> Er, that was sloppy of me. Actual output:
>
>
> a
> a
> b
> b
> a
> a
>
>
> On J
You could perhaps put it in a span with display:none; .
Or you can always create your own template tag with the desired behavior.
The source for the existing tag is in .../django/template/defaulttags.py .
On Wed, Jul 7, 2010 at 12:25 PM, ringemup wrote:
> I guess that's a workaround. It would b
On Wed, Jul 7, 2010 at 5:25 PM, ringemup wrote:
> I guess that's a workaround. It would be a bit less tricky if HTML
> comments in the wrong place didn't break output in IE6[1] (no, I can't
> drop IE 6 support yet).
>
> This behavior just seems odd to me, since other tags with an "as"
> option (
Elements with display:none sadly trigger the same bug. Looks like a
custom tag may be in order.
On Jul 7, 12:34 pm, Tom Evans wrote:
> On Wed, Jul 7, 2010 at 5:25 PM, ringemup wrote:
> > I guess that's a workaround. It would be a bit less tricky if HTML
> > comments in the wrong place didn't b
Follow the link suggested by Daniel
On Wed, Jul 7, 2010 at 8:44 AM, Daniel Roseman wrote:
> On Jul 7, 4:26 pm, Imad Elharoussi wrote:
> > Hi,
> > I'm a begginer with django. I had a probleme inserting an image
> > I did this in the template:
> >
> > the image is inthe same directory but at the
Hi,
I have this class (representing real files on a filesystem):
class File(models.Model):
content = models.ForeignKey('Content', related_name='files')
filetype = models.ForeignKey('FileType')
filename = models.CharField(max_length=64,
verbose_name='filename')
I added a custom dele
Greetings!
I am trying to implement a very simple (yet elegant) solution for a
university departmental website in django. In designing my urls, I
desired to have them follow this pattern:
university.edu/department/page_title_made_into_slug
However, I couldn't get it working or find any doc tha
I think my brains have been un-djangoed because I think I'm missing
something obvious.
I've got the user model linked in with my own model serving as the
profile which is working for registerring and authenticating a user.
But I'm wondering how to have a guest be able to do some things with
the i
On Wed, Jul 7, 2010 at 5:37 PM, ringemup wrote:
> Elements with display:none sadly trigger the same bug. Looks like a
> custom tag may be in order.
>
I'm not being funny, but given that you know about this (extremely
rare edge case) bug, just output it somewhere where it _cannot_
trigger the bug
Hi all,
I'm trying generate a image to pdf. Well, is to convert a
Figure matplotlib's object to an image or object that can be
drawImage used in the canvas. See my code like this:
http://paste.pocoo.org/show/234628/
My urls.py:
urlpatterns = patterns('simuladores.detector.views',
(r'^grafic
On 07/07/10 17:27, Bill Freeman wrote:
> I agree that the "as" clause makes me expect it to render nothing, but it
> has worked this way at least back to 1.0, so I guess changing it is not
> an option.
hypothetical, could add an "only" clause maybe to preserve backward compat?
{% cycle 'odd' 'eve
I'm not quite clear on what you're asking, but if the issue is how to write
a regex for slugs: The regular expression you need for slugs is *[\w\d\-]+*
Hope that helps.
Daniel
---
Daniel Lathrop
On Wed, Jul 7, 2010 at 9:32 AM, Rodion Raskolnikiv wrote:
> Greetings!
> I
I am working on a form to resend an account activation email for newly
registered users who did not receive their first email.
The form is currently raising a DoesNotExist error and I can't figure
out why:
Here is the activation code:
class resend_activation(forms.Form):
email = forms.EmailF
My bet is that FullProfile.objects.get is raising the error because
there is no profile with that email address. You might expect this
to be caught by the "try" and raise a validation error instead, but
since you have no "except" clause, its not going to happen.
On Wed, Jul 7, 2010 at 1:22 PM, Ni
At a glance:
> try:
> FullProfile.objects.get(email=email)
> except FullProfile.DoesNotExist:
>
> test =
> FullProfile.objects.get(email=self.cleaned_data['email'])
> raise forms.ValidationError("%s" % (test))
Shouldn't the second FullProfile.objects.get
Thanks Thusjanthan...
That certainly will work.
Now request.META['REMOTE_ADDR'] it seems it would be possible
somehow to add a field to our userprofile or auth_user table such as
last_ip_used and record that customers last IP when using the system.
This makes easier for us to track from the ap
Chris,
You led me down the right track, the problem being my registration app
was in two paths at the same time, I guess there was some craziness
going on with the errors. Thanks for your time. I hate being new at
Django, I want to be seasoned.
Thanks,
Patrick
On Jul 7, 9:45 am, Chris Lawlor wro
Is there a way to use the manage.py shell option to run the server
code and have a shell also? bin/django shell gives me a ipython shell...
Also, I've gotten some help from the developer of django-page-cms
and he's not likely to respond until tomorrow.
What methods of debugging did he mean wh
As somebody who ran across this bug a few weeks ago (using comment to
capture the output). I _really_ wish the behavior would die.
Personally I would be in favor of dropping output when there is an "as"
attribute, if somebody depends on it in the 1.3 timeframe there could be
a setting that w
To clarify, I would like to take the current url form of:
/dept_id/page_id/ (which looks like /2/13/)
into a url that looks like this:
/accounting/policy_for_travel_expenses/ (which puts the title of the
element in place of the element ID)
I am getting at the elements by ID this way:
(r'^(?P
Add a SlugField to the Page model, and populate it based on the title
(this can be done automatically either via the admin's
prepopulated_fields, or via a custom model save() method)
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
Then use a reg
> articles = [article for article in
> Article.objects.all().select_related('permission') if
> article.permission.can_view_article(request.user)]
The only problem I see is that is that 'articles' is a list, not a
queryset. The reason I was using q.exclude(pk=item.pk) is because the
return value
A lot of this is me trying to find out why it's failing. The problem
I'm getting is that there is a FullProfile associated with the email
address. When i go through the steps in the shell it works perfectly.
When I run it through the form it throws an error. If you look at the
custom ValidationErro
I'm hoping somebody has run into this issue before, failing that,
perhaps someone can see a glaring mistake in my code.. I'm getting a
recursive loop somehow while following the example:
http://code.djangoproject.com/wiki/NewformsHOWTO#Q:HowdoIaddanextracolumntothechangelistview
In the __init__.p
Hi,
So I have a read only database called "information" which has been
modeled in the django framework with the managed=false for the META on
all its tables. When I run unit tests on another app I do not want the
unit tests to go and create a test database for "information" but
would rather like t
I'm working on a view made to output JSON for Ajax use. My log has:
[07/Jul/2010 17:47:13] "POST /ajax/login HTTP/1.1" 500 50678
That looks like Django gave a helpful and detailed stacktrace page, albeit
to jQuery expecting JSON.
How can I ask Django to log uncaught exceptions to a file or equiv
Hi there !
I would like to display model fields based on the logged-in user.
If user is restricted user
list_display = (field1, field2)
else
list_display = (field1, field2, field3, field4)
How is it possible ?
--RJ
--
You received this message because you are subscribed to the Google Group
Hi all,
I am trying to follow http://docs.djangoproject.com/en/1.2/topics/forms/
I put contact.html in myTemplates.
But when I try to bring up '../contact' i get a 404 error. Here are the details.
Using the URLconf defined in testing123.urls, Django tried these URL
patterns, in this order:
^tes
On Jul 7, 10:48 pm, Bradley Hintze
wrote:
> Hi all,
>
> I am trying to followhttp://docs.djangoproject.com/en/1.2/topics/forms/
>
> I put contact.html in myTemplates.
>
> But when I try to bring up '../contact' i get a 404 error. Here are the
> details.
>
> Using the URLconf defined in testing123
Hey all,
I'm currently developing an application using Django's deprecated user
messaging functionality and one of the features I depend on is the
ability to set messages for a particular user from a back-end process,
i.e. outside of the request cycle. In my backend process, I have
access to the
Thanks, that was it!
On Wed, Jul 7, 2010 at 5:54 PM, Daniel Roseman wrote:
> On Jul 7, 10:48 pm, Bradley Hintze
> wrote:
>> Hi all,
>>
>> I am trying to followhttp://docs.djangoproject.com/en/1.2/topics/forms/
>>
>> I put contact.html in myTemplates.
>>
>> But when I try to bring up '../contact'
If I have models like below where I have a multiple instance of the
base manufacturer (could be inherited or I could just have a OneToOne
relationship):
class Manufacturer(models.Model):
name = models.CharField(max_length=128)
class ManuType1(Manufacturer):
def myfunc(self, str):
r
You could implement a middleware class with a process_exception
method. See:
http://docs.djangoproject.com/en/dev/topics/http/middleware/#process_exception
-Elijah
On Wed, Jul 7, 2010 at 4:35 PM, Jonathan Hayward
wrote:
> I'm working on a view made to output JSON for Ajax use. My log has:
> [0
I just tried:
json_serializer.serialize(result, ensure_ascii = False, stream = response)
where result was boolean. I got an error complaining that it was not
iterable, and http://docs.djangoproject.com/en/dev/topics/serialization/seems
to discuss serialization of querysets.
In this case I can ea
Thank you!
On Wed, Jul 7, 2010 at 5:35 PM, elijah rutschman wrote:
> You could implement a middleware class with a process_exception
> method. See:
> http://docs.djangoproject.com/en/dev/topics/http/middleware/#process_exception
>
> -Elijah
>
> On Wed, Jul 7, 2010 at 4:35 PM, Jonathan Hayward
>
I posted something about it on Django developers list, so keep an eye
out for it there.
Graham
On Jul 8, 12:25 am, Jacob Fenwick wrote:
> Just as a followup:
>
> http://code.djangoproject.com/ticket/8906
>
> Looks like they will never fix this or recognize it as a bug.
>
> I find this kind of di
Many thanks to you both!
That was enough info to get things working!
On Jul 7, 11:36 am, ringemup wrote:
> Add a SlugField to the Page model, and populate it based on the title
> (this can be done automatically either via the admin's
> prepopulated_fields, or via a custom model save() method)
>
On Jul 7, 4:35 pm, Jonathan Hayward
wrote:
> I'm working on a view made to output JSON for Ajax use. My log has:
>
> [07/Jul/2010 17:47:13] "POST /ajax/login HTTP/1.1" 500 50678
>
> That looks like Django gave a helpful and detailed stacktrace page, albeit
> to jQuery expecting JSON.
If there is
Never mind; I found:
import json
def view(request):
...
my_result = ...
return HttpResponse(json.dumps(my_result), mimetype="application/json")
On Wed, Jul 7, 2010 at 6:05 PM, Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:
> I just tried:
>
> json_serializer.serializ
Thanks Euan - I think that clarifies things. Thanks very much for your
responses!
Margie
On Jul 7, 8:50 am, "euan.godd...@googlemail.com"
wrote:
> I think in the strict REST sense, it would be best to POST to one URL
> with the list of object IDs to delete to set this action up and then
> redire
Hi, I'm beginner.
I tried to execute 'manage.py syncDB' command,
but it's not work.
My package is like ..
MyProjectMaster---models.py
| Appli-models.py
MyProject/Appli/models.py is ..
//-
from Master.models import WebBrowser
class A
Try overriding changelist_view of your ModelAdmin. Reset
self.list_display based on user and then call the super method
changelist_view.
Rajeesh.
On Jul 8, 2:40 am, rahul jain wrote:
> I would like to display model fields based on the logged-in user.
> How is it possible ?
--
You received thi
try importing from myproject.master.models, not master.models.
Rajeesh.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
djang
On Wed, Jul 7, 2010 at 11:53 AM, ringemup wrote:
> Is this a bug or the desired behavior?
>
http://code.djangoproject.com/ticket/13567
is open on this issue.
Karen
--
http://tracey.org/kmt/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
Thanks.
But I tried it, it causes "unresolved import".
I suppose to I failed to explain my application.
MyProjectMaster---models.py
| Appli-models.py
settings.py
manage.py
settings.py
//--
INSTALLED_APPS = (
'django.
hi,
any reason why get_model() in django.db.models is not documented? Or is it
just that I cannot find it?
--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
74 matches
Mail list logo