Re: CSRF token not adding hidden form field

2010-06-10 Thread Joel Klabo
yeah, still 403. CSRF token missing or incorrect. On Jun 10, 7:20 pm, Lee Hinde wrote: > Is the error the same? > > > > On Thu, Jun 10, 2010 at 5:41 PM, joelklabo wrote: > > Still won't work. Here is my views.py: > > > def login(request): > >        c = {} > >        c.update(csrf(request)) > >

Re: CSRF token not adding hidden form field

2010-06-12 Thread Joel Klabo
ponse('profile.html', {'drinks' : drinks, 'followers' : followers}, context_instance=RequestContext(request)) Thanks for all the help! On Jun 11, 9:32 pm, Ali Kusnadi wrote: > On 6/11/10, Joel Klabo wrote: >

Django architecture question

2010-06-14 Thread Joel Klabo
I am working on a simple site right now and the views are pretty easy. Usually just iterate a loop of objects. But, I am trying to figure out how a website with all different kinds of data, including a sign in form, is setup in django. Is that all in one big view? Or, is there some way to combine t

Re: Django architecture question

2010-06-15 Thread Joel Klabo
Thanks, good info. So the template tag can do the DB query and all that without going through a view function? On Jun 15, 8:09 am, Paul wrote: > On 15 Jun., 06:55, Joel Klabo wrote: > > > I am working on a simple site right now and the views are pretty easy. > > Usually just

Re: Django architecture question

2010-06-15 Thread Joel Klabo
y. Is it all javascript or just a huge view with: user login, feeds of current data, etc... On Jun 15, 8:09 am, Paul wrote: > On 15 Jun., 06:55, Joel Klabo wrote: > > > I am working on a simple site right now and the views are pretty easy. > > Usually just iterate a loop of objec

Re: CSRF verification failed - 403 error

2010-07-16 Thread Joel Klabo
I had this same problem. Try this for your return statements, if you're using render_to_response: return render_to_response("a_template.html", c, context_instance=RequestContext(request)) The context_instance was the key in my case. You'll need to add it to all your views though. -- You receive

ModelForm and a new model instance

2010-07-16 Thread Joel Klabo
I am using modelForm to make a form for my Brew model. The form shows up and works fine. And saves it when I call save. But it does not catch the errors correctly. I set it up mostly based on this example: from django.core.validators import ValidationError, NON_FIELD_ERRORS try: article.full_c

Re: ModelForm and a new model instance

2010-07-17 Thread Joel Klabo
That did it! That example was what I was looking for. The error handling led me astray, it's all taken care of. Thanks a lot. On Jul 17, 2:42 am, Karen Tracey wrote: > On Fri, Jul 16, 2010 at 6:27 PM, Joel Klabo wrote: > > I am using modelForm to make a form for my Brew model.

comment template tag not working

2010-07-17 Thread Joel Klabo
I am trying to use the get_comment_list template tag and I keep getting errors. Any ideas? http://dpaste.org/nCx0/ -- 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

Re: comment template tag not working

2010-07-17 Thread Joel Klabo
I got it to work by adding: {% load comments %}. I had put the load comments tag in my base.html but didn't work there for some reason. On Jul 17, 1:00 pm, Joel Klabo wrote: > I am trying to use the get_comment_list template tag and I keep > getting errors. Any ideas?http://dpas

django autocomplete search with jQuery

2010-07-29 Thread Joel Klabo
I have been looking around for some examples but I can't find anything recent. This is my first AJAX experience so I would love to just see an example because it's not quite making sense to me. Does anyone know of a tutorial? Or have some code samples I could check out? I have checked google btw.

Custom clean() method

2010-08-24 Thread Joel Klabo
When you write a custom clean method for a form, does is get called by is_valid? Or does it call the standard version? Do I need to explicitly call it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Custom clean() method

