Re: extending User

2010-09-03 Thread Shawn Milochik
You should exclude the password field in your overridden model form. If you want to have a password added at the time of user registration then you can add an additional charfield to the form (make sure to use the "password" widget). You should probably add two such fields so you can compare them t

Re: custom file validation

2010-09-03 Thread Shawn Milochik
Any validation which has to do with multiple fields should be done in the clean() override, not within the individual field validator. You can't rely on cleaned_data existing before that point. http://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-o

Re: extending User

2010-09-03 Thread Shawn Milochik
Yes, the password stored will only ever be the hash type, hash salt, and hash. You should never store it in plain text. If you're interested you can look at the actual model. You might be interested in these functions: set_password(), get_hexdigest(), and check_password(). These make it clear what

Re: Automatically loading data into Django

2010-09-07 Thread Shawn Milochik
It doesn't seem like converting your data into fixtures will provide any advantage. If it's pipe-delimited, then just write a Python script imports the CSV module (which can handle other delimiters) and your model(s). Use it to read the data and convert it to dictionaries, then create instances of

Re: Integrating User Profile with Auth

2010-09-10 Thread Shawn Milochik
I think you just may be missing a call to get_profile() in this view. You can just do that and do a try block with an except block for DoesNotExist. That will let you know the situation you're in, whether the profile already existed or not. Also, unless I'm misreading something you're trying to pa

Re: regular expressions

2010-09-14 Thread Shawn Milochik
It depends on whether it can contain whitespace or must contain whitespace, and whether that whitespace may appear anywhere in the string or only in a certain location, or after (or before) some other matched pattern. Examples: [\w\s]+ will match "word" and/or whitespace, mixed. \w+[\w\s]+ will

Re: Unit testing in django without using test client

2010-09-16 Thread Shawn Milochik
You can use Python's unittest module to test any Python code (including Django code). What is it about Django's test client or TestCase class that is a problem for you? Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Proto-newbie needs Django for running an app, not for dev work

2010-09-17 Thread Shawn Milochik
Django is a Python module like any other. You won't be able to install it on shared hosting because you won't have permissions to the package directory. You can easily get around this by using virtualenv. Here are the basics you'll need: download virtualenv extract the tarball do not try to i

Re: tracking changes of a model's attributes

2010-09-17 Thread Shawn Milochik
One easy solution for this is to override the __init__() of your model and save the values of the properties you care about in a dictionary within your instance, such as self.orig_values. Then, override the save() and compare the values of your model to self.orig_values to see if they've changed.

Re: Auto Increment Primary_Key

2010-09-19 Thread Shawn Milochik
Did you do any database migrations, or just add the new field? Just adding the new field to the model doesn't undo the groundwork laid by your original syncdb, which has set up the other field as the primary key in the database itself. Although your Django model is the way you want it, your da

Re: Automatically creating fields

2010-09-20 Thread Shawn Milochik
There are always ways. You could subclass models.Model and add the behavior, if you read enough to understand how Django's models work. However, since you're only going create a model once (except migrations later), is it really going to save that much work? If you want to do it a quick & dirty

Re: django forms

2010-09-21 Thread Shawn Milochik
Of course. You can dynamically add to self.fields in the __init__ of your form instance. 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-us...@googlegroups.com. To unsubscribe from this group,

Re: Why Django Apps Suck

2010-09-21 Thread Shawn Milochik
Just FYI, the videos from DjangoCon 2010 are already up on blip.tv. The Python AV team was awesome. Here's that talk: http://blip.tv/file/4112452/ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: help setting 'apps' folder... path issue

2010-09-22 Thread Shawn Milochik
It's probably your PYTHONPATH. Check the result of: echo $PYTHONPATH I'm guessing that your apps directory is not in the path. If not, you can add it to your path. export PYTHONPATH=yourdirectory:$PYTHONPATH -- You received this message because you are subscribed to the Google Groups "Djan

Re: 'ifequal' takes two arguments

