Re: how should I get the request object?

2012-11-26 Thread Mike S
Sometimes it is very inconvenient to make the `request` object available deep in the call stack, so I wrote a short middleware to work around this issue: http://djangosnippets.org/snippets/2853/ On Monday, November 26, 2012 5:16:01 AM UTC-5, Miaobing Jiang wrote: > > how should I get the reques

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Mike Dewhirst
On 1/12/2012 3:48pm, Loai Ghoraba wrote: I have ran chmod o+rx on the root directory, isn't this enough (isn't chmod applied to all folders down recursively ?) ? No. You need chmod -R o+rx and I have checked the directories from the root down to static, all have the permission of drwxr-xr-x

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Mike Dewhirst
On 1/12/2012 3:57pm, Loai Ghoraba wrote: thanks, but I have tried this now and it also doesn't work :X though the author slides presentation mentioned chmod o+rx on the root dir only. On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: chmod -R

Re: Model method versus overriding save()

2012-12-09 Thread Mike Dewhirst
the project is mature and requires the final molecule of optimisation. Mike - Tom Derek [1] https://docs.djangoproject.com/en/dev/topics/signals/ On Saturday, 8 December 2012 04:27:50 UTC+2, Chris Cogdon wrote: It's a simple performance

Re: Model method versus overriding save()

2012-12-09 Thread Mike Dewhirst
save(), or instead of it? I haven't used signals yet but I think I'm going to in the near future because I can't think of another way to deal with certain actions I want to happen after deletion of related objects. Mike -- You received this message because you are subscr

validation error in Django Admin

2012-12-12 Thread Mike Dewhirst
ave signal to "drop that one" using ... Item_Pictogram.objects.filter(item=instance, pictogram=pic, via='auto').delete() The local var value above being u'33' happens to be the exact pk of the Item_Pictogram record I want to delete - I checked in Postgres. The pk should be an

[Solved] validation error in Django Admin

2012-12-13 Thread Mike Dewhirst
the above example, removing e from b.entry_set() is equivalent to doing e.blog = None, and because the blog ForeignKey doesn't have null=True, this is invalid." [1] https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.remove Mi

trouble with pre_delete signal method

2012-12-16 Thread Mike Dewhirst
ete the B record or just remove the mark and save it None of my code appears in the TraceBack so I assume the Admin is trying to delete the A record. I've tried both pre_delete and post_delete signals in the A record. Why is it so? Thanks for any hints Mike -- You received this mes

Re: trouble with pre_delete signal method

2012-12-18 Thread Mike Dewhirst
ome of the models and I removed all that as well. As mentioned earlier, embedded print statements seem to prove the delete_bparts() code is working nicely. When I comment out the pre-delete connection, the A_Part record gets delete as expected - but obviously it doesn't clean up the B re

Re: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
There is no change in the error. The A record won't delete and the entire transaction rolls back. I'm stumped. Do you think this is an edge case? Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
On 20/12/2012 12:09am, Thomas Orozco wrote: Hi Mike, Could you try using a debugger as suggested? Yup Otherwise and if that's OK with you / your job, could you send me minimal model code off-list so I can have a look at it? I'm pretty sure we're just missing something ob

Re: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
ta option to signal that ModelChoiceField needn't worry if the record does not exist. Thanks for all your effort Much appreciated Mike (See https://github.com/django/django/blob/master/django/forms/models.py#L988) On a side note, I can't see how your delete_bparts method would w

[Solved]: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
On 20/12/2012 10:59am, Mike Dewhirst wrote: On 19/12/2012 11:58pm, Thomas Orozco wrote: Hi, If you have no relationship, I'm a bit at a loss. I think the easier way would be to use a debugger if possible. I think we need to know what field is causing the ValidationError. The line t

Re: Converting Django app into a Desktop app

2012-12-20 Thread Mike Dewhirst
See also https://us.pycon.org/2012/schedule/presentation/393/ by Ryan Kelly and his 'esky' package for safely updating distributed apps. There is a link to that and other items in the above pycon talk. Mike On 21/12/2012 9:55am, Filip Wasilewski wrote: Hi, On Tuesday, December

Re: Change label/title from an application added to django admin

2012-12-23 Thread Mike Dewhirst
db again. That would give you a second app alongside emp in the admin. Depending on how much data you have, you could dump from emp and load into employee or simply re-enter your data. When everything is working, drop emp. Mike -- You received this message because you are subscribed to the

