Re: Internal Error after chaning SITE domain name and modifying html file...?

2012-12-07 Thread Paul Backhouse
Is it a Site cache issue?

https://docs.djangoproject.com/en/1.4/ref/contrib/sites/#caching-the-current-site-object

Maybe try Site.objects.clear_cache()

On Fri, 2012-12-07 at 00:03 -0800, easypie wrote:
> I'm getting an 500 internal error. I did two things before this
> happened. (1) I modified a single html file then (2) logged into admin
> panel and changed the SITE's domain name. Afterward, I restarted the
> server but the website kept responding w/ 500 error. Here's the apache
> error log: http://dpaste.org/crfbg/
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Ihm02fnLxbIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to use named urls from apps

2012-11-29 Thread Paul Backhouse
Try

{% url 'auth_login' %}

That works for me in Django 1.4

On Thu, 2012-11-29 at 06:32 -0800, Mike wrote:
> I'm trying to use the url template tag to call the login view from
> contrib.auth.  I've tried the following but none work:
> 
> 
> {% url login %}
> {% url auth:login %}
> {% url auth.login %}
> {% url contrib.auth.login %}
> 
> 
> Can someone enlighten me please?
> Mike


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing forum on django 1.4

2012-11-29 Thread Paul Backhouse
On Wed, 2012-11-28 at 03:15 -0800, Yogev Metzuyanim wrote:
> Hi,
> Did someone here managed to install a working forum on django 1.4, I
> tried all these and I got  all kinds of errors:
> PyBB
> django-forum
> django-forumbr
> askbot
> snapboard
> and more...

