Running makemessages with domain djangojs results in UnicodeDecodeError

2022-04-06 Thread Benedikt Karl
Hello,

I am using the provided localization by Django. I wanted to use gettext 
with some of my javascript files and thus enabled the JavaScriptCatalog and 
executed this command:

python manage.py makemessages -d djangojs -l de

However, this results in a UnicodeDecodeError, ultimately caused 
by popen_wrapper in core/management/utils.py.
I already spent a little time on debugging and found that this is called 
from is_templatized in makemessages.py, which tries to check the installed 
xgettext version. If I simply omit this check by always returning True 
there, makemessages succeeds and it also finds the correct messages in my 
JavaScript files.

The exact error raised is:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 49: 
invalid start byte
Also, DEFAULT_LOCALE_ENCODING is set to cp65001.
When manually calling run from python with the arguments like in 
popen_wrapper, the invalid byte (0xa9) is clearly visible:
"xgettext (GNU gettext-tools) 0.19.8.1\r\nCopyright \xa9 1995-1998, ..."

Am I missing something?

I am using Django version 4.0.3, Windows version 21H1, Python 3.10.3 (with 
Miniconda).
Any help would be appreciated.

Kind regards,
Benedikt Karl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/effccba4-8908-4395-a4fb-db6a59003248n%40googlegroups.com.


Links to files

2018-01-05 Thread Karl Ritchie
Hi I'm very new to Django. I tried searching for this but the answers I 
found aren't very clear. I'm wanting to create links to PDF documents.  
I've created an app called writing with a static folder with PDF files. At 
first I just put an html  link in the template file but it when I ran it it 
said it couldn't find the file.
I think I have to change the View.py and URL.py in Writing but what do I 
change it to and what do I put in the template file for the link?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dcd1a1fc-3aac-4562-a8c3-159b846a44c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Create account that can either be a person or a group

2016-05-19 Thread Karl Arunachal
I want to create user accounts for my website. The account can be either a
person or a group. So for *person* account I want to get different
information from them (such as First name, Last Name, ...), and for *group*
account get different information (such as Group name, ...). Basically
different form for *person* account and *group* account. The account itself
will have a unique primary key ( such as username/account id).

How should I do it? Should I make one to one relationship with account and
person, and the same with account and group? Or create just on Account
model and place a choice field to choose between Person and Group? Or how
do you prefer I should do it?


Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPXAsR1nYd8-hF88HSRgS8Zm8iDktxxcZ84u8wXfyrw7mU3tQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django summernote not working properly

2013-10-13 Thread Karl Arunachal
I am using django-summernote  as
a wysiwyg editor. And till now, I can save the post from the summernote
editor and can display it too using the safe filter. But some of its
functionalities are not there in my template.

   1. There is no image upload button in the editor.
   2. The Code style is displaying fine, but the Quote style is displaying
   just a regular text.

And finally, is it safe to use safe filter in the templates?

Please help me how do I solve this problem. Or I can't use it in django?
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPXAsR2RMRG-_-zNPS3H0QzCODMDN2zxedhqJiQT-Gp71kz0mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Deployment + Apache2] difference between development server & production server

2013-09-18 Thread Karl Arunachal
Its always a pleasure. Have fun coding!


On Mon, Sep 16, 2013 at 11:20 PM, hung david wrote:

>
>
> On Monday, September 16, 2013 2:05:56 AM UTC+7, Kakar wrote:
>>
>> I dont know what you actually mean, but I think just by passing the url
>> that you have created in the urls.py, which points to the function you have
>> defined in ur views.py should work.
>>
>>
>>
> Yes you are right Kakar. I've figured it out and here is the solution I
> got ( the same as you say, but more specific ) :
> https://groups.google.com/forum/#!topic/django-users/ourayJhe1oY
> Thank you for the confirmation. This community is beautiful :D
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Resize image size in the view

2013-09-11 Thread Karl Arunachal
Hello Carlos! I tried using sorl thumbnail, but whenever I uploads the
image, it does upload the image cause I can see it in the folder, but the
apache server does not load the uploaded image. But when I load it through
the django's inbuilt server it loads the image correctly.


On Wed, Sep 11, 2013 at 11:37 AM, carlos  wrote:

> Hi you try use http://sorl-thumbnail.readthedocs.org/en/latest/
> is good
>
> Cheers
>
>
> On Tue, Sep 10, 2013 at 10:53 PM, Robin Lery  wrote:
>
>> Hello,
>> I have been trying to achieve thumbnail for the uploaded images, but it
>> just don't seem to resize the image on the apache server when the page is
>> loaded. Only when I run through the django's inbuilt server, it loads the
>> uploaded image. So, is there any way, that I can specify the size of the
>> image in the views and then call it in the template? Please help me here.
>> Thank you.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: message_set filter

2013-08-18 Thread Karl Arunachal
Suppose, A is the request.user. And 'msg' has all the mesasges sent by the
user A and all the messages that A has received. Now how will I separate
the messages for each user from 'msg', to make it like an Inbox for A. I
think I have made it clear now. If not, please ask again.
Thank you.


On Sun, Aug 18, 2013 at 2:17 PM, Avraham Serour <tovm...@gmail.com> wrote:

> so what's the question?
>
>
> On Sat, Aug 17, 2013 at 7:52 AM, Karl Arunachal <
> kakararunachalserv...@gmail.com> wrote:
>
>> Hello,
>> I have a model for messaging between the users.
>>
>> models.py:
>>
>> class Message(models.Model):
>> description = models.TextField()
>> date_added = models.DateTimeField(default=datetime.now)
>> sender = models.ForeignKey(User, related_name='sent_set')
>> recipient = models.ForeignKey(User, related_name='recieved_set')
>>
>> def __unicode__(self):
>> return "%s sent message: %s to %s" % (self.sender, self.description, 
>> self.recipient)
>>
>> def save(self, **kwargs):
>> if self.sender == self.recipient:
>> raise ValueError("Cannot message yourself")
>> super(Message, self).save(**kwargs)
>>
>>
>>
>> Till now I get all the messages (sent/recieved) of a particular user,
>>
>> from django.db.models import Q
>>
>>
>>
>> A = request.usermsg = Message.objects.filter(Q(sender=A)|Q(recipient=A))
>>
>>
>>
>> Suppose, msg has all the messages sent and recieved for user 'A'. Now
>> how would i filter from this 'msg',  all the message sent to and recieved
>> from a particular user 'B'.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: As a New Bee

2013-08-17 Thread Karl Arunachal
Pycharm!


On Fri, Aug 16, 2013 at 7:58 PM, Apokalyptica Painkiller <
apokalyptic...@gmail.com> wrote:

> Hello Sujeet try this IDE: http://ninja-ide.org/
>
> I hope you like it!
>
>
> 2013/8/16 Sujeet Buddiga 
>
>> Hi Djano'ans,
>>Im a new bee to Django and would like to work with an
>> IDE. Please suggest proper tutorials with IDE that can make my learning
>> process simpler,easire and faster.
>>
>> *Please Dont mind if my English is not good.
>>
>>
>>
>> Thanks in Advance,
>> Sujeet
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> I live each day
> Like it's my last
> I live for rock and roll
> I never look back
>
> I'm a rocker
> Do as I feel as I say
> I'm a rocker
> And no one can take that away
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


message_set filter

2013-08-16 Thread Karl Arunachal
Hello,
I have a model for messaging between the users.

models.py:

class Message(models.Model):
description = models.TextField()
date_added = models.DateTimeField(default=datetime.now)
sender = models.ForeignKey(User, related_name='sent_set')
recipient = models.ForeignKey(User, related_name='recieved_set')

def __unicode__(self):
return "%s sent message: %s to %s" % (self.sender,
self.description, self.recipient)

def save(self, **kwargs):
if self.sender == self.recipient:
raise ValueError("Cannot message yourself")
super(Message, self).save(**kwargs)



Till now I get all the messages (sent/recieved) of a particular user,

from django.db.models import Q

A = request.usermsg = Message.objects.filter(Q(sender=A)|Q(recipient=A))



Suppose, msg has all the messages sent and recieved for user 'A'. Now how
would i filter from this 'msg',  all the message sent to and recieved from
a particular user 'B'.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: south in windows

2013-08-12 Thread Karl Arunachal
Thank you! That solved my problem.


On Mon, Aug 12, 2013 at 5:05 AM, Mike Dewhirst <mi...@dewhirst.com.au>wrote:

> On 12/08/2013 5:36am, Karl Arunachal wrote:
>
>> Hi,
>> I am trying to sync south in my db, but i can't sync it. Its giving me
>> an error:
>> (use ./manage.py migrate to migrate these)
>> Is there anyway to do this command, "./manage.py", in windows. I could
>> have done it by chmod + x manage.py in other os. But how do i do it in
>> windows? Is there any other way around to sync south in windows?
>> Thank you.
>>
>
> In Windows, the ./ is unnecessary. The command you want is ...
>
>  C:\path\to\managepy\python manage.py migrate
>
> ... where Windows knows how to launch Python and Python knows that
> manage.py is in the current working directory.
>
> hth
>
>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to 
>> django-users+unsubscribe@**googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>> .
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at 
>> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users>
>> .
>> For more options, visit 
>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>> .
>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> django-users+unsubscribe@**googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




south in windows

2013-08-11 Thread Karl Arunachal
Hi,
I am trying to sync south in my db, but i can't sync it. Its giving me an
error:
(use ./manage.py migrate to migrate these)
Is there anyway to do this command, "./manage.py", in windows. I could have
done it by chmod + x manage.py in other os. But how do i do it in windows?
Is there any other way around to sync south in windows?
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help getting started: Which server setup for a beginner? Apache? lighttpd? To use or not virtualenv?