Re: Django asset management and dynamically created databases

2012-12-23 Thread Mike Dewhirst
s go with the flow rather than try and make something work against the design. Good luck Mike Is django appropriate for this purpose? Am I approaching this all wrong? Thanks for your help and please forgive my limited django knowledge. Chad -- You received this message because you are subscr

Re: How do I create timestamp type columns in (mySQL) database?

2012-12-26 Thread Mike Dewhirst
ldays = leapdays(dday.year, dday.year + yrs) future = datetime.fromordinal(dday.toordinal() + (yrs * 365) + ldays) return timezone.make_aware(future, pytz.utc) And, as general practice I long ago decided to use datetimes exclusively so I don't have to think too hard. hth Mike m

Re: Serving static files: Tried 3 ways with no luck

2012-12-26 Thread Mike Dewhirst
media dirs. Then I experimented with settings.STATICFILES_FINDERS until I figured out exactly what delivered the goods. hth Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://grou

Re: manage.py collectstatic?

2012-12-28 Thread Mike Dewhirst
Mike Thanks Derek -- 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 mo

Re: Design by composition and persistance

2012-12-28 Thread Mike Dewhirst
https://docs.djangoproject.com/en/1.5/ and https://docs.djangoproject.com/en/1.5/ref/models/fields/#module-django.db.models.fields.related Cheers Mike Say you're designing an event management program. Each event has a name, occurs in a suburb, and has a start time and end time. Say you want to model a

Re: Design by composition and persistance

2012-12-29 Thread Mike Dewhirst
That won't duplicate anything. But there is nothing wrong with being rigorously 3rd normal form right now and then optimising later - if necessary. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Creating a project error

2012-12-31 Thread Mike Dewhirst
.x and then you need to check which version of Python 3.x it needs. If you are using Django 1.4.3 (which I think is the latest stable release) you should be using Python 2.x hth Mike from functools import total_ordering ImportError: cannot import name total_ordering what should i do? i

Re: Can't set static file directory.

2013-01-08 Thread Mike Dewhirst
ia/my_proj/ Alias /static/ /var/www/static/my_proj/ Alias /tiny_mce/ /var/www/static/my_proj/js/tiny_mce/ Alias /jquery/ /var/www/static/my_proj/js/jquery/ Then in your template you can use {{ STATIC_URL }}/whatever Hope this helps Mike Thanks. -- You received this message because

Re: Correct way to specifiy database-level column defaults

2013-01-10 Thread Mike S
> > For `DateField`s and `DateTimeField`s specifically, also take a look at > the `auto_now` and `auto_now_add` keyword arguments, documented > here: > https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.DateField -- You received this message because you are subscribed t

Re: How do I display a static image in my index.html file?

2013-01-13 Thread Mike Dewhirst
On 14/01/2013 2:18am, frocco wrote: I finally got this working. Why is it necessary to run collectstatic? in PHP, I would just point to the images. Consider that you might have a number of apps in your project. As an experienced Django dev you would probably keep your separate apps nicely se

w3c accessibility design

2013-01-16 Thread Mike Dewhirst
, has anyone tackled this with any success? Thanks for any hints Cheers Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send e

Re: how do I dynamically modify a choice field

2013-01-23 Thread Mike Dewhirst
-dynamic-values/ Good luck Mike -- 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/-/BSrfbUYb_v8J. To post to this group, send email to django-u

Re: how do I dynamically modify a choice field

2013-01-23 Thread Mike Dewhirst
On 24/01/2013 10:46am, frocco wrote: Thanks Mike, I do not know if this will work. I want to change the field in the template as I read each row. I do this in PHP rather easy, but am confused on how to do this using django. I haven't done much php (only emergency repairs to stuff writt

Re: how do I dynamically modify a choice field

2013-01-24 Thread Mike Dewhirst
On 24/01/2013 10:30pm, frocco wrote: Thanks Mike, Since I am new to django, how would I code this? In my for loop, my row.stock field has a value. Lets say row.stock is 20 I want my choice field to show 1 to 20 The next row.stock might have 12 I want my choice field to show 1 to 12 In other

how to delete in the admin - strategy needed

2013-02-03 Thread Mike Dewhirst
overview, how should I be doing this? At the moment I'm trying to do it all via model methods calling various managers because it feels like the right place to do it. I have tried to make a custom manager with use_for_related_fields = True but still get the same error. Thanks for any he