I suspect your question is too general. You might be better off posting
the errors you get from just one of those apps. You might get even
better results if you posted to a forum that deals specifically with
that particular app. I know askbot uses itself as a support forum.
(http://askbot.org/en/questions/)


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: content management in django

2012-09-25 Thread Paul Backhouse
On Tue, 2012-09-25 at 06:35 -0700, eclypcix wrote:
> What I should have asked, is it okay to store all the site's html
> content in a database? Is it usually done that way?
> 

I'm not sure what you mean by "all the site's html". You wouldn't have
_all_ the sites html in the database, django generates html dynamically
in response to requests, and (usually html) templates are used to
provide uniform structure around the context of a response. Templates
are not normally stored in a database, maybe because they're not
considered to be data which are likely to change, nor can be expressed
in a relational manner.

However it's not unreasonable to have some editable content stored in
the database, which may be html.

An example:

A site has an "About Us" page and the client wants to add in the fact
that Gerald has joined the company.

You could render a template that has all the "About Us" data hard coded,
but then to update the page you would have to edit the template, check
it into revision control and redeploy the site.

If you use flatpages (or any other CMS) then the site administrator (the
client) can change the "About Us" page content through the admin
interface, save it (to the database) and make sure it looks OK on the
site. Lovely.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: why Eclipse showed "Undefined Variable"

2012-09-25 Thread Paul Backhouse
On Tue, 2012-09-25 at 08:10 -0700, Maysxuan wrote:
> I am new to Python & Django ,and I created a test project for Django
> in Eclipse ,then got a "Undefined Variable".
>  
> And who would tell me what happened?
>  
> (Attachment is the screenshot)
>  

You've imported "hello" from "zxcfa.views". So try changing
"zxcfa.views.hello" to just "hello".


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: content management in django

2012-09-24 Thread Paul Backhouse
I'm not sure that I fully understand your question, but, for the static
content, django flatpages
(https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/) may be
what you are looking for.

News editing would have to be handled by your news editing app!
django-cms (https://www.django-cms.org/) may be a good first port of
call. There are WYSIWYG editors which can be easily integrated, eg
TinyMCE (http://django-tinymce.readthedocs.org/en/latest/index.html)




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Setting an unusable password on an existing user

2012-09-21 Thread Paul Backhouse
Works for me...

>>> from django.contrib.auth.models import User
>>> user = User.objects.latest('id')
>>> user.has_usable_password()
True
>>> user.set_unusable_password()
>>> user.has_usable_password()
False


On Thu, 2012-09-20 at 23:16 -0700, nav wrote:
> Hi,
> 
> Is there any way to set the password of an existing user to and
> unusable value like none? 
> 
> I tried user.set_unusable_password() and subsequently user.save() but
> this did not work.
> 
> Other than using this method is there a way to set the password to
> None or such like so that the user.has_usable_password() method will
> return False instead of True?
> 
> Many Thanks,
> nav
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/yqNmZJR5mJgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django newbie with issues

2012-09-12 Thread Paul Backhouse
On Wed, 2012-09-12 at 02:46 -0700, Morrti wrote:
> moving to 1.4 isn't a quick option for me/us so I'm stuck on 1.1 for a
> while.

Why is this? If you're new to Django you should dive in at the latest
version.

If your company has existing projects that are dependent on 1.1, then
why not create a virtualenv with Django 1.4 on it so you can play around
getting to know Django. Then you can go back to 1.1 with some
confidence.

I suspect you'll get more support using a more recent version.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Id error

2012-08-31 Thread Paul Backhouse
In your CountryForm, calling super(self.__class__)... might not be a
good idea. You should name the class, ie.

super(CountryForm, self).save(*args, **kwargs)

I'd also be wary of defining a class called 'Object', since python
already has 'object' as part of its "new style" classes.

Paul

On Fri, 2012-08-31 at 07:58 -0700, Drvanon wrote:
> Hello django-ers,
> 
> 
> Today I had a good dream in which I though I fixed something in my
> bug-magnet.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can somebody help me on how to handle this scenario?

2012-08-22 Thread Paul Backhouse
You shouldn't need to define "People" or "User", that already comes in
django.contrib.auth.models. Just import User and make that your foreign
key where needed. 

A smart way would be to use django.contrib.comments.

https://docs.djangoproject.com/en/dev/ref/contrib/comments/

For more complex commenting mechanisms take a look at django packages:

http://www.djangopackages.com/grids/g/commenting/


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: From Django 1.1 to Django 1.3.1 - Goes Very Slow

2012-08-21 Thread Paul Backhouse
On Tue, 2012-08-21 at 07:30 -0700, ydjango wrote:
> 
>  I have typical LAMP stack application. I use ORM very heavily. I
> recently migrated from django 1.1 to django 1.3.1.
> Application has become very slow even though I have doubled the
> hardware.
> 
> Two major changes have been:
> 1) I have moved database (mysql) to different server
> 2) I have migrated django from 1.1 to 1.3.1
> 
> Any clues on what I should look at?
> Any Django 1.3.1 specific settings I should look at?

I think there are some browser tools that you could look at installing.
Firebug will tell you details about time to fetch files. I think there's
yslow too. Django debug toolbar will also tell you what queries are
being made and how long they take.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: deprecation warning from HttpResponseRedirect(reverse(...))

2012-08-20 Thread Paul Backhouse
Just importing a function from django.views.generic will trigger the
warning. So I'd check your code for imports.

I made tracking down the source of these warnings a little easier by
putting stacklevel into simple.py:

https://code.djangoproject.com/ticket/18780

On Sat, 2012-08-18 at 05:58 -0700, Mike wrote:
> 
> 
> On Saturday, August 18, 2012 1:31:42 PM UTC+2, Paul Backhouse wrote:
> > I seem to be getting a  DeprecationWarning when my view hits
> this line of 
> > code: 
> > 
> >   return HttpResponseRedirect(reverse(results,
> args=[query.jobid])) 
> > 
> 
> What does the depreciation warning say? 
> 
> 
> 
> Here's the full text:
> /Users/mike/sieve-django/SIEVEENV/lib/python2.6/site-packages/django/views/generic/simple.py:8:
>  DeprecationWarning: Function-based generic views have been deprecated; use 
> class-based views instead.
>   DeprecationWarning 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/KvKw7JosFbIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django + FAPWS doesnt show the templates/view correct

2012-08-17 Thread Paul Backhouse
Are you sure it's a views/templates issue? You're getting content that
looks correct in structure so I'd say the views + templates are fine.
Looks like a CSS issue to me.

If you're using firefox then install firebug and check the NET tab for
404s to your CSS files.

Paul

On Fri, 2012-08-17 at 02:43 -0700, keeran wrote:
> On the Django development server, django app works fine. But once I
> setup the production test run, I get only the text contents, where
> template views are not shown as intended. What am I going wrong? 
> 
> I have django 1.5 latest.
> 
>  Nginx - 0.8.54 
> 
> uWSGI - 1.2.5




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How well does South work in a team?

2012-08-16 Thread Paul Backhouse
On Thu, 2012-08-16 at 10:39 -0300, Tomas Neme wrote:
> Well, if you push without pulling, this might happen,

*Implicit git usage* :D

I'd expect git to squeal about it being a non-fast-forward commit.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Comparing packages django-groups and django-organizations

2012-08-13 Thread Paul Backhouse
Hi,

For my site I want Users to be members of groups. Groups represents a
bunch of people that want to discuss something on the site. Here's a
brief list of requirements:

Users can apply to join a group, or be invited to join.

There are objects associated with each group which members can view (and
possibly edit depending on permissions).

A group will have its own url, showing the posts of that group.

Groups can be public or private. Public groups are partly visible to
non-members. Private groups are not visible to non-members.

A User will have a page showing all activity from all the groups they're
members of.

A User may be an administrator of one group, but only a regular member
of another group.

So anyway, I'm having a hard time trying to filter these requirements
through the two available packages I've found, django-groups
(https://github.com/brosner/django-groups) and django-organizations
(https://github.com/bennylope/django-organizations/).

Does anyone have any experience with them or can anyone offer any advice
about which one matches the requirements best? Neither seem to be listed
on django-packages.

Cheers,

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django app to update site through email

2012-08-13 Thread Paul Backhouse
I've just noticed that Askbot seems to do a lot of this already:

https://github.com/ASKBOT/askbot-devel/blob/master/askbot/management/commands/post_emailed_questions.py
https://github.com/ASKBOT/askbot-devel/blob/master/askbot/mail/__init__.py

I've not tested it, and I seem to remember reading a comment that it was
experimental... 

http://askbot.org/doc/sending-email-to-askbot.html

Maybe that could be spun out into it's own app.

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django app to update site through email

2012-08-13 Thread Paul Backhouse
On Sat, 2012-08-11 at 13:21 +0300, Marwan Al-Sabbagh wrote:
> I'm curious you said you have already implemented this. How did you
> end up doing it.

Well I just have a manage.py command that uses poplib to get mail. The
mail contents are then parsed for app specific keywords (Eg the id of an
object) and objects are created from that data.

At the moment this command is listed as a cron job, so the mailbox is
polled for mail every x minutes, but I'm sure it could be setup so that
the mail server calls the script when it gets mail.

But it's not stand-alone and the security issues around spoof mails
described by Melvyn Sopacua are not resolved.

I like the idea of "secret email addresses". I think this is what
spamcop.net does.

Paul


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django app to update site through email

2012-08-10 Thread Paul Backhouse
Hi there,

The Django site I'm working on at the moment sends out emails when
content is created/updated, using django-notifications.

A feature I would like to add is where users can reply to these mails,
ie comment on a topic. This reply then appears updated on the site.

I've already written something that does this, but it's very application
specific.

Ideally it would be done in a generic way (as its own app), with
something in the admin interface to set up the email account, and then
maybe a list of ordered filters to pass over the email and consequently
generate various model instances.

Has this already been done? Does my google-fu escape me? If it hasn't
already been done, why not? And are there any modules out there that can
be dropped in to speed development? Any tips on developing this app?

Thanks,

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.