2010-09-22 Thread Shawn Milochik
Try writing both values to the screen or standard out. It's always possible that one of them isn't being populated. -- 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 unsubscr

Re: 'ifequal' takes two arguments

2010-09-22 Thread Shawn Milochik
Oh, and you don't have a space between those two variables, so it could be that they're running together and appear to be a single one. -- 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...@googlegrou

Re: Recommend a book

2010-09-23 Thread Shawn Milochik
I recommend "The Definitive Guide to Django," without reservation. See my review for more details: http://www.amazon.com/review/R2ET5WRO205C9I/ref=cm_cr_rdp_perm Ignore anyone who says it's outdated. Some people are thrown into fits of despair when a book's cover has a title that's 0.1 less th

Re: Recommend a book

2010-09-24 Thread Shawn Milochik
On Sep 24, 2010, at 6:53 AM, Franklin Einspruch wrote: > I recommend against Beginning Django E-Commerce in favor of The > Definitive Guide. The project described in the former has you chasing > down so many details that it's hard to get a sense of the big picture. > As a second book it's more in

Re: Universal form

2010-09-24 Thread Shawn Milochik
Context processors will do this for you. http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors -- 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.

Re: fixtures and dates

2010-09-24 Thread Shawn Milochik
We need more information. Preferably the full traceback. In short, something is trying to add a date object to a unicode text object. Possibly the date as a date object and the time as a unicode string. How did you convert the original data to JSON? -- You received this message because you are s

Re: Patterns / Best practice for automated data refreshes

2010-09-26 Thread Shawn Milochik
If you're updating a database created by Django, I recommend that your import script import your Django models and update them with the data. Otherwise you run the risk of running SQL that breaks your Django app (or worse, causes it to run with corrupted data and no errors). I'd do something wi

Re: notification in python

2010-09-27 Thread Shawn Milochik
If you're asking for functionality like this: http://www.changedetection.com/ Or are you looking for something to embed in your own code to know when something has happened on your own site? If the former, you can probably do it by scheduling a urlopen and saving its hash, comparing it each tim

Re: notification in python

2010-09-27 Thread Shawn Milochik
I did a quick Google search and didn't find anything that was obviously solving this problem. I did see companies that sell this service, and probably with good reason. Due to dynamic content such as ads, data from RSS feeds, and simply auto-generated content from server-side code, it seems tha

Re: DjangoCon 2011

2010-09-27 Thread Shawn Milochik
I live on the east coast, but the past two DjangoCons have caused me to fall in love with Portland. It would be a treat for me to get to go there again in 2011. In fact, if it's in Portland next year I plan to make a family vacation of it. So, that's my vote, for whatever it's worth. Hope to

Re: sending 3 e-mail randomly to user

2010-09-27 Thread Shawn Milochik
This sounds like more of a Python question than a Django question Have a look at Python's 'random' module and Django's 'send_mail' shortcut. 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-us.

Re: Really slow performance on webfaction

2010-09-28 Thread Shawn Milochik
Do you see anything at all like this if you run your app from your development box? You can always use the Python debugger to trace for your code and look for bottlenecks. (Awesome tutorial) http://www.doughellmann.com/PyMOTW/pdb/index.html Also, put in logging and add log.debug statements in

Re: Django in Depth

2010-09-28 Thread Shawn Milochik
http://djangocon.blip.tv/file/3322277/ -- 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.

Suppressing field in template for ChoiceField with only one option.

2010-09-29 Thread Shawn Milochik
I ran into an interesting forms issue today which I came up with a solution for. Now I'm wondering if there's a better way. Situation: I have a forms.Form with several fields in it, including a ChoiceField. The values in this ChoiceField are dependent on what the user has access to. Many users

Re: Suppressing field in template for ChoiceField with only one option.

2010-09-29 Thread Shawn Milochik
Actually, I spoke too soon on this one. My original solution doesn't work because the hidden input on the form doesn't have a value, so the form won't validate. I fixed this by just adding display: none to the widget attrs in the __init__ instead of changing the widget to a HiddenInput. Now the