Customizing the Admin by Grouping Sets

2013-02-04 Thread Mike Kaply
I apologize in advance if there is an obvious answer this. I'm totally new to Django and still trying to figure things out. We have a large set of data that will come in through Django - error reports from our product. What I'd like to have in the admin is that rather than showing all the erro

Re: how to delete in the admin - strategy needed

2013-02-04 Thread Mike Dewhirst
ne place. The answer has to be in a models.Manager somewhere. I guess I need to dig deeper. Thanks Mike On Mon, Feb 4, 2013 at 2:14 AM, Mike Dewhirst wrote: This is the error ... Select a valid choice. That choice is not one of the available choices. I want to delete a bunch of "chil

Re: how to delete in the admin - strategy needed

2013-02-04 Thread Mike Dewhirst
delete signal of the Parent model. The purpose of the method is more or less documented below. I've tried this a number of different ways and always get the "Select a valid choice ..." error mentioned below. On 4/02/2013 6:14pm, Mike Dewhirst wrote: This is the error ... Select

Re: how to delete in the admin - strategy needed

2013-02-05 Thread Mike Dewhirst
lifying as hard as I can and ... I'm currently studying the traceback - which is *all* Django code and none of mine. More later Thanks again. Mike [1] Your version was what I tried first because that is what the docs illustrate. I eventually used the list to make sure the query_set act

Re: how to delete in the admin - strategy needed

2013-02-05 Thread Mike Dewhirst
effort - I'm sorry to waste your time. Mike On 6/02/2013 2:14pm, Mike Dewhirst wrote: Pankaj, thank you I have tried the code in a number of ways - including the way you wrote it[1] - and located in either Master[2] or Parent and it always runs to completion without raising its own exceptio

Re: Problen with Custom command and Bash Script

2013-02-06 Thread Mike Dewhirst
On 7/02/2013 12:39am, Jesús Lucas Flores wrote: Hey guys, I need a little bit help with a custom manage.py command called *test* There is already a manage.py subcommand called test. Might be an idea to rename your custom command and try again. Just a thought ... I am using it in a vi

Re: Access to data via many-to-many while in save()

2013-02-06 Thread Mike Dewhirst
ortcut but I'm not immediately familiar with it. I'd have to read the query docs. Mike def save_model(self, request, obj, form, change): # save object and the many-to-many data obj.save() # this does not work: data_I_need = obj.m2m.all()[0].child_fiel

Re: Access to data via many-to-many while in save()

2013-02-07 Thread Mike Dewhirst
super(Parent, self).save(*args, **kwargs) This is not necessarily the correct way to do things. I think there might be Django shortcut but I'm not immediately familiar with it. I'd have to read the query docs. Mike def save_model(self, request, obj, form, change):

django guru

2013-02-17 Thread Mike Dewhirst
I'm looking for a Django guru to help with some debugging. Please contact me off-list for details. I'm constrained by non-disclosure so I can't reveal anything on the list. Thanks Mike -- You received this message because you are subscribed to the Google Groups "Djan

Re: django guru

2013-02-18 Thread Mike Dewhirst
On 18/02/2013 6:50pm, Mike Dewhirst wrote: I'm looking for a Django guru to help with some debugging. As suggested by Russell here is some detail ... The design is moderately complex with all business rules built into model methods. The prototype is well advanced and based entire

looking for a Django app for annual subscriptions

2013-02-19 Thread Mike Dewhirst
s would be invoiced directly outside the app. If no-one suggests anything, I'll start my own and welcome any contributors. It would end up being open sourced. Thanks anyone Mike -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: looking for a Django app for annual subscriptions

2013-02-20 Thread Mike Dewhirst
On 21/02/2013 12:01am, Pankaj Singh wrote: Hey Mike, As James has already mentioned about Stripe here, Thanks James - Stripe looks excellent but it is only available (currently) in north America. you should have a look at https://github.com/amccloud/django-stripe, a user subscription

Re: Saving browser output as pdf

2013-02-23 Thread Mike Dewhirst
as well. But here is what you probably want ... https://docs.djangoproject.com/en/1.4/howto/outputting-pdf/ Mike -- 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

Re: m2m relation just working in one direction

2013-02-24 Thread Mike Dewhirst
Roberto I'm not entirely sure but it is possible that your group is getting mixed up with the contrib.auth group. I would try changing the name of my group temporarily to something else just to eliminate that. Mike On 25/02/2013 8:58am, Roberto López López wrote: Hi, I have a pr