2013-07-30 Thread Karl Arunachal
If you are in windows, I guess i can help you.


On Tue, Jul 30, 2013 at 9:18 PM, Jared Nielsen wrote:

> I'm trying to learn Django but finding myself lost in troubleshooting
> hell. I can't find consistent information on the best approach for a
> beginner to get set up.
>
> I started setting up Apache with mod_wsgi, but ran into innumerable config
> errors. After some Googling about, I found a number of suggestions to use
> lighttpd instead. Installed that and more troubleshooting. And what's this
> about gunicorn?
>
> What's the best approach for a beginner? Where is my time best spent
> troubleshooting?
>
> Also, should I be using virtualenv? Inconsistent use across the various
> tutorials I'm reading.
>
> Many thanks in advance!
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: background image

2013-07-30 Thread Karl Arunachal
Thank you. I will try as you told me. Just one more question, how do i
create different static directory for each user?


On Tue, Jul 30, 2013 at 5:37 PM, Christian Erhardt <
christian.erha...@mojo2k.de> wrote:

> Generally speaking you could extend the users profile and add a field to
> it. Then you could store the image during registration or when a user
> updates his settings. On the page where you want to show the image you
> could check for a image in the profile and show it.
>
> I started my project with pinax, which already hat the
> app django-user-accounts included, i then created a custom profile for my
> users (something like here:
> http://blog.tivix.com/2012/01/06/extending-user-model-in-django/). Now
> you have to adjust the forms for registering and modifying the user
> settings, so the user can set the fields you added to the profile (somewhat
> like this: http://dewful.com/?p=70). The form must contain a file upload
> field where the user can upload the image. Then i would save the image
> somewhere on the server, where you can access it from an template.
>
> Sorry, that i can not provide a step by step solution, but i hope i could
> push you in the right direction.
>
> regards Christian
>
> Am Dienstag, 30. Juli 2013 08:07:43 UTC+2 schrieb Kakar:
>
>> Hello,
>> What do I do to let user upload their own images, and as use it as their
>> profile's background.
>> I am out of clue. Please advice me.
>>
>> Thank you.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: flatpages-tinymce

2013-07-30 Thread Karl Arunachal
Thank you.


On Sun, Jul 28, 2013 at 7:03 PM, Roberto López López
<roberto.lo...@uni.no>wrote:

>
> Your message is quite confusing and difficult to understand, I have to
> say. What are you asking for? To show tinymce within your change_form or
> within the admin app? What do you mean by "flat pages"? Which error are you
> getting?
>
>
>
>
> On 07/28/2013 08:35 AM, Karl Arunachal wrote:
>
>  Hello,
>  I am trying to use tinymce in the flat pages. But i just can't show it up
> in my admin. Please help me out where am going wrong.
>
> The javascript file is in:
>
> C:\Users\Kakar\web\cms\static\js\tinymce\tinymce.min.js
>
> urls.py:
>
> (r'^tiny_mce/(?P.*)$', 'django.views.static.serve', {
> 'document_root': 'C:/Users/Kakar/web/cms/static/js/tinymce' }),
>
> In my templates dir i have another admin folder, which have the
> change_form.html, and right after {{ media }}:
>
> 
> 
> tinyMCE.init({
> mode: "textareas",
> theme: "simple"
> });
> 
>
>  Please help me out. Thank you.
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
> --
>
> Roberto López López
> System Developer
> Parallab, Uni Computing
> +47 55584091
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




background image

2013-07-30 Thread Karl Arunachal
Hello,
What do I do to let user upload their own images, and as use it as their
profile's background.
I am out of clue. Please advice me.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




flatpages-tinymce

2013-07-28 Thread Karl Arunachal
Hello,
I am trying to use tinymce in the flat pages. But i just can't show it up
in my admin. Please help me out where am going wrong.

The javascript file is in:

C:\Users\Kakar\web\cms\static\js\tinymce\tinymce.min.js

urls.py:

(r'^tiny_mce/(?P.*)$', 'django.views.static.serve', { 'document_root':
'C:/Users/Kakar/web/cms/static/js/tinymce' }),

In my templates dir i have another admin folder, which have the
change_form.html, and right after {{ media }}:



tinyMCE.init({
mode: "textareas",
theme: "simple"
});


Please help me out. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




tinymce

2013-07-27 Thread Karl Arunachal
Hello,
I am not able to use the tinymce editor in my flat pages.
My tinymce is in this dir:
C:\Users\Kakar\Downloads\Compressed\tinymce\js\tinymce\tinymce.min.js

And in my template dir i have another admin folder for 'change_form.html',
just below this line:



i have added this line for tiymce:



tinyMCE.init({
mode: "textareas",
theme: "simple"
});


In my urls.py, i have added:

(r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
{'document_root':'C:/Users/Kakar/Downloads/Compressed/tinymce/js/tinymce'}),

Please, point me out, where am doing wrong. I am learning from a book
'Practical Django Projects'.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




tinymce

2013-07-26 Thread Karl Arunachal
Hi,
I want to integrate tinymce in my text area. But i can't find any good
tutorials for it. Can some someone please advice me how to do this.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CSRF in javascript

2013-07-21 Thread Karl Arunachal
Ok! I will check. Thank you!


On Sun, Jul 21, 2013 at 4:27 AM, Fred Stluka <f...@bristle.com> wrote:

>  Karl,
>
> You are calling render_to_response() wrong.  See the docs at:
>
> https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#render-to-response
>
> Instead of:
>
>
> variables = RequestContext(request, {
> 'bookmarks':[bookmark],
> 'show_edit':True,
> 'show_tags':True
> })
> return render_to_response('bookmark_list.html', variables)
>
> try:
>
> variables = {
>
> 'bookmarks':[bookmark],
> 'show_edit':True,
> 'show_tags':True
> }
> return render_to_response('bookmark_list.html', variables,
> RequestContext(request))
>
>
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com <f...@bristle.com> --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>
> On 7/20/13 3:39 PM, Karl Arunachal wrote:
>
>   I am sorry, i am really new to this things. Could you please point me
> out as to where I should add it.
>
> *js file:
>
> *function bookmark_edit() {
> var item = $(this).parent();
> var url = item.find(".title").attr("href");
> item.load("/save/?ajax=" + escape(url), null, function () {
> $("#save-form").submit(bookmark_save);
> });
> return false;
> }
>
> $(document).ready(function () {
> $("ul.bookmarks .edit").click(bookmark_edit);
> });
>
> function bookmark_save() {
> var item = $(this).parent();
> var data = {
> url: item.find("#id_url").val(),
> title: item.find("#id_title").val(),
> tags: item.find("#id_tags").val()
> };
> $.post("/save/?ajax", data, function (result) {
> if (result != "failure") {
> item.before($("li", result).get(0));
> item.remove();
> $("ul.bookmarks .edit").click(bookmark_edit);
> }
> else {
> alert("Failed to validate bookmark before saving.");
> }
> })
> return false;
> }
>
>  *save_form.html:
>
> *
> {% csrf_token %}
> {{form.as_p}}
> 
> 
>
>
>
>  *user_page.html:*
>
> {% extends "base.html" %}
> {% block external %}
> 
> {% endblock %}
> {% block title %} {{username}} {% endblock %}
> {% block head %} Bookmarks for {{username}} {% endblock %}
> {% block content %}
> {% include "bookmark_list.html" %}
> {% endblock %}
>
>
>  *views.py:*
>
> @login_required(login_url='/login/')
> def bookmark_save_page(request):
> ajax = request.GET.has_key('ajax')
> if request.method == 'POST':
> form = BookmarkSaveForm(request.POST)
> if form.is_valid():
> bookmark = _bookmark_save(request, form)
> if ajax:
> variables = RequestContext(request, {
> 'bookmarks':[bookmark],
> 'show_edit':True,
> 'show_tags':True
> })
> return render_to_response('bookmark_list.html', variables)
> else:
> return HttpResponseRedirect('/user/%s/' %
> request.user.username
> )
> else:
> if ajax:
> return HttpResponseRedirect('failure')
> elif request.GET.has_key('url'):
> url = request.GET['url']
> title = ''
> tags = ''
>
> try:
> link = Link.objects.get(url=url)
> bookmark = Bookmark.objects.get(
> link=link,
> user = request.user
> )
> title = bookmark.title
> tags = ' '.join(
> tag.name for tag in bookmark.tag_set.all()
> )
> except ObjectDoesNotExist:
> pass
> form = BookmarkSaveForm({
> 'url':url,
> 'title':title,
> 'tags':tags
> })
> else:
> form = BookmarkSaveForm()
>
> variables = RequestContext(request, {
> 'form': form
> })
> if ajax:
> return render_to_response(
> 

Re: CSRF in javascript

2013-07-20 Thread Karl Arunachal
I am sorry, i am really new to this things. Could you please point me out
as to where I should add it.

*js file:

*function bookmark_edit() {
var item = $(this).parent();
var url = item.find(".title").attr("href");
item.load("/save/?ajax=" + escape(url), null, function () {
$("#save-form").submit(bookmark_save);
});
return false;
}

$(document).ready(function () {
$("ul.bookmarks .edit").click(bookmark_edit);
});

function bookmark_save() {
var item = $(this).parent();
var data = {
url: item.find("#id_url").val(),
title: item.find("#id_title").val(),
tags: item.find("#id_tags").val()
};
$.post("/save/?ajax", data, function (result) {
if (result != "failure") {
item.before($("li", result).get(0));
item.remove();
$("ul.bookmarks .edit").click(bookmark_edit);
}
else {
alert("Failed to validate bookmark before saving.");
}
})
return false;
}

*save_form.html:

*
{% csrf_token %}
{{form.as_p}}





*user_page.html:*

{% extends "base.html" %}
{% block external %}

{% endblock %}
{% block title %} {{username}} {% endblock %}
{% block head %} Bookmarks for {{username}} {% endblock %}
{% block content %}
{% include "bookmark_list.html" %}
{% endblock %}


*views.py:*

@login_required(login_url='/login/')
def bookmark_save_page(request):
ajax = request.GET.has_key('ajax')
if request.method == 'POST':
form = BookmarkSaveForm(request.POST)
if form.is_valid():
bookmark = _bookmark_save(request, form)
if ajax:
variables = RequestContext(request, {
'bookmarks':[bookmark],
'show_edit':True,
'show_tags':True
})
return render_to_response('bookmark_list.html', variables)
else:
return HttpResponseRedirect('/user/%s/' %
request.user.username
)
else:
if ajax:
return HttpResponseRedirect('failure')
elif request.GET.has_key('url'):
url = request.GET['url']
title = ''
tags = ''

try:
link = Link.objects.get(url=url)
bookmark = Bookmark.objects.get(
link=link,
user = request.user
)
title = bookmark.title
tags = ' '.join(
tag.name for tag in bookmark.tag_set.all()
)
except ObjectDoesNotExist:
pass
form = BookmarkSaveForm({
'url':url,
'title':title,
'tags':tags
})
else:
form = BookmarkSaveForm()

variables = RequestContext(request, {
'form': form
})
if ajax:
return render_to_response(
'bookmark_save_form.html',
variables
)
else:
return render_to_response('bookmark_save.html',variables)

Please help me out. Thank you.


On Sun, Jul 21, 2013 at 12:53 AM, Fred Stluka <f...@bristle.com> wrote:

>  Karl,
>
> Since you already have a form, and are already submitting it
> as an Ajax request via JavaScript, the easiest way is to just
> put the {% csrf_token %} in the Django template for the page.
> We do that for our Ajax forms.
>
> If you are not using a Django template to generate the form,
> there are lots of other convenient options.  See:
> - https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
> and especially:
> - https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax
>
> Also, you can find tons of working examples by Googling:
> django csrf ajax
>
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com <f...@bristle.com> --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>
> On 7/20/13 3:05 PM, Karl Arunachal wrote:
>
>   Hi,
>  In my users page, i have in place editing with ajax. And when i click
> edit, it works fine. But when i submit the form, it don't do anything. When
> i checked, this is the error:
>
> CSRF verification failed. Request aborted.
>
>  So, how do I place {% csrf_token %} in my javascript? Please advice.
>
>  Thank you.
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post 

CSRF in javascript

2013-07-20 Thread Karl Arunachal
Hi,
In my users page, i have in place editing with ajax. And when i click edit,
it works fine. But when i submit the form, it don't do anything. When i
checked, this is the error:

CSRF verification failed. Request aborted.

So, how do I place {% csrf_token %} in my javascript? Please advice.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Allow users to have a online store on the site

2013-07-19 Thread Karl Arunachal
Hello,
There's one plugin for wordpress called Marketpress E commerce, it has many
features, but what i am interested is that, with that plugin users can
create online store in your site and sell their products. So, is there any
plugin or package like Marketpress for django, which have this features?
I googled in this mater for hours, but didn't got any helpful answers.
Please advice if anybody knows about this stuff.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: noob "hello world" problem with URLconf

2013-04-30 Thread Karl
^ is only start with hello. it may be your issues in urls.py



Karl

Programmer at Olivet Institute of Technology
http://oit.olivetuniversity.edu/

在 2013年4月30日星期二UTC-4下午1时25分41秒,lev...@gmail.com写道:
>
> what´s up everyone. I just installed Django for the first time, leaving 
> php in the closet for a while. 
>
> My problem is concerning the url patterns. I´ve pasted the example "Hello 
> world" code directly from the django book to urls.py and views.py so I´ll 
> leave out all extra code since it has something to do with my configuration.
>
>
> http://www.djangobook.com/en/2.0/chapter03.html
>
> This works:
> url(r'hello/$', hello),
>
> This doesn´t:
> url(r'^hello/$', hello),
>
> Hopefully someone can help.
>
> N
>

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




Re: Adding more data to Generic Views

2012-07-31 Thread Karl Sutt
So, in conclusion, Lachlan, you would want to do something like:

 def get_context_data(self,**kwargs):
> #Call the base implementation first to get a context
> context = super(PersonDetailView, self).get_context_data(**kwargs)
> #Add in a querysets
> context['job_list'] =
> Vacancy.complete.filter(person_id=self.kwargs[self.pk_url_kwarg])
> context['certificate_list'] =
> Certificate.objects.filter(person_id=self.kwargs[self.pk_url_kwarg])
> context['claim_list'] =
> Compensation.objects.filter(person_id=self.kwargs[self.pk_url_kwarg])
> return context


I have not tested this, but it gives you the idea. You'll want to filter
the Vacancy, Certificate and Compensation objects by the person's ID.

Good luck

Tervitades/Regards
Karl Sutt


On Tue, Jul 31, 2012 at 12:07 PM, Per-Olof Åstrand
<p.o.aastr...@gmail.com>wrote:

> Hi,
>
> I just started to convert my small hobby-project into class-based views
> and struggled with similar things (but with a ListView instead).
>
> The person object is in the context dictionary, so you need to refer to it
> by context['person'].
>
> More generally, it is instructive to print context, kwargs and self.kwargs
> inside the get_context_data method. That would give you the information you
> need. It took me some time to realize that url-captured parameters are
> available in self.kwargs.
>
> Per-Olof
>
>
> On Tuesday, July 31, 2012 6:17:26 AM UTC+2, Lachlan Musicman wrote:
>>
>> Hola,
>>
>> I'm confused about adding extra content to a class based Generic View.
>> I've read
>> the docs at file:///home/datakid/src/**django-docs/topics/class-**
>> based-views.html
>> and have written the code accordingly.
>>
>> I have Person, Certificate, Job and Compensation objects. The last three
>> all
>> have an FK (or M2M) back to a (or some) Person(s).
>>
>> My DetailView subclass (which I've put in views.py - is there a better or
>> more
>> correct place for it?)
>>
>> class PersonDetailView(DetailView):
>> context_object_name = "person"
>> model = Person
>>
>> def get_context_data(self,kwargs):
>> #Call the base implementation first to get a context
>> context = super(PersonDetailView, self).get_context_data(
>> kwargs)
>> #Add in a querysets
>> context['job_list'] = Vacancy.complete.all()
>> context['certificate_list'] = Certificate.objects.all()
>> context['claim_list'] = Compensation.objects.all()
>> return context
>>
>> But I don't want the full list of Vacancies, Certificates or Claims - I
>> just
>> want those that are linked to the person - how can I filter by these?
>> I've tried
>> .filter(self.get_id)
>> .filter(self.request.get_id)
>> .filter(self.person.get_id)
>> .filter(self.request.person.**get_id)
>> .filter(applicants__get_id__**exact=self.get_id) (in the case of
>> Vacancy) etc
>>
>> How do I filter by the person object that is already in the context?
>> I know the answer is simple - I should wait until tomorrow when my brain
>> is
>> fresher, but I want to finish this off tonight if possible.
>>
>> Of course, the other thing that I can't help but thinking is that at this
>> point, the non-generic-view method of urls/views might be a simpler way to
>> go. While Generic Views are quite versatile,  is there a point at which
>> they are considered to restricting?
>>
>> L.
>>
>  --
> 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/-/6O_nqDwvAAEJ.
>
> 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: form.save() fails silently - how to debug?

2012-07-26 Thread Karl Sutt
I think

> results = formset.save(commit=False)
> formset.save()

should be

> results = formset.save(commit=False)
> results.save()


Tervitades/Regards
Karl Sutt


On Thu, Jul 26, 2012 at 10:35 AM, Derek <gamesb...@gmail.com> wrote:

> I'd appreciate some help with the following problem, under Django 1.4
>
> When running with the models, forms and view as described below, the data
> from the form is *not* saved into the model.
>
> However, when using the test code (shown at the end) in a shell
> environment, the data *is* saved as expected.
>
> How can I tell why the form data is not saved in the view?  It appears to
> "fail silently" (i.e. no errors reported) - but adding print statements
> into the code reveal that the correct data is available just before the
> .save() function.  Is there a preferred approach for debugging this type of
> situation?
>
> Thanks
> Derek
>
>
> # models
> class ClientFile(Model):
> id = AutoField(primary_key=True)
> description = CharField(unique=True, max_length=255)
> file = FileField(upload_to='client', storage=CLIENT_STORAGE)
>
>
> class ClientData(Model):
> id = AutoField(primary_key=True)
> clientfile = ForeignKey(ClientFile)
> #
> http://code.google.com/p/django-geo/source/browse/trunk/fields.py?r=13#49
> data_set = DictionaryField(blank=True, null=True)
>
>
> # forms
> class ClientDataForm(ModelForm):
>
> class Meta:
> abstract = True
> model = ClientData
> widgets = {
> 'data_set': HiddenInput(),
> 'clientfile': HiddenInput()
> }
>
>
> class ClientDataFormLayout(ClientDataForm):
> label = CharField(max_length=255)
> top_left = CharField(max_length=255)
> bottom_right = CharField(max_length=255)
>
> def __init__(self, *args, **kwargs):
> super(ClientDataForm, self).__init__(*args, **kwargs)
>
> class Meta(ClientDataForm.Meta):
> pass
>
> def clean(self):
> cleaned = self.cleaned_data
> # copy for alteration
> cleaned_data = copy.deepcopy(self.cleaned_data)
> del cleaned_data['data_set']
> del cleaned_data['clientfile']
> cleaned['data_set'] = cleaned_data
> return cleaned
>
>
> # view
> client_dataform_layout = ClientDataFormLayout()
> client = get_object_or_404(ClientFile, pk=1)
> initial = {'clientfile': client}
> if request.method == 'POST':
> formset = client_dataform_layout(request.POST, instance=client)
> if formset.is_valid():
> results = formset.save(commit=False)
> form_data = formset.cleaned_data  #  test only
> formset.save()
> else:
> formset = client_dataform_layout(instance=client, initial=initial)
> return render_to_response("clients/client_data.html",
>   locals(),
>   RequestContext(request))
>
>
> # test code
> formset = ClientDataFormLayout(data {'clientfile': 1, 'data_set': '',
>  'top_left': 'AA', 'bottom_right':
> 'ZZ',
>  'label': 'foobar'})
> print formset.is_valid()
> results = formset.save(commit=False)
> formset.save()
> cd = ClientData.objects.get(clientfile__pk=1)
> print cd.data_set
>
>  --
> 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.
>

-- 
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: view didn't return an HttpResponse object....plz help

2012-07-06 Thread Karl Sutt
There is no HttpResponse object returned if the form is *not* valid. You
might want to return a template saying that the form input was incorrect.

Tervitades/Regards
Karl Sutt


On Fri, Jul 6, 2012 at 11:49 AM, manish girdhar
<manishgirdha...@gmail.com>wrote:

> hii tom,
> yeah i have rectidy rollno = cd["rollno"] ,but again am getting error
> didn't get an httpresponse object...
>
> this is my view.
>
>
> def studentid(request):
> if request.method == 'POST':
> form = Student_loginForm(request.POST)
> if form.is_valid():
> cd = form.cleaned_data
> rollno = cd['rollno']
> return
> HttpResponseRedirect(reverse('record_system.views.search' , args=(rollno)))
> else:
> form = Student_loginForm()
>
> return render_to_response('add_record/studentid.html',
> context_instance=RequestContext(request))
>
>
> the error is in* "if form.is_valid: "*..its getting false and ultimately
> the further process is not going on..
>
> thanks in advance.
>
>
> On Thu, Jul 5, 2012 at 7:34 PM, Tom Evans <tevans...@googlemail.com>wrote:
>
>> On Thu, Jul 5, 2012 at 8:38 AM, manish girdhar
>> <manishgirdha...@gmail.com> wrote:
>> > yes it was indentation error and i rectified that.thanks for the concern
>> > friend..
>> >
>>
>> I would have thought that it was you refering to the undefined
>> variable rollno here:
>>
>> cd = form.cleaned_data
>> rollno = cd[rollno]
>> rollno = request.POST.get(rollno)
>>
>> Should it not read:
>>
>> cd = form.cleaned_data
>> rollno = cd["rollno"]
>> rollno = request.POST.get(rollno)
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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: have an object available in every templates

2012-06-28 Thread Karl Sutt
I think you can do it with Middleware.
https://docs.djangoproject.com/en/1.4/topics/http/middleware/#writing-your-own-middleware
Specifically, I think it's worth looking into the
"process_template_response" method.

Tervitades/Regards
Karl Sutt


On Thu, Jun 28, 2012 at 3:11 PM, Bastian <bastien.roche...@gmail.com> wrote:

> Hi,
>
> I don't know if this is possible or how to do it. I would like to write a
> sort of context processor where I pass an object to the template. I have
> always passed strings to these variables. Let's say I have a Book model and
> in a view I list the latest books I've added to the database. In the
> corresponding template I will then have an objects list with these objects.
> But I also want to be able to call a variable containing another list of
> objects, say my favorite books, without having to pass it explicitly from
> the view and being able to call it from any template.
> Can I do it with context processors, or anything else actually?
>
> Thanks.
>
> --
> 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/-/sLXf508kb4gJ.
> 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 1.4 + grappelli 2.4: missing css, img files.

2012-06-28 Thread Karl Sutt
Ali,

Given that your static directory is STATIC_URL = '/static/' and STATIC_ROOT
is something like os.path.join(PROJECT_PATH, "static"), add

> ADMIN_MEDIA_PREFIX = '/static/grappelli/' (or whatever your static
> directory is) to your settings.py


That should do the trick.

Tervitades/Regards
Karl Sutt


On Thu, Jun 28, 2012 at 5:07 AM, bruce <brucehar...@gmail.com> wrote:

> Dear All,
>
> I know this problem is related with grappelli. But it may be a django
> configure problem. So I am posting my question here.
> If it is inappropriate, please let me know.
>
> I followed the django 1.4's tutorial to setup the 'polls' app and it was
> successful.
> I also followed the grappelli 2.4 quick start guide.
> http://django-grappelli.**readthedocs.org/en/grappelli_**
> 2_4/quickstart.html<http://django-grappelli.readthedocs.org/en/grappelli_2_4/quickstart.html>
>
> I followed every step and didn't do anything else.
> The last command is:
> python manage.py collectstatic
> After this command is executed, two new directories were created(admin and
> grappelli).
>
> The directory is as follows:
>  root@ubuntu:/home/hduser/**django/mysite# pwd
> /home/hduser/django/mysite
> root@ubuntu:/home/hduser/**django/mysite# ls
> admin  grappelli  manage.py  mysite  mytemplate  polls
>
> Finally,
> I can access the http://127.0.0.1:8000/**admin<http://127.0.0.1:8000/admin>
> But, the css,img files are missing. Please see the attached screen shot
> picture.
>
> The python manage.py runserver show:
> [27/Jun/2012 21:36:19] "GET /admin/css/base.css HTTP/1.1" 404 4468
> [27/Jun/2012 21:36:19] "GET 
> /admin/jquery/ui/css/custom-**theme/jquery-ui-1.8.custom.css
> HTTP/1.1" 404 4585
> [27/Jun/2012 21:36:19] "GET /admin/css/jquery-ui-**grappelli-extensions.css
> HTTP/1.1" 404 4546
> [27/Jun/2012 21:36:19] "GET /admin/jquery/jquery-1.6.2.**min.js HTTP/1.1"
> 404 4510
> [27/Jun/2012 21:36:19] "GET 
> /admin/jquery/ui/js/jquery-ui-**1.8.15.custom.min.js
> HTTP/1.1" 404 4561
> [27/Jun/2012 21:36:19] "GET /admin/js/grappelli/grappelli.**js HTTP/1.1"
> 404 4507
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_collapsible.js
> HTTP/1.1" 404 4546
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_timepicker.js
> HTTP/1.1" 404 4543
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_collapsible_group.js
> HTTP/1.1" 404 4564
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_related_fk.js
> HTTP/1.1" 404 4543
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_related_m2m.js
> HTTP/1.1" 404 4546
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_related_generic.js
> HTTP/1.1" 404 4558
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_autocomplete_fk.js
> HTTP/1.1" 404 4558
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_autocomplete_m2m.js
> HTTP/1.1" 404 4561
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_autocomplete_generic.js
> HTTP/1.1" 404 4573
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_timepicker.js
> HTTP/1.1" 404 4543
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_related_fk.js
> HTTP/1.1" 404 4543
> [27/Jun/2012 21:36:20] "GET /admin/js/grappelli/jquery.**grp_related_m2m.js
> HTTP/1.1" 404 4546
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_related_generic.js
> HTTP/1.1" 404 4558
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_autocomplete_fk.js
> HTTP/1.1" 404 4558
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_autocomplete_m2m.js
> HTTP/1.1" 404 4561
> [27/Jun/2012 21:36:20] "GET 
> /admin/js/grappelli/jquery.**grp_autocomplete_generic.js
> HTTP/1.1" 404 4573
>
>
>
> Would you please tell me how to fix it?
> Why 404?
> I know I am supposed to read some web links. Please tell me.
> Thank you!!
>
> --
> 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/-/egmDj5ZbW40J.
> 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: Help - Which IDE is best to use.

2012-05-15 Thread Karl Sutt
I use Vim, for everything involving writing -- coding, producing
papers/articles/reports, editing existing code and documents. It is not an
IDE, but a text editor, and it is absolutely excellent. Once you learn Vim,
you'll never want to use anything else (this is the case for me, at least).
The learning curve is rather steep, but after you get used to the different
modes, moving around and editing text efficiently, you start to see and
appreciate the power of the keyboard.

The downside is that it does not come with documentation built in, or the
code-checking and all that fancy stuff, like the bigger counterparts
(Eclipse, Aptana, pyCharm etc), but I personally don't need it.
The upside is that you are not tied to a specific IDE for a specific
language/framework. Vim lets you edit code and text efficiently, regardless
of what language/framework/task you are working with.

Obviously, my goal is not to say Vim (another example is GNU Emacs) is the
best editor ever, but to let people know of tools that have been around
since the beginning of first operating systems. They have been perfected
over the past 20 years by professionals, people who wrote the very
operating systems you use today.

For a beginner programmer, my suggestion is to always start with the
simplest tools possible, and not let one IDE do everything for you, without
you understanding the process. The downside is that you'll have to put in a
lot more effort to get going and you don't get the fancy add-ons. But the
upside (in my opinion, anyway) is that you gain a deeper understanding of
how these things fit together, giving you a better insight into whatever
you're working on. Don't be afraid to get your hands dirty :-)

Karl Sutt


On Tue, May 15, 2012 at 10:51 AM, cougar cougar <cougar2...@gmail.com>wrote:

> ulipad , free  and build with wxpython
>
>
> 2012/5/14 Sanjay M <isanja...@gmail.com>
>
>> I am new to Django, and I was confused in choosing a IDE between Eclipse
>> and aptana studio 3 to edit source code. Kindly suggest me a good one.
>>
>> Thank you in advance,
>> Regards,
>> Sanjay M
>>
>>
>>  --
>> 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/-/2LIdVrSuFpQJ.
>> 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.
>

-- 
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: pre_save vs post_save

2012-05-13 Thread Karl Sutt
I think you can just change the "id" in

instance = sender.objects.get(id=kwargs['instance'].id)


to "iso" and that should to the trick. Try it, as I haven't verified it.
And let us know.

Good luck,

Karl Sutt


On Sun, May 13, 2012 at 2:39 PM, Alireza Savand <alireza.sav...@gmail.com>wrote:

> Okay, i found a problem in it.
> One of my models doesn't use *id* as a default *pk*.
> is use different primary key, called *iso.*
> So here the traceback
> http://dpaste.de/o7kSw/
> It's not working with those model with different primary key :|
>
>
> On Saturday, May 12, 2012 3:13:28 PM UTC+4, Karl Sutt wrote:
>>
>> Thanks. So, in onPreSave, you use kwargs['instance'], assuming it's the
>> instance before saving (which it is, not just in the "current" state). So
>> kwargs['instance'] in both handlers have the same state. If you want to get
>> the current state (the old state, so to speak), you should to something like
>>
>> sender.objects.get(id=kwargs['**instance'].id)
>>
>>
>> This would get you the current state of the that instance.
>>
>> Hope this is clear and helps.
>>
>> Karl Sutt
>>
>  --
> 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/-/b7HViV6o7AoJ.
>
> 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: pre_save vs post_save

2012-05-12 Thread Karl Sutt
Awesome! No problem.

Karl Sutt


On Sat, May 12, 2012 at 12:35 PM, Alireza Savand
<alireza.sav...@gmail.com>wrote:

> Thank you very much Karl, it works!
>
>
> On Sat, May 12, 2012 at 3:13 PM, Karl Sutt <k...@sutt.ee> wrote:
>
>> Thanks. So, in onPreSave, you use kwargs['instance'], assuming it's the
>> instance before saving (which it is, not just in the "current" state). So
>> kwargs['instance'] in both handlers have the same state. If you want to get
>> the current state (the old state, so to speak), you should to something like
>>
>> sender.objects.get(id=kwargs['instance'].id)
>>
>>
>> This would get you the current state of the that instance.
>>
>> Hope this is clear and helps.
>>
>> Karl Sutt
>>
>>
>>
>> On Sat, May 12, 2012 at 12:00 PM, Alireza Savand <
>> alireza.sav...@gmail.com> wrote:
>>
>>> Okay
>>> here the paste
>>> http://dpaste.de/Oa9cM/
>>> And the Model is just *Poll model* from the tutorial on the django
>>> official document.
>>>
>>>
>>> On Sat, May 12, 2012 at 2:44 PM, Karl Sutt <k...@sutt.ee> wrote:
>>>
>>>> Could you provide some code (paste it to dpaste.org for example)?
>>>> Specifically, it would be useful to see your model definition and signal
>>>> connectors etc.
>>>>
>>>> Karl Sutt
>>>>
>>>>
>>>>
>>>> On Sat, May 12, 2012 at 11:38 AM, Alireza Savand <
>>>> alireza.sav...@gmail.com> wrote:
>>>>
>>>>> Thanks for your answer Karl
>>>>> Actually yes, i want to do some versioning on model instance, but the
>>>>> problem is that the state of the model instance in pre_save is same as at
>>>>> the post_save.
>>>>>
>>>>> On Sat, May 12, 2012 at 2:32 PM, Karl Sutt <k...@sutt.ee> wrote:
>>>>>
>>>>>> Regarding pre_save signal, it is useful for doing something with the
>>>>>> "old" instance. Consider a use case where you might want to "archive" all
>>>>>> changes to, say, the user's profile. Every time a user makes a change to
>>>>>> their profile, you want to save the current state of the profile to 
>>>>>> another
>>>>>> table, or another database, and then save the new model (which overwrites
>>>>>> the current state and becomes the new current state). This sort of
>>>>>> mechanism is useful for versioning your model instances. The pre_save
>>>>>> signal allows you to create a hook that does precisely that. That is just
>>>>>> one of the use cases, but I'm sure you can think of others.
>>>>>>
>>>>>> Karl Sutt
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, May 12, 2012 at 10:46 AM, Alireza Savand <
>>>>>> alireza.sav...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> What is the different between pre_save signal and post_save singal.
>>>>>>> I know post_save will emited after model instance saved, and
>>>>>>> pre_save is before the saving the instance[?]
>>>>>>> but what it the point of pre_save when we cannot access the object
>>>>>>> data before the data changes.
>>>>>>> I mean user try to change the model content, like body of a post in
>>>>>>> a blog. using pre_save signal would be reasonable if i can access the
>>>>>>> post's body before the changes or in other word before the actual save()
>>>>>>> happens.
>>>>>>> If i can't access to data before save() happends, So what is the
>>>>>>> point of pre_save ?
>>>>>>>
>>>>>>> --
>>>>>>> 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/-/NLEgGtpvQ4cJ.
>>>>>>> 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

Re: pre_save vs post_save

2012-05-12 Thread Karl Sutt
Thanks. So, in onPreSave, you use kwargs['instance'], assuming it's the
instance before saving (which it is, not just in the "current" state). So
kwargs['instance'] in both handlers have the same state. If you want to get
the current state (the old state, so to speak), you should to something like

sender.objects.get(id=kwargs['instance'].id)


This would get you the current state of the that instance.

Hope this is clear and helps.

Karl Sutt


On Sat, May 12, 2012 at 12:00 PM, Alireza Savand
<alireza.sav...@gmail.com>wrote:

> Okay
> here the paste
> http://dpaste.de/Oa9cM/
> And the Model is just *Poll model* from the tutorial on the django
> official document.
>
>
> On Sat, May 12, 2012 at 2:44 PM, Karl Sutt <k...@sutt.ee> wrote:
>
>> Could you provide some code (paste it to dpaste.org for example)?
>> Specifically, it would be useful to see your model definition and signal
>> connectors etc.
>>
>> Karl Sutt
>>
>>
>>
>> On Sat, May 12, 2012 at 11:38 AM, Alireza Savand <
>> alireza.sav...@gmail.com> wrote:
>>
>>> Thanks for your answer Karl
>>> Actually yes, i want to do some versioning on model instance, but the
>>> problem is that the state of the model instance in pre_save is same as at
>>> the post_save.
>>>
>>> On Sat, May 12, 2012 at 2:32 PM, Karl Sutt <k...@sutt.ee> wrote:
>>>
>>>> Regarding pre_save signal, it is useful for doing something with the
>>>> "old" instance. Consider a use case where you might want to "archive" all
>>>> changes to, say, the user's profile. Every time a user makes a change to
>>>> their profile, you want to save the current state of the profile to another
>>>> table, or another database, and then save the new model (which overwrites
>>>> the current state and becomes the new current state). This sort of
>>>> mechanism is useful for versioning your model instances. The pre_save
>>>> signal allows you to create a hook that does precisely that. That is just
>>>> one of the use cases, but I'm sure you can think of others.
>>>>
>>>> Karl Sutt
>>>>
>>>>
>>>>
>>>> On Sat, May 12, 2012 at 10:46 AM, Alireza Savand <
>>>> alireza.sav...@gmail.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> What is the different between pre_save signal and post_save singal.
>>>>> I know post_save will emited after model instance saved, and pre_save
>>>>> is before the saving the instance[?]
>>>>> but what it the point of pre_save when we cannot access the object
>>>>> data before the data changes.
>>>>> I mean user try to change the model content, like body of a post in a
>>>>> blog. using pre_save signal would be reasonable if i can access the post's
>>>>> body before the changes or in other word before the actual save() happens.
>>>>> If i can't access to data before save() happends, So what is the point
>>>>> of pre_save ?
>>>>>
>>>>> --
>>>>> 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/-/NLEgGtpvQ4cJ.
>>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> + <https://github.com/Alir3z4/>+ <https://sourceforge.net/users/alir3z4>
>>> + 
>>> <https://sourceforge.net/projects/yodownet/>+<https://www.transifex.net/accounts/profile/Alir3z4/>
>>> + <https://gist.github.com/Alir3z4>+ 
>>> <http://pastebin.com

Re: pre_save vs post_save

2012-05-12 Thread Karl Sutt
Could you provide some code (paste it to dpaste.org for example)?
Specifically, it would be useful to see your model definition and signal
connectors etc.

Karl Sutt


On Sat, May 12, 2012 at 11:38 AM, Alireza Savand
<alireza.sav...@gmail.com>wrote:

> Thanks for your answer Karl
> Actually yes, i want to do some versioning on model instance, but the
> problem is that the state of the model instance in pre_save is same as at
> the post_save.
>
> On Sat, May 12, 2012 at 2:32 PM, Karl Sutt <k...@sutt.ee> wrote:
>
>> Regarding pre_save signal, it is useful for doing something with the
>> "old" instance. Consider a use case where you might want to "archive" all
>> changes to, say, the user's profile. Every time a user makes a change to
>> their profile, you want to save the current state of the profile to another
>> table, or another database, and then save the new model (which overwrites
>> the current state and becomes the new current state). This sort of
>> mechanism is useful for versioning your model instances. The pre_save
>> signal allows you to create a hook that does precisely that. That is just
>> one of the use cases, but I'm sure you can think of others.
>>
>> Karl Sutt
>>
>>
>>
>> On Sat, May 12, 2012 at 10:46 AM, Alireza Savand <
>> alireza.sav...@gmail.com> wrote:
>>
>>> Hi
>>>
>>> What is the different between pre_save signal and post_save singal.
>>> I know post_save will emited after model instance saved, and pre_save is
>>> before the saving the instance[?]
>>> but what it the point of pre_save when we cannot access the object data
>>> before the data changes.
>>> I mean user try to change the model content, like body of a post in a
>>> blog. using pre_save signal would be reasonable if i can access the post's
>>> body before the changes or in other word before the actual save() happens.
>>> If i can't access to data before save() happends, So what is the point
>>> of pre_save ?
>>>
>>> --
>>> 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/-/NLEgGtpvQ4cJ.
>>> 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.
>>
>
>
>
> --
> + <https://github.com/Alir3z4/>+ 
> <https://sourceforge.net/users/alir3z4>+<https://sourceforge.net/projects/yodownet/>
> + 
> <https://www.transifex.net/accounts/profile/Alir3z4/>+<https://gist.github.com/Alir3z4>
> + <http://pastebin.com/u/Alir3z4>+<https://www.ohloh.net/accounts/Alir3z4>
>
>  --
> 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.
>

-- 
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: pre_save vs post_save

2012-05-12 Thread Karl Sutt
Regarding pre_save signal, it is useful for doing something with the "old"
instance. Consider a use case where you might want to "archive" all changes
to, say, the user's profile. Every time a user makes a change to their
profile, you want to save the current state of the profile to another
table, or another database, and then save the new model (which overwrites
the current state and becomes the new current state). This sort of
mechanism is useful for versioning your model instances. The pre_save
signal allows you to create a hook that does precisely that. That is just
one of the use cases, but I'm sure you can think of others.

Karl Sutt


On Sat, May 12, 2012 at 10:46 AM, Alireza Savand
<alireza.sav...@gmail.com>wrote:

> Hi
>
> What is the different between pre_save signal and post_save singal.
> I know post_save will emited after model instance saved, and pre_save is
> before the saving the instance[?]
> but what it the point of pre_save when we cannot access the object data
> before the data changes.
> I mean user try to change the model content, like body of a post in a
> blog. using pre_save signal would be reasonable if i can access the post's
> body before the changes or in other word before the actual save() happens.
> If i can't access to data before save() happends, So what is the point of
> pre_save ?
>
> --
> 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/-/NLEgGtpvQ4cJ.
> 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 psycopg error

2012-05-10 Thread Karl Sutt
Hello,

Open up a Python shell and try
import psycopg2

And let us know what happens.

Karl Sutt


On Thu, May 10, 2012 at 5:17 PM, Mike Di Domenico <
didomenico.mi...@gmail.com> wrote:

> Good afternoon,
> I am working on installing Django to work with a postgresql on ubuntu
> 10.04 server (32bit). I have postgresql-8.4 installed, Django version 1.5,
> python version 2.6.5, and I have the psycopg2 module installed (I think).
>
> I am getting the error "Error: No module named psycopg"
>
> I am doing the command "./manage.py syncdb" and in the settings.py file I
> have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I
> have tried it with just 'postgresql_psycopg2', both I get the same error.
>
> I have checked to see if psycopg2 is installed by doing the following:
> # python
> >>> import psycopg2
> >>> print(help('modules'))
>
> Please wait a moment while I gather a list of all available modules...
>
> ANSIaptsources  httplib select
> BaseHTTPServer  array   httplib2serial
> Bastion ast ihooks  sets
> CDROM   asynchatimageop setuptools
> CGIHTTPServer   asyncoreimaplib sgmllib
> Canvas  atexit  imghdr  sha
> CommandNotFound audiodevimp shelve
> ConfigParseraudioop imputil shlex
> Cookie  base64  inspect shutil
> DLFCN   bdb io  signal
> Dialog  binasciiitertools   simplejson
> DistUpgrade binhex  jsonsite
> DocXMLRPCServer bisect  keyword sitecustomize
> FSM bsddb   landscape   smart
> FileDialog  bz2 launchpadlibsmtpd
> FixTk   cPickle lazrsmtplib
> GnuPGInterface  cProfilelib2to3 snack
> HTMLParser  cStringIO   linecache   sndhdr
> IN  calendarlinuxaudiodev   socket
> LanguageSelectorcgi locale  spwd
> MimeWriter  cgitb   logging sqlite3
> OpenSSL chunk   lsb_release sre
> PAM cmath   macpath sre_compile
> Queue   cmd macurl2path sre_constants
> ScrolledTextcodemailbox sre_parse
> SimpleDialogcodecs  mailcap ssl
> SimpleHTTPServercodeop  markupbase  stat
> SimpleXMLRPCServer  collections marshal statvfs
> SocketServercolorsysmathstring
> StringIOcommandsmd5 stringold
> TYPES   compileall  mhlib   stringprep
> Tix compilermimetools   strop
> Tkconstants computerjanitor mimetypes   struct
> Tkdnd   contextlib  mimify  subprocess
> Tkinter cookielib   mmapsunau
> UpdateManager   copymodulefindersunaudio
> UserDictcopy_regmultifile   symbol
> UserListcrypt   multiprocessing symtable
> UserString  csv mutex   sys
> _LWPCookieJar   ctypes  netrc   syslog
> _MozillaCookieJar   curlnew tabnanny
> __builtin__ curses  nis tarfile
> __future__  datetimenntplib telnetlib
> _abcoll dbhash  ntpath  tempfile
> _astdbm nturl2path  termios
> _bisect dbusnumbers test
> _bsddb  dbus_bindings   oauth   textwrap
> _bytesiodebconf opcode  this
> _codecs decimal operatorthread
> _codecs_cn  difflib optparsethreading
> _codecs_hk  dircacheos  time
> _codecs_iso2022 dis os2emxpath  timeit
> _codecs_jp  distutils   ossaudiodev tkColorChooser
> _codecs_kr  django  parser  tkCommonDialog
> _codecs

Re: [help] Server Config: django + uwsgi + nginx

2012-05-03 Thread Karl Sutt
Have you symlinked /etc/nginx/sites-available/mysite.comto
/etc/nginx/sites-enabled/
mysite.com ?

Karl Sutt


On Thu, May 3, 2012 at 10:23 PM, easypie <program...@gmail.com> wrote:

> I'm not sure if I should post this in this thread of mine or start new
> one. But it's still about the config files.
>
> After getting uwsgi to work. I tried to link nginx w/ it but that didn't
> work. I go to localhost:80 and that takes me to the welcome page: "Welcome
> to Nginx!". When I go to localhost:8000 (which I want), it doesn't load
> (unable to connect). Please take a look at the code:
> http://dpaste.org/oIjP9/
>
>
> On Thursday, May 3, 2012 10:22:54 AM UTC-7, Kurtis wrote:
>>
>> Hey, I'm glad to hear you got it working! If you run into any more
>> problems, don't hesitate to ask.
>>
>> On Wed, May 2, 2012 at 1:31 AM, easypie <program...@gmail.com> wrote:
>>
>>> Thanks. I was missing the virtualenv= mentions earlier. I'm glad I
>>> know this those settings are meant for development only. I was a little
>>> confused thinking that was ready for deployment. I'm new to all this and
>>> get confuse sometimes.
>>>
>>>
>>> On Tuesday, May 1, 2012 8:04:00 AM UTC-7, Kurtis wrote:
>>>>
>>>> Judging from your Import Error -- I think you're having a problem with
>>>> Django not being on the Python path. In my uwsgi configuration file (I used
>>>> .xml), it looks like this:
>>>>
>>>> 
>>>> 
>>>> DJANGO_SETTINGS_MODULE=**fi**reflie.settings
>>>> 4
>>>> 0.0.0.0:7999
>>>>  /home/fireflie/staging/fireflie/
>>>> django.core.handlers.**w**sgi:WSGIHandler()
>>>> /home/fireflie/**sta**ging/fireflie/
>>>> /home/fireflie/**sta**ging/
>>>> /var/log/uwsgi/**uwsg**i.log
>>>> /tmp/fireflie-**staging**.pid
>>>>  
>>>>
>>>> Note: That's not guaranteed to be production-ready (we're just using it
>>>> for development) and I'm also not using a virtual environment (we use a
>>>> whole sever for the single Django application). In other words, I'm not
>>>> following best practices by a large margin. Good luck!
>>>>
>>>>
>>>> On Mon, Apr 30, 2012 at 7:36 PM, Karl Sutt <k...@sutt.ee> wrote:
>>>>
>>>>> I am not entirely sure what you mean by that. If you mean the nginx
>>>>> equivalent of Apache VirtualHosts then the nginx wiki explains it quite
>>>>> nicely 
>>>>> http://wiki.nginx.org/**S**erverBlockExample<http://wiki.nginx.org/ServerBlockExample>.
>>>>> Is that what you meant?
>>>>>
>>>>> Karl Sutt
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Apr 30, 2012 at 7:04 PM, easypie <program...@gmail.com> wrote:
>>>>>
>>>>>> does your configuration allow for running multiple sites?
>>>>>>
>>>>>>
>>>>>> On Sunday, April 29, 2012 12:01:27 PM UTC-7, Karl Sutt wrote:
>>>>>>>
>>>>>>> Here is my uWSGI command and nginx.conf contents:
>>>>>>>
>>>>>>> uwsgi -- 
>>>>>>> http://www.dpaste.org/**aiJuq/<http://www.dpaste.org/aiJuq/>
>>>>>>> nginx -- 
>>>>>>> http://www.dpaste.org/**bAG0o/<http://www.dpaste.org/bAG0o/>
>>>>>>>
>>>>>>> I've used it for a Flask application, but I've just tested it and it
>>>>>>> works for a Django project as well. Note that wsgi.py file in the uwsgi
>>>>>>> command is the Python file that Django generates when you first create a
>>>>>>> project, there is no need to change it.
>>>>>>>
>>>>>>> Good luck!
>>>>>>>
>>>>>>> Karl Sutt
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Apr 29, 2012 at 6:49 PM, easypie <program...@gmail.com>wrote:
>>>>>>>
>>>>>>>> I have this file that was created for me by one of the users in
>>>>>>>> django's irc channel. I edited to have the right information inserted 
>>>>>>>> but
>>>>>>>> I"m not sure what I'm doing wrong to not make it work. I've spent some 
>>>>>>>> time
>>>>>>>&

Re: Web services.

2012-05-02 Thread Karl Sutt
Have you looked into something like Backbone.js (
http://documentcloud.github.com/backbone/) or Spine (http://spinejs.com/)?
I know this may not exactly be what you're after, but it does allow you to
define models and manipulate them asynchronously (with data being pushed to
the server via AJAX).
In Backbone, you can pass {wait: true} to all the save() calls (
http://documentcloud.github.com/backbone/#Model-save) to wait for a
response from the server, otherwise all calls are assumed to be "positive
by default" -- saving the data is assumed to be successful by default.

Cheers,

Karl Sutt


On Wed, May 2, 2012 at 11:01 PM, Sherif Shehab Aldin
<silentqu...@gmail.com>wrote:
>
>
> I think my main problem is thinking about the returning objects, I want to
> make a standard way for ajax calls on my application so I can easily extend
> them, and create new ones easily, rather than thinking about it every time.
>

-- 
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: [help] Server Config: django + uwsgi + nginx

2012-04-30 Thread Karl Sutt
I am not entirely sure what you mean by that. If you mean the nginx
equivalent of Apache VirtualHosts then the nginx wiki explains it quite
nicely http://wiki.nginx.org/ServerBlockExample. Is that what you meant?

Karl Sutt


On Mon, Apr 30, 2012 at 7:04 PM, easypie <program...@gmail.com> wrote:

> does your configuration allow for running multiple sites?
>
>
> On Sunday, April 29, 2012 12:01:27 PM UTC-7, Karl Sutt wrote:
>>
>> Here is my uWSGI command and nginx.conf contents:
>>
>> uwsgi -- http://www.dpaste.org/**aiJuq/ <http://www.dpaste.org/aiJuq/>
>> nginx -- http://www.dpaste.org/**bAG0o/ <http://www.dpaste.org/bAG0o/>
>>
>> I've used it for a Flask application, but I've just tested it and it
>> works for a Django project as well. Note that wsgi.py file in the uwsgi
>> command is the Python file that Django generates when you first create a
>> project, there is no need to change it.
>>
>> Good luck!
>>
>> Karl Sutt
>>
>>
>> On Sun, Apr 29, 2012 at 6:49 PM, easypie <program...@gmail.com> wrote:
>>
>>> I have this file that was created for me by one of the users in django's
>>> irc channel. I edited to have the right information inserted but I"m not
>>> sure what I'm doing wrong to not make it work. I've spent some time trying
>>> to understand each line by searching the web. There's still a thing or two
>>> that's missing from the puzzle. Maybe it's the server config that has a
>>> flaw or the way I went about it. I haven't done a fresh install of uwsgi
>>> and nginx yet. However, please take a look to see if there's an error or
>>> solution that could work. Thanks.
>>>
>>> Link to code: http://www.dpaste.org/**wWVd3/<http://www.dpaste.org/wWVd3/>
>>>
>>> --
>>> 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/-/**2rekHP0I6V0J<https://groups.google.com/d/msg/django-users/-/2rekHP0I6V0J>
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/sMsRN5iG9NQJ.
>
> 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: [help] Server Config: django + uwsgi + nginx

2012-04-29 Thread Karl Sutt
Here is my uWSGI command and nginx.conf contents:

uwsgi -- http://www.dpaste.org/aiJuq/
nginx -- http://www.dpaste.org/bAG0o/

I've used it for a Flask application, but I've just tested it and it works
for a Django project as well. Note that wsgi.py file in the uwsgi command
is the Python file that Django generates when you first create a project,
there is no need to change it.

Good luck!

Karl Sutt


On Sun, Apr 29, 2012 at 6:49 PM, easypie <program...@gmail.com> wrote:

> I have this file that was created for me by one of the users in django's
> irc channel. I edited to have the right information inserted but I"m not
> sure what I'm doing wrong to not make it work. I've spent some time trying
> to understand each line by searching the web. There's still a thing or two
> that's missing from the puzzle. Maybe it's the server config that has a
> flaw or the way I went about it. I haven't done a fresh install of uwsgi
> and nginx yet. However, please take a look to see if there's an error or
> solution that could work. Thanks.
>
> Link to code: http://www.dpaste.org/wWVd3/
>
> --
> 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/-/2rekHP0I6V0J.
> 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: help with foreign keys in admin

2011-02-02 Thread Karl Bowden
On 3 February 2011 16:14, Bobby Roberts <tchend...@gmail.com> wrote:

> considering this model:
>
> class Inventory (models.Model):
>id = models.AutoField (primary_key=True)
>Barcode = models.BigIntegerField(blank=False)
>Location = models.CharField (max_length=25,blank=False,
> db_index=True)
>Sku = models.CharField (max_length=25,blank=False,
> db_index=True)
>Quantity = models.DecimalField (blank=False, max_digits=7,
> default=0,decimal_places=2,help_text='Quanity on barcode')
>LastAction = models.ForeignKey('AppSettings.InventoryOption',
> verbose_name=_('Last Action'), related_name='LastAction',blank=False,
> null=False)
>LastTouchedBy = models.ForeignKey(User, unique=False,
> db_index=True, blank=False)
>LastUpdated = models.DateTimeField
> (auto_now_add=True,blank=False, db_index=True,help_text='Auto Filled')
>
> class InventoryAdmin(admin.ModelAdmin):
>list_display =
> ('Barcode','Sku','Location','LastAction','LastUpdated','User.first_name',)
>search_fields = ['Barcode','Location','Sku','LastTouchedBy']
>readonly_fields =
>
> ['BarCode','Location','Sku','Quantity','LastAction','LastTouchedBy','LastUpdated']
> admin.site.register(Inventory,InventoryAdmin)
>
>
>
> two questions.
>
> 1) LastTouchedBy is the userid - what do i need to do to print out the
> firstname+lastname of the user in the list_display. (ie instead of
> printing out userid 123, I want to print out the user's full name,
> "john doe"
>

2) LastAction - I'm importing AppSettings model further up the page,
> how can I print out the text value of
> (AppSettings.InventoryOption.name) in place of the numerical value
> stored in LastAction
>
>
Hi Bobby,
You might be able to do this with python property decorators for both these
questions.

Ie:
class Inventory(models.Model):
@property
def touched_by_name(self):
return self.LastTouchedBy.get_full_name()

@property
def inventory_option_name(self):
return self.AppSettings.InventoryOption.name

class InventoryAdmin(admin.ModelAdmin):
list_display
= 
('Barcode','Sku','Location','LastAction','inventory_option_name','LastUpdated','touched_by_name',)

- Karl




>
> rapid help greatly appreciated.
>
> --
> 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<django-users%2bunsubscr...@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: unique_together FK problem with version 1.2.1

2010-05-30 Thread Karl Lam
Hi  Karen,

It is my mistake. After changing the class members, I forget to change
the __unicode__ method...

Thank you very much.


On May 30, 8:28 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sun, May 30, 2010 at 5:21 AM, Karl Lam <karl.v@gmail.com> wrote:
> > Class A and class B were setup using syncdb. Class B has a FK of class
> > A.
>
> > First I login to the admin site to add a record of Class A. Then add a
> > record of Class B by choosing  the only record of Class A as FK. Error
> > occurs after clicking "save" button. Is this a bug? or my setting is
> > wrong?
>
> > [snip]
>
> TypeError at /admin/inventory/room/add/
>
>
>
>
>
> > coercing to Unicode: need string or buffer, long found
>
> > Request Method:         POST
> > Request URL:    http://localhost:/admin/inventory/room/add/
> > Django Version:         1.2.1
> > Exception Type:         TypeError
> > Exception Value:
>
> > [snip]
> > File "/usr/lib/python2.4/site-packages/django/contrib/admin/
> > options.py" in add_view
> >  800.                 self.log_addition(request, new_object)
> > File "/usr/lib/python2.4/site-packages/django/contrib/admin/
> > options.py" in log_addition
> >  428.             object_repr     = force_unicode(object),
> > File "/usr/lib/python2.4/site-packages/django/utils/encoding.py" in
> > force_unicode
> >  66.                 s = unicode(s)
>
> > Exception Type: TypeError at /admin/inventory/room/add/
> > Exception Value: coercing to Unicode: need string or buffer, long
> > found
>
> The admin is trying to add a log message noting the creation of the new B
> object. However when it attempts to get the unicode representation of that
> object for the log message, something other than unicode is returned. So you
> need to correct the __unicode__ method of B to return unicode (or a string
> or buffer, which could be coerced to unicode). Anything else makes Python
> raise this error.
>
> Karen
> --http://tracey.org/kmt/

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



unique_together FK problem with version 1.2.1

2010-05-30 Thread Karl Lam
Class A and class B were setup using syncdb. Class B has a FK of class
A.

First I login to the admin site to add a record of Class A. Then add a
record of Class B by choosing  the only record of Class A as FK. Error
occurs after clicking "save" button. Is this a bug? or my setting is
wrong?

Thank you.



OS : CentOS 5 (x86)
Database : Postgresql 8.2



TypeError at /admin/inventory/room/add/

coercing to Unicode: need string or buffer, long found

Request Method: POST
Request URL:http://localhost:/admin/inventory/room/add/
Django Version: 1.2.1
Exception Type: TypeError
Exception Value:

coercing to Unicode: need string or buffer, long found

Exception Location: /usr/lib/python2.4/site-packages/django/utils/
encoding.py in force_unicode, line 66
Python Executable:  /usr/bin/python
Python Version: 2.4.3
Python Path:['/data/home/karl-lam/public_html/abc', '/usr/lib/
python2.4/site-packages/setuptools-0.6c11-py2.4.egg', '/usr/lib/
python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/
lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/
Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/
site-packages/gtk-2.0']
Server time:Sun, 30 May 2010 17:05:45 +0800




Environment:

Request Method: POST
Request URL: http://localhost:/admin/inventory/room/add/
Django Version: 1.2.1
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.admin',
 'abc.polls',
 'abc.inventory']
Installed Middleware:
('django.middleware.gzip.GZipMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.transaction.TransactionMiddleware')


Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
  100. response = callback(request,
*callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/
options.py" in wrapper
  239. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
_wrapped_view
  76. response = view_func(request, *args,
**kwargs)
File "/usr/lib/python2.4/site-packages/django/views/decorators/
cache.py" in _wrapped_view_func
  69. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/sites.py"
in inner
  190. return view(request, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
_wrapper
  21. return decorator(bound_func)(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
_wrapped_view
  76. response = view_func(request, *args,
**kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
bound_func
  17. return func(self, *args2, **kwargs2)
File "/usr/lib/python2.4/site-packages/django/db/transaction.py" in
_commit_on_success
  299. res = func(*args, **kw)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/
options.py" in add_view
  800. self.log_addition(request, new_object)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/
options.py" in log_addition
  428. object_repr = force_unicode(object),
File "/usr/lib/python2.4/site-packages/django/utils/encoding.py" in
force_unicode
  66. s = unicode(s)

Exception Type: TypeError at /admin/inventory/room/add/
Exception Value: coercing to Unicode: need string or buffer, long
found
#

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-cms-2.0 problem

2009-08-10 Thread Karl Bowden

On Mon, Aug 10, 2009 at 9:22 PM, Rob B (uk)<robtot...@googlemail.com> wrote:
>
> Trying to get a default install of :
> http://github.com/digi604/django-cms-2.0/
> up and running on my dev but I'm getting this error when trying to log
> into admin
> http://dpaste.com/77696/
>
> Any ideas?

Good morning Rob,

I just got an instance of django-cms-2.0 from git running yesterday.
And I must say I'm quite impressed.

I did run into a few hiccups on the way, but never say the error you
are receiving.

I am using Django-1.1 and started with the example project
django-cms-2.0/example/. I needed to disable 'south' and 'reversion'
to be able to run syncdb to a sqlite db and add pages respectively.

Any more details about your dev platform?

- Karl

--~--~-~--~~~---~--~~
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: Replacing the standard User class with a custom one

2009-04-27 Thread karl


> Apologies in advance, I'm sure this query pops up regularly.
>
> I'd like to replace the default User class which comes with Django's
> authentication system (for my application, users login via email/password, not
> login/password, so it's not only a matter of adding fields).
>
> Is there an easy way to do it? Or should I just roll my own and give on the
> default authentication system and (sniff) admin site?
>

This blog article explains it simply and has ready-to-use code:

http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html

Karl


--~--~-~--~~~---~--~~
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: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

2009-03-31 Thread Karl Gingerich
Mark, I'll up to my eye balls in alligators right now, I'll get back to you 
soon. - Karl
-Original Message-
From: Mark Shewfelt <mshewf...@gmail.com>

Date: Tue, 31 Mar 2009 08:25:55 
To: Django users<django-users@googlegroups.com>
Subject: Re: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?



Hi Karl,

I just came across your post and am having the same issue (Ubuntu 8.04
Server). I managed to build the latest versions of unixODBC and
FreeTDS and install them to /usr/local/lib. When I run python and try
to import pyodbc I get the following error:

administra...@maverick:~/pyodbc-2.1.4$ python -c "import pyodbc"
Traceback (most recent call last):
  File "", line 1, in 
ImportError: libodbc.so.1: cannot open shared object file: No such
file or directory
administra...@maverick:~/pyodbc-2.1.4$

So obviously pyodbc cannot find the libs I just built - but I cannot
figure out how to specify their location when building pyodbc. Did you
have this issue? Any help is welcome!

Thanks,

Mark

On Feb 25, 5:19 pm, kgingeri <kging...@gmail.com> wrote:
> Ok, I figured this out myself...
>
> I had to un-install all pre-installed odbc stuff - unixODBC (possibly
> iODBC as well, except it didn't seem to actually uninstall completely)
> andFreeTDS.
>
> I then got source and did configure/make/make installs of unixODBC
> first, thenFreeTDS.
> This order is important so that the ./configure command can find all
> the right stuff.
> An important note is the params for theFreeTDS./configure command.
> I used the following:
>
> $ ./configure --with-unixodbc=/usr/local  --enable-msdblib --disable-
> libiconv --with-tdsver=8.0
>
> Anyway, it's working now without complaint!
>
> :v)


--~--~-~--~~~---~--~~
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 without database

2006-05-12 Thread Karl Fast

Can anyone point me to examples of django apps that either do not use
a database, or use it for only part of the app? Looking for source.

I'm specifically interested in examples with models that use other
persistence backends (like a config file), and the associated
views and templates.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



django behind cherrypy server

2006-05-06 Thread karl fast

Does anyone have instructions on running Django behind CherryPy?

It sounds like the builtin web server works, but is not especially
robust. I would like to run my app behind a python web server so it can
be more easily distributed. My users will be running it locally, so I
would like to avoid apache, etc. Scalability is not important for me.
Stability is.

The CherryPy server sounds better. Thanks to WSGI it should be possible
to run Django behind it. But how?

Any python web server would be fine. Even Django's builtin one, if it's
solid enough. But anything would be fine

Unfortunately the server arrangements page doesn't help much.

http://code.djangoproject.com/wiki/ServerArrangements


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



using django for local application

2006-05-04 Thread karl fast

Need to decide if Django is suitable for my application.

I need to build a web application for 2-3 people. But they would each
run their own copy on their local machine. It will effectively be like
any regular app you download, install, and run. But it might become a
shared web app in the future, so I'm building a web interface instead
with a GUI interface.

The app is a specialized crawler. You import data from Excel. Then you
fill out forms with options for the crawl. Then the app collects the
data. This can take few minutes or hours, with some crawls lasting over
a day (long story).

Would Django be a good choice for this? Esp. compared to Cherrypy plus
some other bits, or TurboGears, or Plyons, or something else.

More specifically:

1. Is the builtin webserver sufficiently robust? My users do not want
to install and configure apache. The builtin server is great, but will
it be enough? I'm not concerned about performance and scalablity, just
stability. The only feature I need is preventing access from other than
the localhost.

2. Is sqlite fully supported? To simplify installation I would rather
not have people install MySQL or PostgreSQL. It's overkill . But will I
encounter any problems with sqlite? Any gotchas I should know about?

3. What about long-running processes? The importing and configuration
is straightforward. But when you press "collect" it could churn for
hours, some to the database, some to disk. Could Django handle such a
long running queue? I could split the collection bit into a separate
program. The web app would deal only with importing, configuring, and
reviewing the data.

4. What about models not related to a table? The crawlers definition
comes from a configuration file and associated classes. I don't want to
tie the crawler config to a database. I want to modify the plaintext
config file and then use this to generate the forms. I'm not quite
clear how to create models in Django that are not connected to a
database. Do I just do what I need to do in the views and the templates
instead? Can someone point me to good examples about this?

I have considered other options. Cherrypy is my strongest option
depending on the answers to the above, and maybe some other things.

Cherrypy + some other bits. Big attraction is that it has it's own,
solid webserver. Big minus is that you need to add other bits which
means more to learn for whoever takes over the project from me in a few
months. Plus the documentation is not as helpful. It is flexible but
you need to do a lot of stuff yourself.

Turbogears. Could be good but in too much flux. Maybe in six months,
but not now.

Pylons. Ugh. Cobbles together too many things, which means reading
piles of documentation and then interpreting each doc within the
context of pylons. Plus, it is also in flux.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---