Ensure that pg_config is on your PATH and it should work.
--
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
In addition there's hookbox.org.
There was a great talk on it at PyCon.
http://pycon.blip.tv/file/4883145/
In addition, I'm in the process of playing with Hookbox, after which
I'll write a blog post detailing how to use it with Django.
In the meantime, this is the tutorial I've found most
On Wed, Mar 23, 2011 at 7:19 PM, Brian Neal wrote:
> I also found a bug. :) I got a 403 CSRF failure when Paypal sent me
> to http://www.djangoproject.com/foundation/donate/thanks/
Oh the bitter irony!
--
You received this message because you are subscribed to the Google
It's not possible to have a system that can access another, yet block
access to the other system if hacked.
This is why it is impossible to have unbreakable encryption in
consumer devices. You can't make a Blu-Ray player that doesn't contain
the capability to decrypt Blu-Ray discs. Therefore, all
2011/3/23 Alberto Morales Fernández :
> I have a problem, i need show differents "views" in a single template, how i
> can achive this?
I think you need to ask a clearer question. You don't use templates to
display views. You use templates within views (among other places) to
Everyone:
I just donated $25 to the Django Software Foundation. I would like
to suggest that others who appreciate all the hard work chip in a
couple of bucks if they are able. Especially those who, like me, want
to express their gratitude but haven't yet contributed back to the
community by
A good way to start is to go to the Python Web site, do the tutorial,
and then graduate to the Python mailing list. Welcome to Python --
it's awesome!
This list is for Django, so this isn't on-topic for this list.
Tutorial: http://python.org/doc/
Mailing list:
pdb:
www.doughellmann.com/PyMOTW/pdb/
--
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.
The cause is that there's a problem with a line of code that interacts
with the database, leaving the database connection dirty and unusable.
The error occurs not at that line of code, but at the next line of
code which tries to use the database connection.
The solution is to use pdb and/or
It was claimed this morning that the release will be today.
https://groups.google.com/forum/#!topic/django-developers/Bh33bkwnEZU
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
It sounds like you want webalizer or awstats. They use your server log info.
Shawn
--
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
1. Create a Django form.
2. Add a ChoiceField to the form.
3. Populate the ChoiceField's 'choices' properly with an iterable
(tuple or list) full of iterables containing the key and value you
like.
4. Put the form into your template somewhere within your HTML form.
Shawn
P.S.
I recommend
1. Why are you creating models with the ORM (via a Model subclass),
then using raw SQL instead of the ORM to manipulate the database?
2. Why are you overriding the primary key just to replace it with the same type?
3. Your view allows for SQL injection errors -- one of the things the
ORM
Run a grep on your code and look for the word 'complete.' Then figure
out where it's blowing up.
If 'complete' doesn't appear anywhere in your code, then use pdb to
trace into the django-socialauth code that's blowing up so you can
figure out what your code is doing wrong that's breaking
I recommend creating a script that reads the CSV files then creates
instances of your models from that data and saves them.
This will ensure that your signals (if any) fire, and that any
relationship or validation errors are known immediately, rather than
breaking your application later.
Shawn
Do you know for certain that you're getting past this line?
if request.method == "POST" and referer.endswith('upload/'):
Also, you might want to add some logging to your app (or use pdb) to
get information about what's going on at runtime.
Some things I would check:
You have a LOT of
http://dpaste.com/ always works.
I guess the view and the form.
--
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
If you post code I will look at it, but I'm not keen to guess.
--
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
What are you doing to the post data in the view?
What are you doing in the form?
If you overrode any clean() methods, did you take care to return the
required value/object?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
I use gunicorn with nginx, albeit on a much more powerful machine.
I think you'll find nginx or lighttpd recommended for a lightweight server.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On Fri, Mar 18, 2011 at 12:55 PM, hank23 wrote:
> The order or priority of the fields are not important, but having a
> minimum of at least one is,
If that's the case, then just don't make any of those fields required,
then in the clean() of your form check the
It's possible to do this by manipulating the post data. It's probably
cleaner (and more easily reusable) to do it in the form's __init__
than in the view itself, though.
I don't know what these fields are meant to contain, but assuming one
is more important than the others, what if they leave the
Log into the PostgreSQL console using the psql command. Or manage.py dbshell.
CREATE USER username PASSWORD 'secret' CREATEDB;
CREATE DATABASE dbname OWNER username;
That ought to do it. Also, you only need the CREATEDB if you plan to
run unit tests, so don't bother with it in production. It
Are you certain that your base template is structured properly? Check
for missing closing tags.
It may be that your template is correct but just inheriting a syntax problem.
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
I believe you can filter them using ModelAdmin.formfield_for_choice_field.
Check out the docs here:
http://docs.djangoproject.com/en/1.2/ref/contrib/admin/
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Try changing from:
from reviewsapp.models import Category
to:
webservices.reviewsapp.models import Category
It's all about the PYTHONPATH.
When you use manage.py it configures your environment which allows you
to import in your Django app and the shell.
Shawn
--
You received this
It's easy to create an authentication backend:
http://docs.djangoproject.com/en/1.2/topics/auth/#writing-an-authentication-backend
If you know (or can figure out) what code you have to write in order
to authenticate against Facebook, just drop that code into your custom
authentication backend
Here's an alternative way to do it.
Something like (in view):
post.save(user = request.user)
And in your save override:
user = kwargs.pop('user')
self.user = user
super(Post, self).save(*args, **kwargs)
The reason you pop off the 'user' value instead of just reading it is
that
Thanks for that. I wrote my own middleware for this, but the snippet
is better-implemented than mine.
Shawn
--
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
On Wed, Mar 16, 2011 at 2:47 PM, emonk wrote:
> I'm tired of searching and found many examples of middleware but not the one
> I seek
>
You almost certainly will not find the exact code you need to cut &
paste. You need to read the examples you did find and learn something.
On Wed, Mar 16, 2011 at 1:16 PM, emonk wrote:
> Yep, but i need an example and I have not found any.
>
If you haven't found any then you haven't looked. Have you heard of Google?
Here are the docs:
You can use formsets, which can be passed querysets upon
initialization. If this doesn't help, feel free to use a more specific
question.
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Find out which template you need to modify and where to put the code,
then just use xlwt. It's on PyPI and I've used it quite a bit.
Alternatively you can use csv.writer or csv.DictWriter, which can be
natively opened in Excel and is still easily parsable by other tools.
The complicated thing is
I also have a copy of that book, and I believe that what you're
referring to pages 197 and 198.
Here is what the authors are doing there:
1. Creating a special manager that does one thing -- return a
filtered subset of the model instances.
2. Creating a replacement 'objects' manager
Think of your pluggable Django apps like they were any other Python
module, such as your database driver, Django itself, South, Celery, or
whatever.
The easiest and cleanest way to do it is to package your pluggable
apps so you can install them with pip or setuptools. If there's an
update,
I can't address the first question because it was probably discussed
among the developers and was a design decision.
As for the second, you don't *have to* create an 'objects' manager at
all. If you do nothing, you get a Manager() for free
by default, and because it has to be named *something*,
You can put a sort order in the model's meta info. That way you'll always
have a default sort.
--
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,
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>From the docs:
http://docs.djangoproject.com/en/dev/topics/settings/
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
I really need to pay attention to whom incoming e-mail is addressed. I
thought I was continuing the thread on the list.
Shawn
--
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.
The easiest solution I've found:
1. Create a file named local_settings.py that is *outside* of
version control.
2. Import local_settings at the bottom of settings.py, handling
the exception if it doesn't exist.
3. Override anything you like in local_settings.py.
This has these
If there's a "correct" way to do this I'd love to hear it also.
At present I do the model imports in tasks.py within the task that
requires the model. This is because in my models.py I import tasks
from tasks.py.
Shawn
--
You received this message because you are subscribed to the Google
What have you read and what have you tried? When you tried those
things, what errors or unexpected results did you get?
Without that information nobody can help you.
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
>
> Email addresses have been allowed since version 1.2 <
> http://docs.djangoproject.com/en/1.2/topics/auth/#api-reference >.
> Have you found place in 1.2.x where an email address doesn't work?
>
> Toodle-lo..
> creecode
The problem here is that the username is still limited
What's wrong with writing your own auth backend? It's two piddly functions:
http://dpaste.com/hold/473373/
Shawn
--
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
What do you mean by 'gunicorn instance' here?
> The idea is that in each gunicorn instance I set the
> DJANGO_SETTINGS_MODULE to a different settings.py file, and hopefully
> get the corrrect result.
In any case, I highly recommend you just use supervisord[1] for this
and put the path to the
One option would be to just change the value of MEDIA_ROOT in
settings.py. Or, if you're using 1.3 beta or above, STATIC_ROOT.
You could do this by having multiple settings files -- one main one
with anything that's common across all clients and one settings file
for each client which imports the
Hi everyone. I thought I'd check in with my "home group" before I post
this up on Dice. Any locals?
Shawn
Python/Django Developer
Greenphire is a growing company in King of Prussia, PA. We are looking
for a bright developer to join us in our quest for truth, justice, and
the Pythonic way. We
This will give you some info on Django in particular, but not
comparisons to other frameworks:
http://www.djangosites.org/stats/
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
So, what's your Django question?
Shawn
--
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
+1 on Celery and django-celery. I use them both.
--
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
There was just a large amount of conversation on this topic.
People listed some great resources and discussed why things have
evolved to happen the way they do:
https://groups.google.com/d/msg/django-users/0dVLMCIYa94/a5IuaB9V_z4J
--
You received this message because you are subscribed to the
I have an idea. Why don't you remove the middleware and see if the
tests work? That might give you the answer.
--
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
What do the 'next' and 'prev' methods of your Entry model do?
Shawn
--
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
Why are you re-posting this? You posted it over the weekend. I
replied. If my reply didn't help, tell us the new problem you're
having.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On Mon, Feb 21, 2011 at 9:00 AM, Jason Mayfield wrote:
> You can't just copy your Python binary around (which is what you'd be doing
> if you attempt to copy the virtualenv itself) unless the systems are exactly
> the same (and even then I'd be reticent to do so). Why not
On Sun, Feb 20, 2011 at 5:33 PM, wrote:
> Hey Shawn,
> I have been opportuned to have south installed on my pc but I must confess I
> have never understood its use. Now that its being mentioned in here, I think
> I am going to get into it and understand its use.
> Sent
What are the related_name values you gave to the foreign key fields of
your related models?
--
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
First, what are you trying to do?
1. The code you posted is not valid Python, because 'Object' is
capitalized. So you haven't actually even tried this, or it would have
blown up.
2. Adding 'y' to your subclass of Model does nothing with the
database, because y is not a subclass of one of the
A quick and dirty way is to append a timestamp to the URL so it's
always unique. That way it won't be cached.
Add "new Date().getTime()" to the end of the URL your AJAX call
requests. Just have your url pattern accept and ignore the extra
stuff.
Shawn
--
You received this message because you
Not only is it not a stupid question, but it's one of the best
possible types of questions. Any time someone comes in and makes it
obvious that they've thought about their problem and made an attempt
to solve it themselves, they get my respect.
The easiest answer to your question is to make a
On Sat, Feb 19, 2011 at 8:28 PM, Rainy wrote:
> I was going to say the exact same thing. I can just add that anything
> is fairly
> easy with South - starting from the beginning, starting just before
> 2nd
> dev joins in, or even starting after other devs join. Wiping out
Okay, it sounds like your problem is different. Mine only happened in
IE, and not to all users, and not the same IE version. Just to some
specific users, 100% of the time.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
By chance, is the client running Windows and using IE? If so, is their
system time incorrect?
I've had major problems with session timeouts myself, and ended up
handling session expiration in custom middleware because I never could
figure it out, and over a period of months this list was no help
I also didn't see the part where they state that you shouldn't put your
database login information in a template. That's probably because Django
is designed to allow Web developers to do their jobs more easily, not
allow people who don't know what they're doing make Web applications. If
you're
On 02/17/2011 07:48 PM, LJ wrote:
I installed the latest version of dajaxice, but I am still getting
Unresolved import errors.
My guess is that I need to remove and reinstall the Python
Interpreters.
Is there a some documentation somewhere that explains how to reinstall
the Python Interpreters,
On Thu, Feb 17, 2011 at 4:44 PM, Arun K.Rajeevan wrote:
> Show me the django way to do this.
>
The "Django" way to do this is to learn basic programming skills. You
originally asked a mess of random questions which didn't have anything
to do with Django. We answered
This sounds like a good time to use jQuery. If all the data is being
displayed at once anyway, then it'll be faster and easier to do the
filtering and sorting client-side.
Even if you're talking about a lot of data, things like the
click-sorting of table columns should probably be done with
On Thu, Feb 17, 2011 at 11:26 AM, hank23 wrote:
> Ok I added the southtut app to my installed apps after creating its
> folder, but now when I enter this command:
>
> python manage.py schemamigration southtut --initial
>
> I get this:
>
> Unknown command: 'schemamigration'
Sure. In your ModelForm instance's __init__, set that field's ".choices"
value.
--
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
QuestionBank.objects.filter(id__in = id_list)
--
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
See the 'next' stuff:
http://docs.djangoproject.com/en/1.2/topics/auth/
--
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
On Mon, Feb 14, 2011 at 9:53 PM, Bobby Roberts wrote:
> yeah i've got it where session ends on browser close so they will
> refresh when they come back and log back in. I'm just trying to find
> an efficient way to store the values so that I don't have to query on
> every
Pickling will let you store objects as strings. However, perhaps you
would like to use a memoize[1] decorator on your function.
Are you trying to do this for performance reasons, because getting
that relationship info from the database is slow?
Regardless of why you're doing it, make sure you
You can always use pickle to serialize something. What do you mean by
a "many to many relationship," though?
--
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
It doesn't work that way with Django. You run each Django project on a
different port, and your Web server (nginx, apache, whatever) forwards
incoming traffic to the correct port.
Your Python code (all Django is Python) should never be accessible via
your Web server. Your Django app will run as a
You can iterate through the forms in your formset and call is_valid()
(and optionally save()) on them based on your needs.
Since your definition of "left blank" and "invalid" could vary based
on what you're doing, it's better that you make those decisions
explicit. If Django tried to decide for
You can make a custom manager.
http://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers-and-model-inheritance
You probably don't realize it from normal use, but the 'objects'
property you're using on your models is an instance of models.Manager,
not an internal part of the
You're welcome.
What are you trying to do?
Django cleans the user input to prevent SQL-injection attacks, and it
also cleans it by default if you display it in a template. Why do you
need this separate sanitization?
Shawn
--
You received this message because you are subscribed to the Google
What are you trying to do?
If you just want access to the value passed in, try accessing
form.cleaned_data['explanation'].
The field objects are not directly accessible via form_name.field_name
-- they're in form.fields, like
form_name.fields['explanation'].
Shawn
--
You received this message
http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes
Almost in time for Django 1.3's release. ;o)
--
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
On Fri, Feb 11, 2011 at 4:15 PM, Tom Evans wrote:
>
> Have a read of this:
>
> http://www.secnetix.de/olli/Python/lambda_functions.hawk
>
That's funny -- I did a quick Google search and that's one I found
also. I chose to give a quick sample instead of sending the link
On Fri, Feb 11, 2011 at 4:06 PM, kyleduncan wrote:
> I dont understand what the x is, but thank you so much for fixing this
> for me in a matter of minutes!
>
You're welcome.
The 'key' kwarg to the sort function expects a value. Instead of
giving it a single value,
On Fri, Feb 11, 2011 at 3:59 PM, kyleduncan wrote:
> Thank you! Not sure how to work it just yet though. do I replace x
> with user? i tried this:
>
> results = results.sort(key=lambda x: x.last_login, reverse=True)
>
> and got an error that the Profile object
Something like this:
key = lambda x: x.last_login
--
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
You could be missing something, but I don't have enough to go on. Did
you add the field to your template? What do your view and template
look like?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Without testing it, I suspect the period in your 'request.GET' is the
problem. Try replacing it with request_get and see what happens.
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Would you post your urls.py? It looks like the problem is in there.
--
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
You're forgetting the pickle part. That's what the getter and setter
are for in my previous description.
import re
import pickle
pattern = re.compile(r'^\w{3}\s+\d{3}')
x = pickle.dumps(pattern)
type(x)
If you store 'x' in your database you won't have any difficulty with fixtures.
Shawn
--
If you don't find a better solution, and you're going to need this
feature frequently, you can always make a custom template tag. It's
not too much work.
http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/
--
You received this message because you are subscribed to the Google Groups
You can change the form's label to contain self.instance.promotion.description.
--
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
The picklefield stores strings. So when you say "regexes can't be
stored in fixtures," it implies that you're dealing with something
other than strings at that point. Have you tried the pickle field? As
I understand it, it's equivalent to this manual process:
Create a normal text field.
The feature works -- you just don't understand it. You probably know
what, but be aware that e-mailing a list and suggesting that their
software is fundamentally broken is not the best way to get friendly
help.
Have a look at the docs for settings.py:
Start by searching Google for Django and SOAP. If you can't figure out
what the prevailing solution is, name them specifically on this list
and ask if anyone suggests one over the others.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Enclose the name of the foreign key class in quotes. This way the file
will validate.
--
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
This is pretty easy. Instead of thinking about making dynamic forms,
think about making dynamic fields.
You'll have one form. When you initialize it, you'll pass it
information about the tickets available. In the __init__ of your form
you will dynamically add field objects to the form by
If you have the contrib.auth and session middleware installed (which you do by
default) then that will be available in you views without any additional
imports.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Set the field value to request.user.id.
--
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
On 02/09/2011 04:06 PM, SimpleDimple wrote:
Guys, Need to know which is the best forum/group for Django help ? I
thought this is the one but I don't see much activity here despite of
the fact that there are 19000+ members...where do you go for
discussing your django issues with people ?
Is
It sounds like you might be looking for Twisted instead of Django.
http://twistedmatrix.com/trac/
Shawn
--
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 is how you store additional information about users if you're using
the contrib.auth User.
http://docs.djangoproject.com/en/1.2/topics/auth/#storing-additional-information-about-users
Shawn
--
You received this message because you are subscribed to the Google Groups "Django
users"
601 - 700 of 1237 matches
Mail list logo