Re: Manually added foreign key not working.

2013-02-24 Thread Mike Dewhirst
On 25/02/2013 2:59pm, laxmikant ratnaparkhi wrote: Does anybody can answer this? Try changing your model from FK_Formats = models.ForeignKey(Formats) to ... FK_Format = models.ForeignKey(Formats)Â Â ... and see what happens to the error. Mike Let me know if anything extra is required

Re: manage.py and django-admin.py help

2013-02-27 Thread Mike Dewhirst
;PYTHON_EGG_CACHE", site_root) from django.core.wsgi import get_wsgi_application application = get_wsgi_application() --- IIRC, having __init__.py in site_root makes this work. Otherwise I think I might have previously used project_root instead. hth Mike On W

Re: Benchmarking and timing DB transactions in Django

2013-03-04 Thread Mike Dewhirst
There are a few interesting pages if you google 'scaling django' and here is one those ... https://speakerdeck.com/jacobian/django-doesnt-scale Mike On 5/03/2013 12:29am, Venkatraman S wrote: On Fri, Feb 22, 2013 at 4:48 PM, R R mailto:r01123581...@gmail.com>> wrote:

Re: Django 1.4.3 contact_form

2013-03-04 Thread Mike Dewhirst
never use tabs. Most text editors let you configure them to use spaces instead of tabs. If you do that you will need to replace all tabs with your preferred number of spaces. Once you fix that the error will go away. Mike def contact(request): if request.method == 'POST':

Re: Is there any database ( or other ) magic going on with django properties?

2013-03-12 Thread Mike Dewhirst
properties anything else than python functions defined on a Class Or does django build in some special functionality for them? Django is just Python. Mike Doug -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Mike Dewhirst
bugging something diabolical and didn't put it back for another reason but that's another story. Thanks Mike The official (and useless) answer is that you must pass "user" in everywhere you save anything. This is stupid, obviously, because you can not rewr

Re: resize modelform fields on template

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 11:05am, cabrazil wrote: Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: Hi all! I'd like to know if there's a way to resize my modelform fields on the template. They're bei

Re: resize modelform fields on template

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 4:25pm, Mike Dewhirst wrote: On 15/03/2013 11:05am, cabrazil wrote: Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: Hi all! I'd like to know if there's a way to

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-15 Thread Mike Dewhirst
On 15/03/2013 4:56pm, Russell Keith-Magee wrote: On Fri, Mar 15, 2013 at 11:58 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: What is the right way to design a system whereby on every save for every model the updated_by column is changed to the user.id <http://user.i

Re: how do I order a selection box in admin?

2013-03-15 Thread Mike Dewhirst
On 16/03/2013 1:59am, frocco wrote: Hello, I have a product record that can be assigned multiple categories. The problem I am having is the category list is not sorted by name. how can I sort the list in admin when I try and add a new product? Have you seen ... https://docs.djangoproject.com/

How to get ten random records

2013-03-18 Thread Mike Dewhirst
t too concerned about true randomness? Do I need try: except: pass to silence errors if there aren't any results? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: How to get ten random records

2013-03-18 Thread Mike Dewhirst
On 19/03/2013 3:29pm, Christophe Pettus wrote: On Mar 18, 2013, at 9:03 PM, Mike Dewhirst wrote: No really, I want a maximum of ten random records from the database (Django 1.4, Postgres 9.1). This is a case where the raw SQL interface might be the right answer: you can just tack an ORDER

Re: How can I get around required fields in admin?

2013-03-19 Thread Mike Dewhirst
using the clean() method in the model is keeping validation as close to the data as possible - where it belongs! Mike -- 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

Re: Django split setting and environment variables

2013-03-21 Thread Mike Dewhirst
On 22/03/2013 7:58am, Alan Johnson wrote: I think hardcoding local machine development passwords is fine, but it's still better to store the production passwords in a key-value file that stays out of source control and is permissioned such that only authorized developers can directly access the s

First ever DjangoCon AU - precedes Pycon-au in Hobart in early July

2013-04-02 Thread Mike Dewhirst
All Just forwarding the Pycon-au notice for obvious reasons ... "This year we're welcoming the Python on OpenStack day, and the first ever DjangoCon AU. These will happen on Friday July 5, just before the CodeWars Tournament, where we'll pit teams of developers against each other on the big s