Re: Suppressing field in template for ChoiceField with only one option.

2010-09-29 Thread Shawn Milochik
On Sep 29, 2010, at 5:08 PM, aa56280 wrote: > Can't you specify the value using the initial argument? > http://docs.djangoproject.com/en/dev/ref/forms/fields/#initial > > I did that originally, but it doesn't show up when the HiddenInput renders. That's why I stopped changing the widget. Sh

Re: passing request.META from view to form

2010-09-29 Thread Shawn Milochik
You can just add another keyword argument to your constructor. If you override the __init__ of your form then just pop that item off before passing it on to the __init__ in super() and nobody gets hurt. ;o) Shawn On Sep 29, 2010, at 6:03 PM, Oivvio Polite wrote: > I'm creating new users+pr

Re: Can you make a subclass of a model just to alter behavior?

2010-09-30 Thread Shawn Milochik
> > Hmm.. I can't think of any caveats off the top of my head. Did you try that? > The only thing that smells a little like trouble to me is setting a > default manager. If you create a custom manager, then add it to each model as "objects," then it'll be the default (and only) manager and any c

Re: A better way of checking if a record exists

2010-10-01 Thread Shawn Milochik
For what it's worth, I use the get_or_create with the 'default' keyword to do this: for record in reader: new_values = { 'product_code': slugify(record['Product Code']), 'msrp': record['Suggested Retail'], #etc... } product, was_created = Product.obje

Re: how to retreive the body text alone of a webpage

2010-10-02 Thread Shawn Milochik
You can use BeautifulSoup to parse the page. That will result in a BeautifulSoup object from which you can get the text of any element. Simple example: soup = BeautifulSoup.BeautifulSoup(html_string) #find a div with class 'header3' containing the text 'Locations' locati

Re: Why can't I use this model architecture?

2010-10-03 Thread Shawn Milochik
Check out South: http://south.aeracode.org/ -- 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

Re: convert list into a comma separated string