2010-08-24 Thread Joel Klabo
Thank you, question answered. On Aug 24, 11:45 am, Shawn Milochik wrote: > Your version automatically gets called during the cleaning process > (assuming it's named properly). You don't need to call it explicitly. > The default cleaning of the field will happen automatically. All you > have to do

method on the User model?

2010-08-24 Thread Joel Klabo
I am trying to find a way to get a list of users ranked by the most "drinks". The drink model has a User field so I am doing this to get the info, based on the Drink model: http://dpaste.com/hold/233600/ But, this seems like craziness. Can't I just search the User.objects.all().order_by('drinks')

apache won't start now for some reason....

2010-08-26 Thread Joel Klabo
Apache was running fine, as far as I know I didn't change anything. This is the error log: http://dpaste.com/234582/ SIGTERM? -- 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

Re: apache won't start now for some reason....

2010-08-26 Thread Joel Klabo
Got it, I had accidentally deleted my error.log file and when it couldn't find it it borked itself. On Aug 26, 3:36 pm, Joel Klabo wrote: > Apache was running fine, as far as I know I didn't change anything. > This is the error log:http://dpaste.com/234582/ > > SIGTERM?

question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
on my VPS i have my project at: /srv/www/brooski.net/brooski/(all my files, settings.py, url.py are here) and my VirtualHost is setup like this: ServerAdmin r...@brooski.net ServerName brooski.net ServerAlias www.brooski.net DocumentRoot /srv/www/brooski.net/publi

Re: question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
also, when I change the virtual host path to: /srv/www/brooski.net (instead of /srv/www/brooski.net/brooski/) I get an internal server error. Whereas with '/srv/www/brooski.net/brooski/' I get the actual django error page On Aug 26, 4:20 pm, Joel Klabo wrote: > on my VPS i have

Re: question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
It does have __init__.py, but not the server isn't seeing it... '500 internal server error' On Aug 26, 4:48 pm, Kenneth Gonsalves wrote: > On Thu, 2010-08-26 at 16:44 -0700, Joel Klabo wrote: > > also, when I change the virtual host path to: /srv/www/brooski.net

Re: question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
Could someone just show me how theirs is set up? On Aug 26, 4:54 pm, Joel Klabo wrote: > It does have __init__.py, but not the server isn't seeing it... '500 > internal server error' > > On Aug 26, 4:48 pm, Kenneth Gonsalves wrote: > > > > > On Thu, 2

Re: question on directory structure for deploying project

2010-08-27 Thread Joel Klabo
bmp On Aug 26, 8:14 pm, Joel Klabo wrote: > Could someone just show me how theirs is set up? > > On Aug 26, 4:54 pm, Joel Klabo wrote: > > > > > > > > > It does have __init__.py, but not the server isn't seeing it... '500 > > internal serve

mod_wsgi setup issue

2010-08-27 Thread Joel Klabo
All the files are shown here: http://gist.github.com/554724 I don't know what I'm doing wrong but I'm still getting 500 -- 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 unsub

mod_wsgi, apache, ubuntu setup question (noob alert)

2010-08-27 Thread Joel Klabo
This is my situation: http://gist.github.com/554724 I am getting 500 internal server error, don't know what's up... I would appreciate any info, I'm a total apache noob. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: mod_wsgi, apache, ubuntu setup question (noob alert)

2010-08-27 Thread Joel Klabo
problem solved for the time being, I needed to add quotes around the 'settings' On Aug 27, 10:08 pm, Joel Klabo wrote: > This is my situation:http://gist.github.com/554724 > > I am getting 500 internal server error, don't know what's up... > > I would appreciat

Saving a location with a model

2010-08-30 Thread Joel Klabo
I want to tie a location to each instance of a model. I am planning on getting the lat/long. from navigator.geolocation through javascript. My original idea is to have a location model with fields, latitude, longitude, and the id of whatever model it is linked to. Is that the way to go? Anyone have

Re: Saving a location with a model

2010-08-30 Thread Joel Klabo
looks cool. Any problems with just adding lattitude and longitute float fields? On Aug 30, 3:38 pm, Mikhail Korobov wrote: > You may find this useful:http://bitbucket.org/barttc/django-generic-location > > On 31 авг, 04:05, Joel Klabo wrote: > > > > > I want to tie a l

django achievements

2010-09-11 Thread Joel Klabo
Does anyone know of an example of someone using django signals to do achievements for a website? similar to foursquare or something like that? I am going to attempt it and i don't really know where to start. I would love some example or a nudge in the right direction. -- You received this message

Re: django achievements

2010-09-12 Thread Joel Klabo
; > > > > On Sat, Sep 11, 2010 at 12:26 PM, Joel Klabo wrote: > > Does anyone know of an example of someone using django signals to do > > achievements for a website? similar to foursquare or something like > > that? I am going to attempt it and i don't really

Signals problem

2010-09-22 Thread Joel Klabo
I keep getting this import error and I can't figure out why? Any ideas would be greatly appreciated: http://dpaste.org/BgtI/ -- 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 u

Re: Signals problem

2010-09-22 Thread Joel Klabo
Update: http://dpaste.org/kK5p/ On Sep 22, 11:41 pm, Joel Klabo wrote: > I keep getting this import error and I can't figure out why? Any ideas > would be greatly appreciated:http://dpaste.org/BgtI/ -- You received this message because you are subscribed to the Google Groups &q

Re: Signals problem

2010-09-23 Thread Joel Klabo
Thanks for the help, all working now! On Sep 22, 11:52 pm, Russell Keith-Magee wrote: > On Thu, Sep 23, 2010 at 2:41 PM, Joel Klabo wrote: > > I keep getting this import error and I can't figure out why? Any ideas > > would be greatly appreciated:http://dpaste.org/BgtI/

Image Upload question

2010-09-23 Thread Joel Klabo
I have a form trying to upload an image. In the docs it says that the form must be bound to save a file. This is an issue for me because I wan't to save the file with other data such as the User object that saved it. I can't put a User object in a form so I put the username in a hidden form field w

Re: Image Upload question

2010-09-23 Thread Joel Klabo
run the .is_valid() method > of the form instance once you've instanciated it with your POST and > FILES data. > E.g. > form = BrewImageFrom(data=request.POST, files=request.FILES) > if form.is_valid(): >     brewimage = form.save() > > On Sep 23, 3:00 pm, Joel Klabo

Re: Image Upload question

2010-09-23 Thread Joel Klabo
from the django docs: inherits all attributes and methods from FileField, but also validates that the uploaded object is a VALID IMAGE. what does valid image mean? On Sep 23, 2:40 pm, Joel Klabo wrote: > Thanks, upload is now working. But, only for smallish .png files, what > a

Re: Image Upload question

2010-09-23 Thread Joel Klabo
The problem was no PIL and libjpeg... On Sep 23, 2:43 pm, Joel Klabo wrote: > from the django docs: > > inherits all attributes and methods from FileField, but also validates > that the uploaded object is a VALID IMAGE. > > what does valid image mean? > > On Sep 23, 2:

Django Registration password reset problem

2010-10-05 Thread Joel Klabo
This is the error and location of the problem: http://gist.github.com/612210, I can't see what it's looking for. It seems like I could hard code the arguments it wants into the reverse() but that doesn't seem like the correct way to do it. Any advice? -- You received this message because you are

Re: Django Registration password reset problem

2010-10-05 Thread Joel Klabo
Need to bump this, sorry. I don't get it. On Oct 5, 1:04 pm, Joel Klabo wrote: > This is the error and location of the problem:http://gist.github.com/612210, > I can't see what it's looking for. It seems like I could hard code the > arguments it wants into the reverse

Re: Django Registration password reset problem

2010-10-05 Thread Joel Klabo
now using the ones that come with django- registration... Here is the view where the error first pops up, this is where post_reset_redirect is as well: http://dpaste.org/gatU/ Thanks for your time On Oct 5, 1:56 pm, Steve Holden wrote: > On 10/5/2010 4:45 PM, Joel Klabo wrote:> Need to bum

Re: Django Registration password reset problem

2010-10-06 Thread Joel Klabo
So now I am redirecting to the named url in the URL conf. That is now giving me the error: The included urlconf registration.auth_urls doesn't have any patterns in it ... http://dpaste.org/OOw5/ any ideas would be greatly appreciated On Oct 5, 5:56 pm, Joel Klabo wrote: > Ok, so I'

Re: Django Registration password reset problem

2010-10-06 Thread Joel Klabo
ust took a cursory look at this but did you make sure to add > something like the following to your urlpatterns in urls.py? > > urlpatterns=patterns('', >     ... >     (r'^accounts/', include('django.contrib.auth.urls')), >     ... > ) > >

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
Take a look at this line: http://1l.to/bf1/ ... so you don't need to add > it (again) to your urls. > > I don't have this error with password_reset_complete view , but I'm using > my clone of original repo with some useful patches (additions). What is > version that you

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
Also, all my code is on Github if you would like to see something else: http://github.com/joelklabo/brooski I really appreciate your help, thank you. On Thu, Oct 7, 2010 at 9:43 AM, Joel Klabo wrote: > My version is: VERSION = (0, 8, 0, 'alpha', 1) > > Yeah, I have that in

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
sounds > like you writing custom admin views? Or you just copied admin/views.py > locally? > > You already tried to resolve via name of url? > Else, if you writing custom admin views, isn't right to reference this > custom views? > > (anyway, tonight I'll check t

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
django.contrib.auth.views.password_change_done') > > to > 110 - post_reset_redirect = > reverse('registration.auth_views.password_reset_done') > 144 - post_reset_redirect = > reverse('registration.auth_views.password_reset_complete') > 177 - post_change_redirect = >

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
s for something, not? 2010/10/7 Joel Klabo > Awesome, that fixed it. All I had to do was change "from registration > import auth_views" to "from django.contrib.auth import views as auth_views" > > Thank you so much > > > On Thu, Oct 7, 2010 at 12:56 P