Re: General Apache Deploy Strategy

2013-04-02 Thread Mike Dewhirst
deployment? Perhaps a single command can get all the necessary bits from the repo? Non-automated deployment used to go wrong for me more often than not. I use Buildbot now to get it right without fail every time. Mike It’s not that I can’t live with copying the project in its entirety, but

foreign key with unique versus one-to-one

2013-04-03 Thread Mike Dewhirst
I have noticed that there appears to be no difference in Postgres between a OneToOneField and a ForeignKey with unique=True Is there any/much difference in Django? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: foreign key with unique versus one-to-one

2013-04-03 Thread Mike Dewhirst
On 4/04/2013 5:15pm, Russell Keith-Magee wrote: On Thu, Apr 4, 2013 at 1:01 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: I have noticed that there appears to be no difference in Postgres between a OneToOneField and a ForeignKey with unique=True Is there an

Re: General Apache Deploy Strategy

2013-04-04 Thread Mike Dewhirst
open up a deploy branch in the repo and merge trunk into that when I'm ready to deploy. Then I only need a script on the production server to fetch the deploy branch whenever I want to update production. Mike -- You received this message because you are subscribed to the Google Groups &

Re: Trouble with CSS/Static Files

2013-04-04 Thread Mike Dewhirst
of where things are and if compare that output with the location indicated in the html page source, you will be able to diagnose the problem fairly easily. Hth Mike Vibhu On Fri, Apr 5, 2013 at 4:00 AM, CJ Milholland mailto:cjm1...@gmail.com>> wrote: Have you ran $ manage.p

Re: General Apache Deploy Strategy

2013-04-05 Thread Mike Dewhirst
op of the checked-out code from the networked repo and commit when you get a network again. You wouldn't do that though. You would abandon svn for git or hg or similar. On Thu, Apr 4, 2013 at 7:30 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: On 5/04/2013 12:36am, Bill Fr

Re: need help designing models

2013-04-06 Thread Mike Dewhirst
mary keys or there is an expert insisting on it. hth Mike * * Would you suggest any better design ? (actually, I never formally read DB) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rece

Re: need help designing models

2013-04-06 Thread Mike Dewhirst
. It is possible that you have a good reason for doing so but it is generally a bad idea. Personally I would go with the Django auto-incrementing primary key and keep the apparent uid as a CharField attribute of the college. ymmv Mike -- You received this message because you are subscribed to

Re: New to testing

2013-04-10 Thread Mike Dewhirst
On 11/04/2013 2:02pm, Lachlan Musicman wrote: Hi I'm new to testing. Not to Django. To my shame. I'm trying to test some m2m signals connections, so I have a Inside your test class before writing tests you can have ... def setUp(self): jack = MaleAccountFactory() jill =

Re: New to testing

2013-04-10 Thread Mike Dewhirst
On 11/04/2013 2:42pm, Lachlan Musicman wrote: On 11 April 2013 14:23, Mike Dewhirst wrote: On 11/04/2013 2:02pm, Lachlan Musicman wrote: Inside your test class before writing tests you can have ... def setUp(self): jack = MaleAccountFactory() jill

Re: m2m symmetry confusion

2013-04-11 Thread Mike Dewhirst
, apprentice etc. I don't think it would be as complex as a multi-table design like yours but that would depend on what your system has to achieve. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: m2m symmetry confusion

2013-04-11 Thread Mike Dewhirst
robably need a clean() method in the person model which raised an appropriate Exception when someone tried something incestuous :) Sorry about top-posting. Mike On 12/04/2013 10:47am, Matt Schinckel wrote: On Friday, April 12, 2013 9:52:10 AM UTC+9:30, Lachlan Musicman wrote: On 12 April 20

Re: Static Files on IIS install

2013-04-11 Thread Mike Dewhirst
ooking for static files and compare what you see with STATIC_URL. IIS has to look in STATIC_ROOT for those. hth Mike Thanks in advance. -- Mark :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: Static Files on IIS install

2013-04-12 Thread Mike Dewhirst
You need to make IIS serve the static files from a given location. 1. Run collectstatic and note where it puts the files (STATIC_ROOT). 2. Tweak IIS so it connects STATIC_URL to STATIC_ROOT. I can't help there because I have never used it. I could help if it was Apache. Good luck

Re: Guide for migrating to a custom user model?