2010-10-04 Thread Shawn Milochik
','.join(your_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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, v

Re: convert list into a comma separated string

2010-10-04 Thread Shawn Milochik
On Oct 4, 2010, at 9:27 AM, ashwin morey wrote: > Hi, > > I am using django development server and not apache. But the print str is not > working. > I tried changing str to s, but no luck. > > thanks I think you would benefit greatly from doing a Python tutorial. http://docs.python.org/tuto

Re: unique constraint

2010-10-04 Thread Shawn Milochik
1. http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together 2. If you're using a foreign key to a User instance then duplicate names aren't a problem. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: unique constraint

2010-10-05 Thread Shawn Milochik
Why not just use a ModelForm? You can override the form's clean() or add a clean_url() method. You'll be able to use self.instance to get the model instance of the model form, and from that you can get the previously-used URLs. Shawn -- You received this message because you are subscribed t

Re: unique constraint

2010-10-05 Thread Shawn Milochik
I think your model should have a foreign key to User, and the user field in your model should be set by the time you're doing this validation. That makes more sense and is also a lot easier to do. Shawn -- You received this message because you are subscribed to the Google Groups "Django users

Re: unique_together to bind three fields

2010-10-06 Thread Shawn Milochik
The answer is in the error: ManyToManyFields are not supported in unique_together. Instead, you can put custom validation in your form's save(), your ModelForm, or (in Django 1.2) in your model validation. -- You received this message because you are subscribed to the Google Groups "Django

Re: How updated is the online version of the Django Book?

2010-10-07 Thread Shawn Milochik
Is there anything specific you're concerned about? Almost everything is applicable to the latest version. If you're not using trunk, then just being familiar with the 1.2 release notes will be enough to let you know if what you're reading is deprecated. Most Django books out there haven't ben

Re: OS Error, Permission Denined

2010-10-07 Thread Shawn Milochik
I have Webfaction. I found a file named /etc/redhat-release which states that my server is running CentOS release 5.5 (Final). I hope that helps. Look for a file in /etc beginning with 'lsb' (for Linux Standard Base') or 'redhat.' Shawn -- You received this message because you are subscribed

What's the best practice for Comet w/ Django?

2010-10-08 Thread Shawn Milochik
I searched the list online and haven't seen any recent discussions about this, so I figured I'd check in. Last I heard, Orbited was the way to go, but it seems that both it and django-orbited haven't seen any development in quite a while. The developer of Orbited is working on something called H

Re: How to specify NULL as the default of a model field.

2010-10-09 Thread Shawn Milochik
What are you trying to accomplish? If you set blank = True and null = True then they'll be null in the database after the migration and if left blank by the user. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: Use legacy DB or migrate DB to Django? How?

2010-10-09 Thread Shawn Milochik
If you do a Google search for "Django legacy database" you'll get all the info you need. It's a fairly common topic and it's all been discussed before. If you have any specific questions once you decide whether to migrate, use Django's inspectdb, or sync multiple databases then please ask for de

Re: How to specify NULL as the default of a model field.

2010-10-09 Thread Shawn Milochik
If the field isn't a required field, I don't think South would complain about no default being set. What type of field is it? What version of Django, and what version of South? Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: trouble creating first project

2010-10-10 Thread Shawn Milochik
It seems that the command you're running is not on your PYTHONPATH. You may have to enter the full path to django-admin. 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-us...@googlegroups.com.

Re: moving from Postgres to MySQL

2010-10-11 Thread Shawn Milochik
One way would be to use the dumpdata command to export everything, change your settings to point to the new database, then loaddata to restore. There may be a better way, but this way allows you to dump to a database-agnostic backup so it seems like it would suit your needs. Shawn -- You rece

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 1:58 PM, Brian Bouterse wrote: > I have found cron to be a poor solution for this although it is tempting > since it is so easy and will get you started right away. What I observe > happens is, basically someone puts the cron job in crontab, and then a lot of > time passes

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 4:11 PM, ringemup wrote: > >> It's surprisingly easy to get set up with nothing more than the >> tutorial/into for django-celery. If anyone has problems with it I'd be happy >> to try to assist. > > Thanks, I might take you up on that. > >> Although getting everything wor

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 5:07 PM, ringemup wrote: > Thank you for taking the time to explain that, Shawn -- it makes > everything a LOT clearer. > > If you could spare the time, I'm curious about a couple of aspects of > the architecture: > > - What is the purpose of having a separate broker and dae

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 5:25 PM, Javier Guerra Giraldez wrote: > On Wed, Oct 13, 2010 at 3:43 PM, Shawn Milochik wrote: >> C. The Celery daemon polls the broker regularly, looking for tasks. > > i hope this isn't polling, but a signal initiated by the broker. > > --

Re: How django admin knows about related objects on delete?

2010-10-19 Thread Shawn Milochik
Check out your model's _meta.get_all_related_objects(). Explore that through the interactive interpreter and you'll find everything you need. 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-us.

Re: Comments and cascade delete

2010-10-19 Thread Shawn Milochik
One possibility is to add a post-delete signal which listens for instances of news items and uses the content type to clean up comments with that content type and primary key. I'm pretty sure this isn't considered a bug, but I couldn't address the issue of whether it was a planned part of the desi

Re: Multi-user environment where users can add/edit/delete only their own posts

2010-10-20 Thread Shawn Milochik
Your post model should have a foreign key to user, perhaps named "creator" or "owner." Then ensure that the edit and delete views in your application can only modify or delete posts where the owner is request.user. Shawn -- You received this message because you are subscribed to the Google G

Re: Manual ordering

2010-10-20 Thread Shawn Milochik
Given a tuple/list of primary keys named ordered_ids and a queryset named records: results = [records.get(pk = x) for x in ordered_ids] This is a naive example, as it assumes that ordered_ids will never have IDs which don't exist in the queryset, but it gives a simple way to do what you're ask

Re: Adding relationship to User model

2010-10-21 Thread Shawn Milochik
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users This'll do the trick. ;o) 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-us...@googlegroups.com. To

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Shawn Milochik
And like magic, it's there! http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys -- 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 gro

Re: trouble installing django & connecting to irc

2010-10-24 Thread Shawn Milochik
On Sun, Oct 24, 2010 at 6:26 AM, Michael Scull wrote: > Hi, > I'm having trouble installing django and connecting to irc. > > -- > Mit freundlichen Grüßen / Best Regards, > Michael D Scull > If you want help, please look up the exact error output you're getting in the "Search this Group" box here

Re: Permission Denied when Trying to delete User

2010-10-26 Thread Shawn Milochik
Try going into the shell with 'manage.py shell,' import the User model, and attempt to delete that user. See what happens and give us the traceback if it fails and you still don't know why. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: overriding save-method

2010-10-27 Thread Shawn Milochik
Try this instead: http://djangosnippets.org/snippets/1478/ Or you could do it manually in your model: 1. Add field _value_json to your model. 2. Add functions (get_value, set_value) which do the simplejson work. 3. Add a property named 'value' with get_value and set_value as its getter and sette

Re: How can you change the color of the form's error messages

2010-10-27 Thread Shawn Milochik
The errors are given a standard 'error' class. You can just add CSS to modify it to your tastes. 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-us...@googlegroups.com. To unsubscribe from this

Displaying (only) custom form fields in a template.

2010-10-27 Thread Shawn Milochik
I'm using Django 1.1. I have a forms.Form that has fields in it, and I'm dynamically creating custom fields, each with a name beginning with 'custom_.' In my template I'm already displaying the non-custom fields. I need to be able to show just the custom fields. How do I iterate through only the

Re: newbie having trouble with conversion to south

2010-10-28 Thread Shawn Milochik
>From the traceback it seems that your hypothesis about the Python version may be correct. I don't know what versions of Python South tests with. However, I'm in the same situation you are (Cent OS), and I get along wonderfully with virtualenv. I'm using Python 2.7 and everything's grand. If you n

Re: newbie having trouble with conversion to south

2010-10-28 Thread Shawn Milochik
A short note about your primary concern: You can simply change the shebang line of your manage.py script to point to the 'python' in your virtualenv. The same goes for a .wsgi file. There's nothing particularly magical about "activating" a virtualenv in an interactive terminal session. Shawn --

Re: How to make base.html a little more useful?

2010-10-31 Thread Shawn Milochik
Context processors, or a custom template tag, as described in James Bennett's book, "Practical Django Projects." -- 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: Third party object like model field

2010-10-31 Thread Shawn Milochik
http://docs.djangoproject.com/en/dev/howto/custom-model-fields/ -- 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+unsub

Re: Change the initial data to a modelForm

2010-11-02 Thread Shawn Milochik
I don't think you need to change the value, but rather add localization so add proper formatting. http://docs.djangoproject.com/en/dev/topics/i18n/localization/#format-localization -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Making a m2m field required

2010-11-06 Thread Shawn Milochik
Add a clean() method to your ModelForm, and raise a forms.ValidationError if self.instance.whatever.all().count() == 0. 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-us...@googlegroups.com.

Re: postgres CREATE DATABASE from django

2010-11-06 Thread Shawn Milochik
Don't use Django's connection; just use psycopg2 directly. -- 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.

Re: Trouble accessing development server

2010-11-09 Thread Shawn Milochik
Instead of the domain try 0.0.0.0 or your public IP address. python manage.py runserver 0.0.0.0:8000 or python manage.py runserver 82.165.105.204:8000 #this is just a sample IP address for Host Monster Shawn -- You received this message because you are subscribed to the Google Groups "Djang

Re: Trouble accessing development server

2010-11-10 Thread Shawn Milochik
If you're using Internet Explorer you have to add the http:// to the URL. If you're not, I apologize for suggesting you might be using the Big Blue E. ;o) Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: How to extract answer from QuerySet

2010-11-10 Thread Shawn Milochik
The queryset returns zero or more instances of your model. So if there's only one result, you can just get the first item in the queryset by its index. For example: some_queryset = YourModel.objects.filter(**kwargs) if some_queryset.count() == 1: x = some_queryset[0] #x is now an instanc

Re: How to extract answer from QuerySet

2010-11-10 Thread Shawn Milochik
2010/11/10 Łukasz Rekucki : > On 10 November 2010 21:55, Shawn Milochik wrote: >> The queryset returns zero or more instances of your model. So if >> there's only one result, you can just get the first item in the >> queryset by its index. >> >

Re: How to extract answer from QuerySet

2010-11-10 Thread Shawn Milochik
Łukasz, Good and valid points. Thanks. 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegrou

Re: Can't move down then up the directory tree for inserting of html files

2010-11-10 Thread Shawn Milochik
On Wed, Nov 10, 2010 at 4:42 PM, Brian wrote: > Dan, Thanks for the reply. > > I just can not get it to work. Works just fine in same or any > directory under the dir that the .py file is in. > > I played with TEMPLATE_DIRS setting without any luck, tested to the > root dir and still does not work

Re: How to extract answer from QuerySet

2010-11-10 Thread Shawn Milochik
On Wed, Nov 10, 2010 at 5:16 PM, octopusgrabbus wrote: > Thank you. This worked well. > However, I'm left with this value > > > How do I get that into a comparable form? > It sounds like you're getting the __unicode__() representation of your model. If you want the data in the actual fields you'

Re: Generic Views - do you use them?

2010-11-11 Thread Shawn Milochik
On Wed, Nov 10, 2010 at 4:35 AM, derek wrote: > I have not really understood when and why they are needed; I would be > interested to see an alternative also because it might improve my > understanding. > I've never used them before, and always avoided looking into them because I thought they wer

Re: TemplateDoesNotExist

2010-11-12 Thread Shawn Milochik
On Fri, Nov 12, 2010 at 3:12 PM, Lindsay Hunt wrote: > I'm really a novice with using Django.  Can you help me understand where I > can find the settings.py ? You really need to at least do the tutorial. If you have questions this basic, then if someone answers them you'll probably get stuck imm

Re: TemplateDoesNotExist

2010-11-12 Thread Shawn Milochik
Sure: djangogigs.com is a good resource. 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegro

Re: Django mod_python under apache

2010-11-12 Thread Shawn Milochik
The recommended way to do this is to actually use Python's logging module. If you're using trunk or 1.3 beta then you can configure it right in settings.py. If you really want to view print statements, use the development server (in your development environment) and you'll see them. Also, dependi

Re: Sidebar blocks

2010-11-13 Thread Shawn Milochik
Another solution is to use context processors (they're in the docs). -- 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+

Re: OT: getting strange attempted gets

2010-11-14 Thread Shawn Milochik
It's definitely possible. I've seen that myself before. 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsub

Re: OT: getting strange attempted gets

2010-11-14 Thread Shawn Milochik
On Sun, Nov 14, 2010 at 1:23 PM, John Fabiani wrote: > On Sunday, November 14, 2010 09:19:01 am Shawn Milochik wrote: >> It's definitely possible. I've seen that myself before. >> >> Shawn > > While in this runserver mode is my database password exposed? >

Re: bash: django-admin.py: command not found

2010-11-15 Thread Shawn Milochik
The version of Python isn't related to this. The problem is that the django script you are calling isn't on your system's PATH. If a program is on your PATH, such as the 'ls' command, you can just type 'ls' and it will run. If you type 'which ls' you will see where the program lives. You can also

Re: Django Dropdown List

2010-11-15 Thread Shawn Milochik
You'll need to use AJAX for this, or refresh the entire page. Be aware that you'll have to have all the states/provinces as 'choices' in the ChoiceField in the form, otherwise the form won't validate. As for examples, just do a quick Google search. The easiest way (in my opinion) is to use jQuery

Re: Send emails form multiple accounts

2010-11-16 Thread Shawn Milochik
What version of Django are you using? Also, you can create a customized Connection() for each piece of mail you send: http://docs.djangoproject.com/en/dev/topics/email/ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Send emails form multiple accounts

2010-11-16 Thread Shawn Milochik
On Tue, Nov 16, 2010 at 10:39 AM, diegue...@gmail.com wrote: > I'm using django 1.2 but i dont know how connections works exactly, i wish > use only one backend, SMTP, but how i tell the connection, the new user for > authentication for smtp? > Read the fine Django docs at the link I attached. Yo

Re: loggin limits

2010-11-16 Thread Shawn Milochik
On Tue, Nov 16, 2010 at 7:40 PM, Alex s wrote: > Hi, > > I am planning to limit the number of users logged online in my application. > > How can I do it? > > Thanks > Alex There is no "logged in" state for a user. You will have to store user IDs and the last time a request came in for that user,

Re: Django Dropdown List

2010-11-17 Thread Shawn Milochik
On Tue, Nov 16, 2010 at 9:08 AM, derek wrote: > " you'll have to have all the states/provinces as 'choices' in the > ChoiceField in the form, otherwise the form won't validate." > > Yup, this is a "real" gotcha.  IMO, its not really true filtering if > you take this approach, as the initial form w

Re: INSTALLED_APPS doesn't check my projet dir

2010-11-17 Thread Shawn Milochik
When you put an app into INSTALLED_APPS, it looks on your PYTHONPATH. If you make an app intended to be pluggable, your users should be installing your application with pip or something, and your app code will exist on the PYTHONPATH, not in a subfolder of their Django project. If you want to dev

Running Selenium unit tests -- no server running

2010-11-17 Thread Shawn Milochik
I installed the django-selenium-test-runner package and have finally have almost everything working. Everything happens up through the launch of the browser, but when it tries to hit the 127.0.0.1 there's no connection. It appears that there's no test server running. I obviously can't run it manual

Re: URL grows in address bar with each click

2010-11-19 Thread Shawn Milochik
What does the "action" parameter of your HTML form contain? I'm guessing it's a relative URL. If you want it to go to the same place, you can make the action blank ("") and it will submit to the same page. Shawn -- You received this message because you are subscribed to the Google Groups "Djan

Re: django_content_type integrity error on sync and loaddata

2010-11-19 Thread Shawn Milochik
When you run dumpdata you can specify apps or models within an app to export. That will allow you to avoid bringing Django's scaffolding into your fixtures. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Debugging Unit Tests

2010-11-22 Thread Shawn Milochik
This works for me. Are you certain the code you think is being executed is where it's "freezing"? Try some logging statements. How are you running your tests -- are you just using the standard test runner? On Nov 22, 2010, at 9:04, Murray wrote: > pdb dosn't seem to work inside my unit tests,

Re: Testing Newforms for Blankness

2009-12-24 Thread Shawn Milochik
On Dec 24, 2009, at 2:51 PM, Aristotle Miternan wrote: > Hello all, > >I'm fairly new to Django and I noticed a curious behavior of > forms. I noticed that there is no simple way to test a form for a form > not being filled at all. I think it might be a semi-common use case > that you might

Re: about django model save

2009-12-25 Thread Shawn Milochik
Django-south is the best solution right now. Django-evolution is no longer developed, as the author thinks South is the current best solution. http://south.aeracode.org/ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Get name from request.path

2009-12-25 Thread Shawn Milochik
Try this: request.META['HTTP_HOST'] If not, check the docs for the request object: http://docs.djangoproject.com/en/dev/ref/request-response/#httprequest-objects Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: mmmmm

2009-12-25 Thread Shawn Milochik
Michael, I think what Karen was referring to was this: http://catb.org/~esr/faqs/smart-questions.html It's not how much or how little you know. It's how you ask the question. There are a lot of people on this list who will willing answer the most elementary question, if the request is made in a

<    1   2   3   4   5   6   7   8   9   10   >