Re: Common fields auto values

2013-10-23 Thread Mike Dewhirst
On 24/10/2013 12:21am, Domagoj Kovač wrote: Hi guys, I have a question. I am working on an application that i can use as a starting point for my future projects. I have a core application that has CommonFields abstract model defined as: from django.db import models from django.contrib.auth.mod

Re: 1.5.4 /static/ serving 500 error

2013-10-24 Thread Mike Dewhirst
On 25/10/2013 6:14am, Thomas Murphy wrote: Hi all, with structure |myproject |---static |---picture.jpg |--myproject ---settings.py This could be improved in the sense that Django projects usually consist of one or more apps - like this ... |myproject |---static | (empty unt

Re: (3rd party app) How to safely reverse a custom user model admin url?

2013-10-28 Thread Mike Dewhirst
On 29/10/2013 8:15am, Ivan VenOsdel wrote: More simply, how do I put {{app_label}}_{{model_name}}_changelist in a template for a custom auth_user model without knowing the details of said model? I am guessing I don't want to refer to settings.auth_user_model in the template. It feels like the on

Re: User names not support Unicode in 1.5

2013-10-30 Thread Mike Dewhirst
On 31/10/2013 1:49am, tim wrote: See https://code.djangoproject.com/ticket/20694 for a discussion of this. In summary: "[Allowing unicode in user names] would be considered a regression for anyone who relies on Django to validate that usernames are ASCII-only. A custom user model (introduced in

Re: Speed Improvements: Properties, Database Denormalization, Caching, Connection Pooling, etc.

2013-10-30 Thread Mike Dewhirst
On 31/10/2013 3:09pm, Carlos D. wrote: Note: one other thing is that the legacy DB we're using has a character varying (PostGres) type as its primary key, even though it's really just an integer that should probably be auto incrementing serial type. If you install South you should be able to ad

Re: Speed Improvements: Properties, Database Denormalization, Caching, Connection Pooling, etc.

2013-10-31 Thread Mike Dewhirst
Couple of links which might be of interest ... http://www.jeffknupp.com/blog/2012/02/14/profiling-django-applications-a-journey-from-1300-to-2-queries/ http://gun.io/blog/fast-as-fuck-django-part-1-using-a-profiler/ ymmv Mike On 31/10/2013 2:47pm, Carlos D. wrote: So, first thing: I come fr

Re: slice QuerySet and keep as QuerySet

2013-10-31 Thread Mike Dewhirst
On 1/11/2013 12:01pm, brian wrote: *How do I slice a QuerySet and keep it as a QuerySet* https://docs.djangoproject.com/en/1.5/ref/models/querysets/#when-querysets-are-evaluated https://docs.djangoproject.com/en/1.5/ref/models/querysets/#methods-that-return-new-querysets *If I do* *a = qs

Re: Django 1.5 or Django 1.6 with python 3.3 on windos Server 2008

2013-11-07 Thread Mike Dewhirst
On 7/11/2013 9:34pm, Robert Jonathan Šimon wrote: I still dont now how i can install Django into IIS. If you decide to use IIS you will find very few people able to help you if things go wrong. From a practical perspective, it would be safer to use Apache in your Django stack. However, you

Re: Django 1.5 or Django 1.6 with python 3.3 on windos Server 2008

2013-11-09 Thread Mike Dewhirst
ion is Apache. How can i install it with django 1.5 and python 3.3? On Thu, Nov 7, 2013 at 1:40 PM, Mike Dewhirst wrote: On 7/11/2013 9:34pm, Robert Jonathan Å imon wrote: I still dont now how i can install Django in

Re: Unidirectional relations

2011-04-19 Thread Mike Dewhirst
I think you would need an intermediate table 1:n with the parent containing the child ids. Otherwise the children need a foreign key reference to the parent. On 20/04/2011, at 10:06 AM, Juan Pablo Romero Méndez wrote: > Hello, > > Is it possible to create unidirectional relations within djan

Re: Checking for user type in view

2011-04-24 Thread Mike Dewhirst
On 25/04/2011 7:15am, Kenny Meyer wrote: Hello guys, In my application models I have two models, Judge and Participant: Another way might be to use django groups. Have a participant group and a judge group and pop your users into one or the other. I prefer this approach for my own purposes

Re: installer

2011-04-24 Thread Mike Dewhirst
the best way to do it? - Any tools that can help me? On Apr 4, 9:57 pm, Mike Dewhirst wrote: On 5/04/2011 12:04pm,ydjangowrote: Is there a package or easy way to create an installer to auto install apache, django, mysql based web app? The best way is to script the installation. Google for

Re: learning Django after a break -- site tutorials, examples

2011-05-19 Thread Mike Dewhirst
On 20/05/2011 1:35pm, John Griessen wrote: I've gone through the Django 1.2 tutorial to the point of creating an admin site, then had to switch to other work for months. What are some good simple example sites or tutorials for creating a top page ( index.html ) and using templates with css?

Re: Learning Django: Approach / Advice / Resources

2011-05-30 Thread Mike Dewhirst
Robin Don't worry - your mother is probably right. Here are my "rules" ... 1. Dive into Python 3 rocks 2. Read "Practical Django Projects"(*) or if you decide against that get yourself a small-ish concrete target and avoid extraneous functionality like the plague. Then when it is working loo

Re: Is there an HTML editor that's Django-aware

2011-05-30 Thread Mike Dewhirst
On 30/05/2011 11:41pm, Jacob Kaplan-Moss wrote: On Monday, May 30, 2011, BobX wrote: If anyone from the Django Project itself is listening then can I (very humbly) suggest that some editor recommendations would make a real fine addition to the info on the site (useful to n00b's like me anyway).

Re: Beginner needing help with a TemplateDoesNotExist exception, when the file does exist.

2011-06-05 Thread Mike Dewhirst
On 6/06/2011 6:51am, Christopher wrote: 110 "/home/foobar/templates", ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to

Re: Beginner needing help with a TemplateDoesNotExist exception, when the file does exist.

2011-06-05 Thread Mike Dewhirst
directory is located in my home/foobar/, thus the /home/foobar/templates. Is there something wrong with this? On Jun 5, 4:38 pm, Mike Dewhirst wrote: On 6/06/2011 6:51am, Christopher wrote: 110 "/home/foobar/templates", ??? -- You received this message because you are subsc

how to do one-time passwords

2011-06-12 Thread Mike Dewhirst
I need a choice of login mechanisms ... - Standard django-auth for some users - SMS a one time password for other users Would you think the following is the way to go? The user interface seems clunky to me. Any feedback will be greatly appreciated. 1. Enter the userid and optional password

Re: how to do one-time passwords

2011-06-13 Thread Mike Dewhirst
this and it looks interesting ... http://stackoverflow.com/questions/5096924/implementing-a-secure-two-factor-authentication-for-a-login-page-with-django-form Thanks Mike I. On Jun 13, 7:36 am, Mike Dewhirst wrote: I need a choice of login mechanisms ... - Standard django-auth for some

Re: Unsafe to continue Django session unencrypted? (i.e. login with HTTPS then drop to HTTP after that?)

2011-06-14 Thread Mike Dewhirst
They should be worried. But the session id is not the credentials. So it is probably argued that it is secure enough. However, you should google firesheep. That is a browser add-on which can hijack non-SSL sessions over unsecured wireless. Mike On 15/06/2011, at 2:40 PM, Chris Seberino wro

Re: Django and Rich Client

2011-06-18 Thread Mike Dewhirst
On 18/06/2011 12:55am, Knack wrote: 2) LDAP authentification > >> 3) Role based authorisation. Here I'm a bit unsure about the approach. > >> I would implement it by myself within the django world (don't know yet > >> where exactly). > >> See django-ldap-groups by Peter Herndon. http:

Re: Directory structure issue.

2011-06-25 Thread Mike Dewhirst
On 26/06/2011 8:18am, Frederico Betting wrote: Hi All I am beginner in using django framework and I'm trying to do a project with a different directory structure but it's not working and I don't know what I am doing wrong. Follow an example for what I am doing: project `-- core |-- app1

virtualenv with dev server

2011-07-14 Thread Mike Dewhirst
Trying to get virtualenv working for the first time for a new project and have stumbled somehow. I can get it working as advertised (see below) but django dev server doesn't notice. Any hints appreciated ... ||| here is virtualenv being activated C:\users\miked\py\ssds>Scripts\activate (ssds)

[solved] virtualenv with dev server

2011-07-14 Thread Mike Dewhirst
tivate, this loads the correct python and the correct django. I haven't actually written any code or organised directories yet so it errors and exits but I can see which django is barfing and I'm happy. Thanks again Mike On 14/07/2011 5:54pm, Mike Dewhirst wrote: Trying to get virt

Re: Accounting app - design decisions needed

2011-07-18 Thread Mike Dewhirst
On 19/07/2011 9:13am, Andre Terra wrote: The problem is I'm supposed to have millions of entries; all with the same date, thousands for the same Account, hundreds with the same description and perhaps dozens with the same value. I think I'm going with force-overwrite for the month, at least f