2013-04-17 Thread Mike Dewhirst
On 18/04/2013 9:55am, Brian Neal wrote: Hello - I have a Django site that I've been maintaining for 4 years. It is running Django 1.4 now and is using the usual Django User model plus the get_profile() method to retrieve some extra information for each user. Now that Django 1.5 has landed and we

Re: Guide for migrating to a custom user model?

2013-04-17 Thread Mike Dewhirst
- unless someone else gets in first. Mike - Chris [1]: http://ponytech.net/blog/2013/03/31/migrate-your-user-profile-data-django-15-custom-user-model/ On Wed, Apr 17, 2013 at 5:34 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: On 18/04/2013 9:55am, Brian Neal wrote:

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread Mike Dewhirst
On 26/04/2013 8:32am, dsmakear...@gmail.com wrote: That probably means the tutorial can't really demonstrate 404.html, 500.html, or 403.html customization. If you are getting 500 errors you should be able to see your own 500.html displayed. On Thursday, April 25, 2013 6:24:37 PM UTC-4

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread Mike Dewhirst
ocalhost' is in ALLOWED_HOSTS. That should make the 500 error go away when DEBUG == False Mike That is: * DEBUG = True, in debug mode - the code works without error * DEBUG = False, in production mode - the code fails Server Error (500) Aside from my setting DEBUG to False, this is all django g

Re: Import project from Linux to Windows

2013-05-05 Thread Mike Dewhirst
x27;t know enough about the situation. Come back with a progress report - and any problems - so someone can answer specific questions Cheers Mike Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Import project from Linux to Windows

2013-05-06 Thread Mike Dewhirst
oproject.com/en/1.5/ Good luck Mike -- 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 grou

Re: [newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread Mike Dewhirst
On 9/05/2013 10:04pm, crosa wrote: Hi guys, I'm testing django in order to build a little application. This application will have several models, so I've decided to split up them, in order to do this more readable (Any other form to do this?) When I run python manage.py syncdb, the models tables

Re: not able to create a site, instead text document pops out.

2013-05-10 Thread Mike Dewhirst
torial easily Good luck Mike does not create folder 'mysite', instead (as any other commands like version, help..) commnad gives a tetx documents poping out with text contents: #!c:\Python27\python.exe from django.core import management if __name__ == "__main__&quo

Re: Help converting from mysql to postgres

2013-05-18 Thread Mike Dewhirst
for that purpose. It is reliable and easy. I can show you my scripts for that if you want. Maybe you can use MySQL dump and edit the output to look like the Postgres dump then load that? Maybe someone has written converter? Mike On 19/05/2013 8:47am, frocco wrote: I am getting

Re: No styling in Chapter 6 in djangobook

2013-05-20 Thread Mike Dewhirst
On 21/05/2013 11:07am, djingo django wrote: I'm starting to learn Django and have been reading through the djangobook.com. I am able to get the code running when I come to Chapter 6: The Django Admin Site, but it looks nothing like the well-formed and well-styled screenshots in the documentatio

Re: Help with robots.txt

2013-05-24 Thread Mike Dewhirst
On 24/05/2013 10:04pm, frocco wrote: Hello, Can someone give me an example of configuring robots.txt? I want to block the admin site. and anything else? I needed this info recently and googled robots.txt. This was the second item ... http://www.robotstxt.org/robotstxt.html -- You rece

Re: Scripts to update Django tables

2013-05-29 Thread Mike Dewhirst
On 30/05/2013 12:01am, Brian wrote: I'm new to Django (and frameworks in general) and having an issue with a project I'm working on. Basically, I want to scrape data from a sports league website on a regular schedule and add updated stats into my database. I think the way you have described th

Re: Using multiple model files per app with the Improved Multiple Model Files Django Snippet

2013-05-30 Thread Mike Dewhirst
On 30/05/2013 10:43pm, Doug S wrote: I'm trying to use multiple files for my models in a single app. I found a nice solution on Django Snippets : http://djangosnippets.org/snippets/1838/ but I'm not able to get it to work. The docs assume that I know more than I do abo

Re: Best packages for aggregating news + compiling stats

2013-05-30 Thread Mike Dewhirst
On 31/05/2013 1:18pm, C. N. Desrosiers wrote: I'm in the early stages of planning a website that will aggregate news on a specific topic (and later have other sections with statistics pulled from various public data sets). Google News seems to have an excellent algorithm for selecting the most r

Re: linux or windows

2013-05-31 Thread Mike Dewhirst
oftware truly cross-platform. On the other hand I don't know of anyone voluntarily using Windows as a Django production server platform. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and sto

Re: Writing your first Django app - Tutorial Question

2013-06-04 Thread Mike Dewhirst
On 5/06/2013 9:10am, Tony Guilin wrote: In the https://docs.djangoproject.com/en/1.5/intro/tutorial01/ tutorial under the, Playing with the API section, I'm trying to go through the example in my python shell as described. p = Poll(question="What's new?", pub_date=timezone.now()) But

problem with logical and

2013-06-06 Thread Mike Dewhirst
ent call last): File "C:\users\miked\py\xxx_project\xxx\items\tests\test_utils.py", line 272, in test_attach_current self.assertEqual(obj.is_current(), True) AssertionError: False != True ------ Windows XP Python 2.7

Re: problem with logical and

2013-06-06 Thread Mike Dewhirst
On 7/06/2013 1:31pm, Mike Dewhirst wrote: I can't work this one out. I have a blind spot. Any help appreciated. Accidentally fixed this trying workarounds. Still not sure what was happening but I suspect I don't fully understand None in the boolean context. Anyway, I'm bein

Re: Deployment problem with google bots

2013-06-23 Thread Mike Dewhirst
On 22/06/2013 11:54pm, frocco wrote: Hello I get error messages from time to time because a google bot try's to view a product that no longer exists. How do I prevent this? Are you responding with the correct error message (probably 404) when someone looks for a non-existent page? -- You

Re: Help in finding how to learn Django

2013-06-28 Thread Mike Dewhirst
r path to learn how to bend Django to my will would be invaluable! M. I thought that way in the beginning. Going with the Django flow is much more productive. Welcome :) Mike Thank you for your time. -- You received this message because you are subscribed to the Google Groups "Django

Re: What is the best practice to learn Django 1.5?

2013-06-28 Thread Mike Dewhirst
On 28/06/2013 11:47pm, Roberto López López wrote: Two scoops of django is also a good book https://django.2scoops.org/ +1 On 06/28/2013 03:45 PM, Gabriel wrote: Hey, you could also try Getting Started With Djangorest, that's a series of classes in everything you might need to become a Dja

data transfer between databases

2013-06-30 Thread Mike Dewhirst
em. Any suggestions? There are currently three reference tables involved and two have m2m relationships between themselves. The other is stand-alone. Customer data is fine in the production database and won't be touched. There are no relationships with the reference tables. Thanks Mike --

Re: data transfer between databases

2013-06-30 Thread Mike Dewhirst
nship. Thanks Mike On 30/06/2013 5:40pm, Mike Dewhirst wrote: This is probably a Postgres question but someone might be able to offer advice on how to transfer data :) New "reference" or read-only data gets input during development and I want to transfer it to the production databa

Re: HELP : Installation of Django 1.6 in Windows

2013-06-30 Thread Mike Dewhirst
le to use the same technique on Windows 7. 1. Download the Django 1.6 zip file and unzip it into a temporary directory. 2. Get a command prompt and cd into the directory containing setup.py which is under the temporary directory 3. Execute the command "python setup.py install" Sho

Re: data transfer between databases

2013-06-30 Thread Mike Dewhirst
On 1/07/2013 8:28am, François Schiettecatte wrote: Mike FWIW - I have a site for which I need to do that, I use MySQL so I just dump the data using mysqldump, transfer it to the other machine and load it up. There is some scripting around it to keep track of IDs so I dump deltas only, works

Re: data transfer between databases

2013-07-01 Thread Mike Dewhirst
Tom I'm not a DBA so I'll need to do some quiet study of those references. Thanks for that. Cheers Mike On 1/07/2013 9:35pm, Tom Evans wrote: On Sun, Jun 30, 2013 at 11:24 PM, Mike Dewhirst wrote: mulianto and Avraham Thanks for your suggestions. Dumping data isn't the

Re: Getting URL root

2013-07-01 Thread Mike Dewhirst
separate servers. I edit them manually for the very few servers my stuff runs on. AND I make sure the sites table is identical on all sites so I don't have to think about it ever again. YMMV. Mike -- You received this message because you are subscribed to the Google Groups "Django use

<    5   6   7   8   9   10   11   12   13   14   >