Re: setting up homepage, and naming/organizing apps

2011-07-19 Thread Mike Dewhirst
On 19/07/2011 1:49pm, Alex Hall wrote: Hello all, I was on this list a few months ago, but was unable to get a django-friendly web host. I am now helping with a site on Bluehost, which does support django, and I am hoping to be given permission by the guy in charge to use django instead of php fo

Re: Some thoughts on a 'backwards incompatible change' (bug!!) found in latest DDT.. wtf?

2011-07-21 Thread Mike Dewhirst
On 22/07/2011 9:25am, Cal Leeming [Simplicity Media Ltd] wrote: On Fri, Jul 22, 2011 at 12:22 AM, Andre Terra > wrote: Totally agreed. I expect DDT to only be displayed for INTERNAL_IPS and only during DEBUG mode, it shouldn't be an OR clause. Bu

Re: What is the Development Life Cycle of Django App?

2011-07-22 Thread Mike Dewhirst
On 23/07/2011 12:31am, Eyad Al-Sibai wrote: What is the Development Life Cycle of Django App? Should I start in implementing the models or the urls ... or what exactly? Best advice I know is in Practical Django Projects by James Bennett -- You received this message because you are subscribed

Re: A problem about rpc4django

2011-07-25 Thread Mike Dewhirst
On 25/07/2011 6:04pm, Kejun He wrote: Hi, A strange problem! The same project about RPC could work normally in Linux, but it reported a error "global name 'dispatcher' is not defined" on development server(http://127.0.0.1:8000) in Windows OS. Did anyone meet this problem before? Could you t

Re: ALL CAPS input and Sentence case

2011-07-26 Thread Mike Dewhirst
On 27/07/2011 1:48am, christian.posta wrote: Forgive me if this might be more of a python-centric or text-handling question more than Django, but it does come up within the context of web development, processing user input, etc in all web frameworks including django. I did a quick search on the f

Re: Database doubt

2011-07-26 Thread Mike Dewhirst
As someone else said to another person today - use South http://south.aeracode.org/docs/about.html It will read your updated models and apply the changes to the database. It is brilliant. Mike On 27/07/2011 6:20am, Gmail - neonmark wrote: On 7/26/2011 11:50 PM, vaibhav agarwal wrote: Hey,

Re: Recommended locations for templates?

2011-07-27 Thread Mike Dewhirst
On 27/07/2011 5:05pm, Rodney Topor wrote: What is the recommended best practice for locating templates in a project directory? In particular, which of the following two structures is considered better? 1. project/templates/{app1,app2,...} This is better if you have a separate team editing te

Re: USE_I18N vs. USE_L10N

2011-07-28 Thread Mike Dewhirst
On 29/07/2011 1:56pm, kenneth gonsalves wrote: On Thu, 2011-07-28 at 09:37 -0700, Lucy Brennan wrote: Before I comment, I would like to actually know if I got it right. In Django: USE_I18N: translation USE_L10N: localized formatting Right? wrong http://en.wikipedia.org/wiki/Internationaliza

Re: USE_I18N vs. USE_L10N

2011-07-29 Thread Mike Dewhirst
On 29/07/2011 5:38pm, Masklinn wrote: On 2011-07-29, at 05:56 , kenneth gonsalves wrote: On Thu, 2011-07-28 at 09:37 -0700, Lucy Brennan wrote: Before I comment, I would like to actually know if I got it right. In Django: USE_I18N: translation USE_L10N: localized formatting Right? wrong Th

surrogate key question

2011-07-30 Thread Mike Dewhirst
A bit of design first. We need to track a document through finite lifetimes. The document has a legal validity pertaining to real world events which occurred during such lifetimes. That "same" document gets revised/replaced every so often or even arbitrarily if an improvement is made. The sy

Re: USE_I18N vs. USE_L10N

2011-07-31 Thread Mike Dewhirst
On 1/08/2011 8:09am, Lucy Brennan wrote: I read Wikipedia and Django docs. Now, after all this debate, I see that I _did_ understand the definitions when I first read it. Given those definitions however, the meaning of USE_I18N and USE_L10N are not obvious. Far, far, far from obvious. There _a

Re: USE_I18N vs. USE_L10N

2011-08-01 Thread Mike Dewhirst
Russell Thank you for the clarification. Just a couple of questions below ... On 1/08/2011 11:09pm, Russell Keith-Magee wrote: Close, but not quite. * USE_I18N turns on the availability of translations at all. If USE_I18N is false, all translation-related activities are no-ops. * Assuming

this is how to do it if you are new to Django [Was: Django docs and GSoC doc summit]

2011-08-05 Thread Mike Dewhirst
I've been using the docs and haunting this list for a while and I think I have a more-or-less new-user perspective. First of all, the docs are great especially when compared to other stuff out there for other kit. But if we (er, not necessarily me) are going to hack on the docs we need an objective

ManyToMany to_field through and db_table questions

2011-08-08 Thread Mike Dewhirst
Can anyone tell me if to_field is valid in this context and what is the distinction between through and db_table? ... class Sections(models.Model): """ intermediary table for Document recursive m2m """ document = models.ForeignKey(Document, to_field='ancestor') section = models.Forei

Re: ManyToMany to_field through and db_table questions

2011-08-08 Thread Mike Dewhirst
On 8/08/2011 8:42pm, Michal Petrucha wrote: On Mon, Aug 08, 2011 at 06:28:59PM +1000, Mike Dewhirst wrote: Can anyone tell me if to_field is valid in this context and what is the distinction between through and db_table? ... class Sections(models.Model): """ interme

Re: Tutorial Part 2, django 1.3, installed via bitnami

2011-08-08 Thread Mike Dewhirst
On 9/08/2011 9:49am, eggxtreme wrote: Hi, i've had some strange errors when trying to install django standalone, so i have used the whole bundle option, linked from documentation. Bitnami. It installed python, django, apache, sqlite I use Windows XP btw. I'm not sure whether Bitnami will le

making history

2011-08-10 Thread Mike Dewhirst
I want to update a history record whenever a particular record changes. Is it reasonable to call a method from within the save method of a model to go off and do the work? def updatehistory(recordx): """ if HistoryX doesn't exist, insert it so the RecordX author can add commentary. Als

Re: making history

2011-08-10 Thread Mike Dewhirst
On 10/08/2011 7:08pm, Subhranath Chunder wrote: You could probably consider using post_save signals and make things a bit little more generic. Thanks - I'll read up on that ... Cheers Mike On Wed, Aug 10, 2011 at 1:38 PM, Mike Dewhirst <mailto:mi...@dewhirst.com.au>> wrote

Re: making history

2011-08-10 Thread Mike Dewhirst
On 10/08/2011 10:37pm, Shawn Milochik wrote: I do essentially that, using a post_save signal and dumping the serialized model instance to MongoDB with datestamp, etc. The relevant part is this (after importing Django's serializers): serialized_object = serializers.serialize( "jso

Re: making history

2011-08-10 Thread Mike Dewhirst
On 11/08/2011 9:51am, Shawn Milochik wrote: Mike, I'm doing something similar in another project. I created a sublass of models.Model and am using that throughout the project, which makes it much easier. I'm sub-classing models.Model to include created, updated and updated_by fields which is

Re: making history

2011-08-11 Thread Mike Dewhirst
-log for a while, and so far it works great. However, I do need to work on saving the records to a separate db, as Shawn suggested. Fwiw, there's a page on the wiki about audit trail/logs, which, albeit outdated, should prove helpful. Cheers, AT On 8/10/11, Mike Dewhirst wrote: On 11/08/201

Re: "Great circle" using the django ORM?

2011-08-12 Thread Mike Dewhirst
Thomas Don't know if this helps but one degree of latitude is sixty nautical miles at the equator and slightly less at the poles. Not worth worrying about. OTOH, one degree of longitude shrinks from 60 NM at the equator to zero at the poles - which might help you visualize the necessary math

model save question

2011-08-16 Thread Mike Dewhirst
When using save() in a model, what is the difference between ... save(self, force_insert=False, force_update=False) or save(self, force_insert=False, force_update=False, **kwargs) # whatever super(Xyz, self).save(force_insert, force_update) or super(Xyz, self).save(force_insert, force

Re: model save question

2011-08-16 Thread Mike Dewhirst
Thanks DR Mike On 16/08/2011 6:10pm, Daniel Roseman wrote: On Tuesday, 16 August 2011 08:21:24 UTC+1, Mike Dewhirst wrote: When using save() in a model, what is the difference between ... save(self, force_insert=False, force_update=False) or save(self, force_insert=False

Re: model save question

2011-08-16 Thread Mike Dewhirst
By the way, is there any other kwarg for save? 2011/8/16 Mike Dewhirst <mailto:mi...@dewhirst.com.au>> When using save() in a model, what is the difference between ... save(self, force_insert=False, force_update=False) or save(self, force_insert=False, force_update=False, *

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread Mike Dewhirst
On 18/08/2011 11:23am, michael kapelko wrote: I don't think the OP want to select which db is used, but to connect to the db with the logged in user's credentials. Exactly. DB authentication and user authentication are separate things. Users authenticate against Django. Full stop. Django> ac

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-12 Thread Mike Dewhirst
roblem you describe. hth Mike On Dec 11, 8:06 pm, Mike Dewhirst wrote: On 12/12/2010 10:56am, jc wrote: I've tried to fix my config files and it gives me a 500 error, here is what i see n the logs. I've been told by someone else that they think it's still my mod_wsgi/Apache

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-12 Thread Mike Dewhirst
On 12/12/2010 10:55pm, Mike Dewhirst wrote: On 12/12/2010 12:35pm, jc wrote: I ran the Django develplment server and everything runs fine. It's only when I go back to the other web server that things start to break on me. In that case check out http://blip.tv/file/3840484 for G

Re: __init__.py file executed twice ?

2010-12-13 Thread Mike Dewhirst
On Dec 13, 10:57 am, martvefun wrote: > On 10-12-10 11:09, Mike Dewhirst wrote: > > On 10/12/2010 7:43pm, martvefun wrote: > >> On 09-12-10 01:37, Mike Dewhirst wrote: > >>> It seems like a good place to put it. Maybe you can test to see if the > >>> thr

Re: New to Django, sheet music organization site

2011-01-02 Thread Mike Dewhirst
On 3/01/2011 9:56am, Kyle wrote: Ok I have a good start. I have run into a problem though. In my database, I have an artist field. Most artists have a space in there name. When creating my URLs, how can I ignore white space? For example, take the artist Chris Tomlin. In my database, it will show

Re: Django's documention is horrible

2011-01-12 Thread Mike Dewhirst
OK - so we need an intro to the documention which describes the timeline of a typical* developer transitioning from beginner to guru and the docs which should be of interest at successive stages during that transition. *typical - I know there ain't such a person. However, there ought to be a "

Re: model best practice

2011-01-13 Thread Mike Dewhirst
On 13/01/2011, at 11:45 PM, Олег Корсак wrote: > hello. My models.py file became very big and actually I can divide that > app for 2-3 different apps. But the problem is that almost all models > are related to one model which is common and will be in different app. > Is it still a good idea to di

Re: Converting from Wordpress, upgrading users.

2011-01-15 Thread Mike Dewhirst
On 16/01/2011 3:03am, Sean Brant wrote: I am migrating a site from Wordpress to Django and I need the old username and passwords to keep working. Maybe you can write an auth backend to continue using the Wordpress auth? http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authenticatio

Re: Problem with overriding the default Django admin page.

2011-01-17 Thread Mike Dewhirst
This is what I do ... in settings.py # this is the directory containing settings.py PROJECT_DIR = os.path.realpath(os.path.dirname(__file__)) # if templates are not found here look in app_name/templates TEMPLATE_DIRS = (os.path.join(PROJECT_DIR, 'templates/'),) This makes my templa

Re: Problem with overriding the default Django admin page.

2011-01-17 Thread Mike Dewhirst
On 18/01/2011 1:59pm, Mike Dewhirst wrote: This is what I do ... in settings.py # this is the directory containing settings.py PROJECT_DIR = os.path.realpath(os.path.dirname(__file__)) # if templates are not found here look in app_name/templates TEMPLATE_DIRS = (os.path.join(PROJECT_DIR

Re: Challenge with installing django on windows 7 64 bit

2011-01-26 Thread Mike Dewhirst
On 27/01/2011 9:22am, j_syk wrote: Hello- I only develop django on osx and lunix (ubuntu), but I've looked into options for installing it on my windows desktop- even though I've never gotten around to it... I've found http://www.instantdjango.com/ which has all the common files you need to develo

Re: newbie help with console, can't run Django function

2011-01-26 Thread Mike Dewhirst
On 27/01/2011 12:02pm, Casual Coder wrote: I'd like to get handy with using the console. Do I have a setup problem or a usage problem? >>> from django import VERSION >>> VERSION (1, 3, 0, 'alpha', 1) >>> See following pydev console output. Am I not able to run get_version() like that?

Re: newbie help with console, can't run Django function

2011-01-26 Thread Mike Dewhirst
On 27/01/2011 1:02pm, Casual Coder wrote: Thanks Mike. But Darn I'm not as powerful as I had hoped. I expected DUMPDATA to work the same way, but it doesn't. How did VERSION work? VERSION didn't actually "work". It is a constant which is an attribute of django. Bear in mind that django is

Re: newbie help with console, can't run Django function

2011-01-26 Thread Mike Dewhirst
On 27/01/2011 2:35pm, Casual Coder wrote: import django django.VERSION (0, 96.406, None) django.get_version() Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'get_version' Maybe Django version 0.96 didn't use a get_vers

Re: Calling out for Help!

2011-02-10 Thread Mike Dewhirst
On 10/02/2011 6:19pm, Cal Leeming [Simplicity Media Ltd] wrote: On Wed, Feb 9, 2011 at 4:38 PM, Dev@CB mailto:d...@churchbudget.com>> wrote: Well, the "python manage.py runserver" command returned a screen full of errors. What would be the appropriate way to post that? If you don't wis

Re: Location for generating temporary files

2011-02-13 Thread Mike Dewhirst
On 14/02/2011 9:37am, vivek_12315 wrote: Hello all, while coding for views in django, i feel the need of generating files, more like logs. But i want all those logs to be generated in a specific directory. So, can I use my settings.py file for defining such a location of dir. and in views files

Re: Django Mutlisite Setup

2011-02-13 Thread Mike Dewhirst
On 14/02/2011 2:08pm, Jason Drane wrote: Forgive me if this question offends you more advanced users. I am begun down the road of learning Django. I am curious if it is possible to place Django in the root of my server and reference it to each of multiple sites in development, similar to php, py

Re: Django Code Generator

2011-02-23 Thread Mike Dewhirst
On 24/02/2011 11:46am, Brice Leroy wrote: Hello, I posted a while ago about this project and since it's pretty complete now, I'd like to get your opinion on it and advices on features that might be useful. I've been interested in this for a while and I'm delighted to see you have kept it goin

Re: Django Code Generator

2011-02-23 Thread Mike Dewhirst
e you need to do the development work on your website. Mike I'd also like to be able to make some project public so they can be "fork" by other users. ... lots of idea, no so much time :-( 2011/2/23 Mike Dewhirst mailto:mi...@dewhirst.com.au>> On 24/02/2011

Re: Django Deploy Updates App.

2011-03-16 Thread Mike Dewhirst
Matteius Check Ryan Kelly's esky - http://pypi.python.org/pypi/esky This is for "frozen" python apps but the principle you describe is central to esky. Mike On 17/03/2011 1:36pm, Matteius wrote: One of the things I've considered lately that I would like for my Django project is a Word Press

Re: how to parse string in django

2011-03-27 Thread Mike Dewhirst
On 28/03/2011 1:38pm, django beginner wrote: hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 Do you also keep am and pm? What about UTC offsets? You need a helper method to interpret the numbers, convert them to seconds, do the comparison and re

Re: how to parse string in django

2011-03-27 Thread Mike Dewhirst
On 28/03/2011 1:38pm, django beginner wrote: hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 wherein I could compare the results - convert in integer: Further to my earlier reply ... >>> x = 3 >>> y = '%02d' % x >>> y '03' >>> if 14> 3 . .

Re: installer

2011-04-04 Thread Mike Dewhirst
On 5/04/2011 12:04pm, ydjango wrote: Is there a package or easy way to create an installer to auto install apache, django, mysql based web app? The best way is to script the installation. Google for "scripted installs " or similar. You should find some examples you can rework to suit your nee

Re: LDAP and 1.2

2011-04-05 Thread Mike Dewhirst
On 5/04/2011 5:46pm, Szabo, Patrick (LNG-VIE) wrote: Hi, has anyone sucessfully conncted their django 1.2 app with Active Directory ?! Which snippet did you use ?! I have had great success with Peter Herndon's ldap-groups in eDirectory ... http://code.google.com/p/django-ldap-groups/ ..

Re: LDAP and 1.2

2011-04-05 Thread Mike Dewhirst
On 6/04/2011 12:44am, Sells, Fred wrote: Because our active directory contains many more users than are allowed to use my django app, I have a cron job that runs every 5 minutes and updates a mysql database with the subset I care about. That way if AD is offline at the time, I’m not hosed.

Re: framework web comparison

2011-04-08 Thread Mike Dewhirst
On 8/04/2011 7:19pm, Stuart MacKay wrote: Evaluating frameworks that are reasonably feature complete can only be a subjective exercise. You could compare features but even with a specific feature set that you were looking for you stil have to evaluate the claims to make sure that the framework

Re: Windows path for django_crontab

2015-01-18 Thread Mike Dewhirst
On 19/01/2015 8:54 AM, sarfaraz ahmed wrote: Hello All, I am trying to use django_crontab to run repetitive task. I want to insert records to database on a particular time. Also, I am in process of learning django hence I m trying to reach every aspect of django. The issue i am facing i m able

Re: How to add my Templates folder to TEMPLATE_DIRS

2015-01-18 Thread Mike Dewhirst
On 18/01/2015 5:01 PM, Kishan Mehta wrote: Hello all, > I want to customise how admin page looks > I have my template folder in my application folder at C:\Users\kishan\Django_App\polls\templates\admin > In settings.py I have added TEMPLATE_DIRS = [os.path.join(BASE_DIR,'C:\Users\kishan\Dja

Re: Newbie question: How to avoid a very long view function?

2015-01-18 Thread Mike Dewhirst
On 19/01/2015 6:28 PM, Cheng Guo wrote: Hello, I am new to Django and I have run into an issue with views.py. I understand that there is a function behind each view. For a view that I am currently writing, it accepts a file upload from user and stores the file on the server. To do that, I need

two django sites at different revisions with apache

2015-02-02 Thread Mike Dewhirst
Is it possible to run two virtual hosts on the same machine for Django sites where one is 1.7 and the other 1.6? 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 emails from it, sen

Re: two django sites at different revisions with apache

2015-02-03 Thread Mike Dewhirst
mes On Mon, Feb 2, 2015 at 11:44 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: Is it possible to run two virtual hosts on the same machine for Django sites where one is 1.7 and the other 1.6? Thanks Mike -- You received this message because you are subs

Re: App for storing ChangeLogs in database

2015-02-06 Thread Mike Dewhirst
I don't have a solution for you but maybe you are just looking for strategies? Like you, I don't like showing users the commit messages. We use Trac for our ticketing and insist no work gets done without a ticket. We added a custom field to Trac called "Release note". So when someone raises a

Re: mark_safe and ValidationError params

2015-02-06 Thread Mike Dewhirst
On 7/02/2015 8:32 AM, Andrew Pinkham wrote: I'm currently running Django 1.7.4. Provided the following clean function on a form: def clean_slug(self): new_slug = self.cleaned_data['slug'].lower() if new_slug == 'invalid_value': raise ValidationError(

Re: mark_safe and ValidationError params

2015-02-06 Thread Mike Dewhirst
On 7/02/2015 10:29 AM, Mike Dewhirst wrote: How do I properly apply mark_safe to text passed to params of exceptions? mark_safe returns a string-like object so if you embed it inside another string it might get missed. I think it is best to apply mark_safe when the return value won'

Re: Hit API in python django

2015-02-14 Thread Mike Dewhirst
On 14/02/2015 8:06 PM, Kapil Tomer wrote: I am developing a site on django. I want to hit a api url. Please suggest me. Its realy very urgent. Thanks http://www.django-rest-framework.org/tutorial/quickstart/ -- You received this message because you are subscribed to the Google Groups "Django

Re: Sqlite3 to Postgres Migration?

2015-02-19 Thread Mike Dewhirst
On 20/02/2015 3:07 AM, Tom Lockhart wrote: On Feb 18, 2015, at 11:04 PM, talex wrote: I have a functioning Django application that is based on sqlite3, but I want to change to using Postgres. I’ll point out for the benefit of others who might be getting started: Postgres is a full feature

Re: Sqlite3 to Postgres Migration?

2015-02-20 Thread Mike Dewhirst
On 21/02/2015 9:55 AM, talex wrote: Thanks for your helpful comments. Andrew, thanks for your migration article at http://afrg.co/updj17/a2 . It is slightly daunting for me at this point, but I may need to come back to it later. Your book looks interesting. Mike, thanks for the dump/load load

Re: How to handle model constants

2015-02-23 Thread Mike Dewhirst
On 23/02/2015 5:23 PM, Frankline wrote: Hi all, I am getting confused regarding the use of constants and would be keen to know how the rest of you handle constants in your models. Ofcourse I could handle it easily similar to how it has been handled here: https://docs.djangoproject.com/en/1.7/ref

TypeError: __str__ returned non-string (type bytes)

2015-02-24 Thread Mike Dewhirst
This is driving me insane so any hints will be greatly appreciated ... Thanks Mike Here is the entire unedited test sequence plus failing code ... Python: 3.4 Django: 1.6.9 SQLite3: memory Creating test database for alias 'default'... .E.E... =

Re: TypeError: __str__ returned non-string (type bytes)

2015-02-25 Thread Mike Dewhirst
implementing @python_2_unicode_compatible Thank you again Mike On Wednesday, February 25, 2015 at 9:08:45 PM UTC+11, Erik Cederstrand wrote: > > > > Den 25/02/2015 kl. 05.33 skrev Mike Dewhirst >: > > > > ==

Re: Fixing a poorly written Django website (no unit tests)

2015-03-04 Thread Mike Dewhirst
On 4/03/2015 11:01 PM, Some Developer wrote: Hi, I've been working on a Django website for about 2 months on and off and am nearing the end of development work where I can start thinking about making it look pretty and the after that deploy to production. I've been doing lots of manual testing

Re: Django 1.6's lifespan for security updates?

2015-03-18 Thread Mike Dewhirst
Maybe ... some effort to solve the infrastructure issue would make it worth kickstarter funding. A couple of colleagues are pushing me towards Docker as a packaged Python 3.4 environment but that is beyond my interest atm. I am running a dedicated production server on Ubuntu 14.04 which more

Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-19 Thread Mike Dewhirst
On 20/03/2015 12:19 PM, Fellipe Henrique wrote: Here is a fairly typical static file template line ... href="{{STATIC_URL}}css/styles.css" media="screen"/> ... and to see where that fits, insert something like this in your local settings. You will discover any bludners fairly quickly ... pr

Re: Why is appearance of admin page so different between development and deployment servers?

2015-03-22 Thread Mike Dewhirst
On 23/03/2015 9:54 AM, talex wrote: On second thought maybe using /python3.3/site-packages/django/contrib/admin/static/admin directly is not the best practice. I tried using collectstatic, but then the admin could not find it. Please comment. Here is a collectstatic incantation which works fo

ProgrammingError: relation "django_content_type" already exists

2015-03-23 Thread Mike Dewhirst
This is my first stab at upgrading directly from Django 1.6.11 to 1.81c to see what needs to be done. I thought I'd skip 1.7.x - is that a bad idea? Is there some step in 1.7.x which eases the path to 1.8.x? On first starting the project up using runserver on localhost it advises: Python: 3.

Re: ProgrammingError: relation "django_content_type" already exists

2015-03-24 Thread Mike Dewhirst
ot;No changes detected" so I suppose the Django ones were done when I first ran manage.py migrate. That's only a guess. I'll keep reading the docs. Thanks in advance Mike * see below On 24/03/2015 5:00 PM, Mike Dewhirst wrote: This is my first stab at upgrading directly f

How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
At the moment "has_change_permission" in the Admin works by returning 403 Forbidden if it gets a False. That doesn't suit my needs but it is probably not advisable to adjust it. Users without change permission need to be able to see the data and perhaps raise an exception (in this case BusinessR

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
7;ll dig a bit deper. It would be best to do it in the model but I'm not sure how I can get request.user from there. Thank you Mike Sorry for the bad english. Saludos, Julian -Original Message----- From: Mike Dewhirst Sender: django-users@googlegroups.com Date: Sun, 29 Mar 2015 19:07:1

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 7:09 PM, Avraham Serour wrote: maybe overwrite the view in your own modeladmin class? I need to keep using the Admin and haven't done anything like that previously. I'll have to do the research. Thanks Mike On Sun, Mar 29, 2015 at 11:07 AM, Mike Dewhirst

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
post using a different method. You are correct. That was a bad idea! Thanks Mike duminică, 29 martie 2015, 11:08:06 UTC+3, Mike Dewhirst a scris: At the moment "has_change_permission" in the Admin works by returning 403 Forbidden if it gets a False. That doesn't

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