Re: Strange behavior using ModelForms

2012-12-18 Thread Chris Cogdon
ctionalities, this should not happen. > > The basic issue I'm trying to understand here, I believe, is "What really > happens and what is the purpose of binding a modelform to an instance?". > > > On Tue, Dec 18, 2012 at 7:31 PM, Chris Cogdon > > wro

Re: Django community, is it active?

2012-12-18 Thread Chris Cogdon
But I _want_ to drink the free bear. On Tuesday, December 18, 2012 3:19:59 PM UTC-8, Cal Leeming [Simplicity Media Ltd] wrote: > > Don't drink the free bear though, ... > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this di

Re: Converting Django app into a Desktop app

2012-12-18 Thread Chris Cogdon
Personally, I'd prefer something that didn't require packaging up additional programs (xampp and python, in this example). It should be _perfectly possible_ to find a native-python moderate performance webserver, then wrap up that, django, the application and the python interpreter into a singl

Re: invalid syntax inside urls.py

2012-12-18 Thread Chris Cogdon
Need a comma between the view name, and {'queryset...' and your parenthesis are not nested properly. On Tuesday, December 18, 2012 12:19:24 PM UTC-8, maiquel wrote: > > 'm trying to do the following > > Artigo.objects.all () inside urls.py > > urlpatterns = patterns ('', > # url (r '^ blog /

Re: Strange behavior using ModelForms

2012-12-18 Thread Chris Cogdon
Rather than comparing to instance, why not compare to request.user ? On Tuesday, December 18, 2012 1:11:21 PM UTC-8, fvianna wrote: > > Hello everyone, > > I want to apologize if I came to the wrong place to talk about this, but > I've been using Django for a while now, and crossed to a very stra

Re: template caching context variables when no caching enabled.

2012-12-18 Thread Chris Cogdon
Parameter 2 to "render_to_response" is only expecting a dictionary, not a Context/RequestContext, so, it will grab your 'dictionary-like object' and wrap it in its own Context, meaning that none of your template context processors will run (since those require a RequestContext) I suggest using

Re: Converting Django app into a Desktop app

2012-12-18 Thread Chris Cogdon
No Python included with xampp... this makes me sad ;_; On Tuesday, December 18, 2012 11:43:56 AM UTC-8, peter_julian wrote: > > You can use xampp. Create a automatic installer that install xampp and > django with your app. > Just like Kordi EDMS. http://www.kordil.net/. > -- You received th

Re: problem with timeout

2012-12-18 Thread Chris Cogdon
Nice find! If you turn debugging on for "django.db.backends", it will show you what SQL queries are being issued, and the time taken for each. LOGGING['handlers']['console'] = { 'level':'DEBUG', 'class': 'logging.StreamHandler' } LOGGING['loggers']['django.db.backends'] = { 'handlers':['console

Re: cached template loader

2012-12-18 Thread Chris Cogdon
your two versions are actually identical :) The missing comma, I assume, was missing after django.template.loaders.app_directories.Loader ... without the comma there, python sees two strings right next to each other, and thus concatenates them, resulting in a single parameter : 'django.templa

Re: web gui for email server

2012-12-18 Thread Chris Cogdon
I don't know of any. (Nothing comes up on http://www.djangopackages.com/grids/g/email/) But I might be able to say why you might not find any. Desktop e-mail clients usually consist of the interface plus a local cache. The client connects to the mail storage and (via POP or IMAP) retrieves wha

Re: Converting Django app into a Desktop app

2012-12-18 Thread Chris Cogdon
I think what Loai is asking for is a way to "wrap up" the python/django application, along with a light-weight webserver (not as light-weight as "runserver" though), so it looks like a stand-alone application... apart from needing to run a web browser to connect to it. I, too, am very intereste

Re: IntegrityError

2012-12-17 Thread Chris Cogdon
I'd need to see the source for Job and that other model, plus a proper exception traceback, so I can tell at what point the IntegrityError is being thrown. also, you should not be using form.save() there... if you do a commit=False to get a copy of the model, you only need to save that model...

Re: IntegrityError

2012-12-17 Thread Chris Cogdon
Can you post the code for the model, and the complete exception trace? I ask you use something that will properly maintain the intending, such as pastebin or dpaste. On Monday, December 17, 2012 1:18:54 PM UTC-8, Satinderpal Singh wrote: > > I created a search box for searching the information a

Re: Unexpected behavior with regexp model filtering (Sqlite)

2012-12-17 Thread Chris Cogdon
And for completeness, here's how django implements the regex function when using sqlite3: def _sqlite_regexp(re_pattern, re_string): try: return bool(re.search(re_pattern, re_string)) except: return False -- You received this message because you are subscribed to the G

Re: Unexpected behavior with regexp model filtering (Sqlite)

2012-12-17 Thread Chris Cogdon
Django uses "search" rather than "match" for the _regex option. If you want match, make sure the regex starts with a ^ On Monday, December 17, 2012 6:55:09 PM UTC-8, Beni wrote: > > Hi, > > I'm getting stuck on figuring out why regex searches are matching any part > of a field when I use my mode

Re: Django back button issue after log-out

2012-12-17 Thread Chris Cogdon
But that means you're going to need to wrap _all_ your views in that structure, and that also means that none of those views will be cacheable. That could be desirable, depending on your application. You might also want to consider using @vary_on_cookie, which means that the cache will be speci

Re: How to stop my views from cacheing

2012-12-17 Thread Chris Cogdon
com/en/1.4/topics/cache/#cache-versioning On Monday, December 17, 2012 7:26:45 PM UTC-8, Dwayne Ghant wrote: > > Thanks Chris, > > That's exactly what I thought I was doing. Can you please tell me what > missed? How, exactly do unclear the cache; if that's not what I'm curren

Re: How to stop my views from cacheing

2012-12-17 Thread Chris Cogdon
You'll need to clear the cache. Remember, once the view is cached, django wont go down to the view until the cache thinks the content has expired. On Monday, December 17, 2012 5:14:56 PM UTC-8, Dwayne Ghant wrote: > > Hello All: > > I have a python view that I'm building but the for some strang

How to distribute a hybrid Django project/app ??

2012-12-17 Thread Chris Cogdon
[Firstly, sorry if this appears to be a repost: I'd written a lengthy question previously and posted, but never saw it up in the listing. Did the ThreadMonster eat it?] I'm putting the final touches on a art show management tool, written for Django of course, and I am seeing opinions on the bes

Re: django doesn't send me error mails

2012-12-17 Thread Chris Cogdon
tp://stackoverflow.com/questions/8549371/mysterious-issue-with-django-uwsgi-send-email > > > در دوشنبه 17 دسامبر 2012، ساعت 7:07:18 (UTC+3:30)، Chris Cogdon نوشته: >> >> My best guess is that the mail transport agent on the server is rejecting >> the mail because somethi

Re: django doesn't send me error mails

2012-12-16 Thread Chris Cogdon
t have access to that file on server. > and log from uwsgi doesn't have any error massage about mail sending > > can it be a python3 branch related bug? > > > در دوشنبه 17 دسامبر 2012، ساعت 1:36:05 (UTC+3:30)، Chris Cogdon نوشته: >> >> Oh... there's your problem..

Re: django doesn't send me error mails

2012-12-16 Thread Chris Cogdon
Oh... there's your problem... you've set the admin email to ... i'm sure that doesn't exist! :) Seriously, though... all that looks correct. Can you check your server's /var/log/maillog to see if the mail is being accepted? On Sunday, December 16, 2012 1:33:01 PM UTC-8, Ali Vakilzade wrote:

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-16 Thread Chris Cogdon
Awesome. Thanks for the update. On Sunday, December 16, 2012 3:56:22 AM UTC-8, bobhaugen wrote: > > Wrapping this up: the problem was caused by South, happened in migrate > (found via stack trace). When I upgraded South, the problem went away. -- You received this message because you are subs

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
ision from git ? On Friday, December 14, 2012 5:27:04 PM UTC-8, bobhaugen wrote: > > Also, I recognize this is way beyond the call of duty, but if you > really want to reproduce the problem, you might need to follow: > https://github.com/valnet/valuenetwork/blob/master/docs/install.

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
e errors, but that of one of the other modules? Take your module out of INSTALLED_APPS and re-run test. Still happening? Then it ain't you! :) On Friday, December 14, 2012 4:09:25 PM UTC-8, bobhaugen wrote: > > On Fri, Dec 14, 2012 at 6:07 PM, Chris Cogdon > > wrote: > > T

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
ri, Dec 14, 2012 at 5:42 PM, Chris Cogdon > > > > wrote: > >> Okay, so when you create your datetimes, are you defining them with a > >> timezone ? > > > > I tried that; did not make any difference. The error messages came up > > before any o

Re: Modelform and Ajax (Select a valid choice..... Error)

2012-12-14 Thread Chris Cogdon
Good... but we'd all appreciate knowing what was wrong, so we can guide others :) On Thursday, December 13, 2012 9:05:44 PM UTC-8, siddharth56660 wrote: > > Hey Chris > > Thanks for the replybut i figured it out what was wrong. > :) > -Siddharth > On Thu, Dec

Re: Helptext forms forms

2012-12-14 Thread Chris Cogdon
The good Life we work wrote: > > Hallo Chris, > > thank you for the good explanation. > I'm then afread that I have to create my own widget for this. Can you > support me on this? > > Thanks, > Tony Michael > > On Fri 14 Dec 2012 08:45:40 PM CET, Chris Cogdo

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Okay, so when you create your datetimes, are you defining them with a timezone ? On Friday, December 14, 2012 1:05:19 PM UTC-8, bobhaugen wrote: > > On Fri, Dec 14, 2012 at 3:02 PM, Chris Cogdon > > wrote: > > Nothing definitive, but from checking the location of the code th

Re: Model's optional __unicode__() return values?

2012-12-14 Thread Chris Cogdon
oops... that should be "if x is not None", not "where x is not None"... Clearly I am still half in SQL mode :) On Friday, December 14, 2012 3:41:01 PM UTC-8, Chris Cogdon wrote: > > The pattern I use is ", ".join ( [ unicode(x) for x in ( thing_a, thing_b

Re: Model's optional __unicode__() return values?

2012-12-14 Thread Chris Cogdon
The pattern I use is ", ".join ( [ unicode(x) for x in ( thing_a, thing_b, getattr(obj,"optional_attribute",None ), ...etc... ) where x is not None ] ) On Friday, December 14, 2012 2:49:16 PM UTC-8, mhulse wrote: > > Hello, > > This is probably a dumb question, but... > > What's the best way t

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
: > > Thanks for the reply. > > On Friday, December 14, 2012 1:27:03 PM UTC-6, Chris Cogdon wrote: >> >> Would be nice to know what function's raising that error, and where the >> value came from. Requesting traceback, database type (tried it with more >> than

Re: validation error in Django Admin

2012-12-14 Thread Chris Cogdon
Thanks for the follow up! On Wednesday, December 12, 2012 4:21:59 PM UTC-8, Mike Dewhirst wrote: > > I'm getting an unexpected validation error in Admin which baffles me. > Any hints appreciated ... here is the traceback > > http://dpaste.com/844972/ > > At the bottom of the traceback where the

Re: Helptext forms forms

2012-12-14 Thread Chris Cogdon
If you're designing your own HTML (eg: this is not in the admin) then there's nothing stopping you rendering the help text any way you want. Eg: {{ form.field1 }} (that might not exactly work as written, but using it to give you the gist of things... my preference would be to put the text into

Re: Local thread variable (attempting to create a connection pool)

2012-12-14 Thread Chris Cogdon
What you essentially want is a common pattern called a "singleton": something that there is only one of, like "None" and "Elipsis". You can do something workable, but ugly, using module-level variables, but there are known patterns for creating singletons Here's some starters: http://stackover

Re: GeoDjango annotate distance

2012-12-14 Thread Chris Cogdon
Just did a cursory read of the geodjango documentation for the first time...the querysets being returned from "all()" (or really, just objects) need to be GeoQuerySets which have a default "position" as part of their specification (I think), also such modules need to inherit from the geo versio

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Would be nice to know what function's raising that error, and where the value came from. Requesting traceback, database type (tried it with more than one database type), and other information. On Friday, December 14, 2012 9:46:33 AM UTC-8, bobhaugen wrote: > > RuntimeWarning: DateTimeField rece

Best way to distribute a "standalone django application" ?

2012-12-14 Thread Chris Cogdon
I've been developing an art show management application (in both the general and Django senses) for the past few years, and have had it up on sourceforge and github for a while. It's very close to being "complete" and I'd like to make sure its as useful as possible to as wide an audience. Howev

Re: How Alter Table to add foreign key to Django Models

2012-12-14 Thread Chris Cogdon
It doesn't look like you're using Django at all. I suggest taking your question to the support community for the database you're using. On Thursday, December 13, 2012 4:53:25 AM UTC-8, laxglx wrote: > > Can anybody plz tell me how to add a foreign key an existing table using > SQL Queries? > >

Re: How Alter Table to add foreign key to Django Models

2012-12-14 Thread Chris Cogdon
Are you sure you're using Django? This SQL statement does not look like something django would have emitted. Perhaps your query is best taken to the support community for the database you're using. Our advice here may not be relevant to you. The issue you're having is what the South package is

Re: django book example HELP..

2012-12-13 Thread Chris Cogdon
Typo on that typo! That slash should also be inside the parenthesis: (r'^time/plus/(\d{1,2})/$', hours_ahead) Note, though, I tend not to be so specific with URL matching... consider if someone hacked a URL to read time/plus/999/ ... The above will cause a 404, where letting it through to your

Re: Project path

2012-12-13 Thread Chris Cogdon
Evans wrote: > > On Wed, Dec 12, 2012 at 9:32 PM, Chris Cogdon > > wrote: > > The BIG advantage here is that you're not checking anything into the SCM > > that must remain secret, or must change (or very likely to change) > between > > installations, but al

Re: IntegerField and SmallIntegerFields maps to the same db type on Oracle.

2012-12-13 Thread Chris Cogdon
According to the docs, oracle uses 1 byte for the magnitude, and 1 or more bytes for significant digits. HOWEVER, it assigns that space dynamically, so even if you say NUMBER(11), you will still only need 2 bytes to represent the number "5". All NUMBER(11) gives you is some range checking on in

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-13 Thread Chris Cogdon
On Thursday, December 13, 2012 10:23:52 AM UTC-8, Carsten Fuchs wrote: > > Our database is Oracle; > with > < > https://docs.djangoproject.com/en/1.4/ref/models/querysets/#select-for-update> > > > saying both "Returns a queryset that will lock rows ..." and "All > matched entries will be loc

Re: Modelform and Ajax (Select a valid choice..... Error)

2012-12-13 Thread Chris Cogdon
How are you populating the choices in the ChoiceField? Remember, you need to do this on BOTH the POST AND the non-POST versions of creating the form. But ChoiceField is a Form field, not a Model field... so its not perfectly clear what you're asking. On Tuesday, December 11, 2012 3:39:48 AM UT

Re: validation error in Django Admin

2012-12-13 Thread Chris Cogdon
I'm going to take a guess that when you "drop one" of them, deleting it, there's still a query going on that might want to refer to the other one, and the to_python fails because that reference doesn't exist anymore. You might have better luck if you're using a OneToOne or ForeignKey (onetomany

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-12 Thread Chris Cogdon
The question is going to be very database specific. "select for update" works by putting in row-level locks in the database. If the row does not exist, then it won't get a lock on it, and I know of no databases that will maintain the query so that any newly created rows automatically get a lock

Re: ImageField in admin always required

2012-12-12 Thread Chris Cogdon
NOTE: I tried adding null=True, blank=True to forms.ImageField however I > get errors __init__() got an unexpected keyword argument so I guess I can't > use them options. If I comment out the def formfield_for_dbfield(self, > db_field, **kwargs): then the ImageField is not required as expected

Re: Project path

2012-12-12 Thread Chris Cogdon
Not sure if you're willing to consider an alternate, here, but this is a issue Iv'e gone through a lot, and came up with my own solution. The major issue is that I not only want to change the top level paths, but also need to change database targets and a few other settings, between all the dif

Re: Datastructure using django.

2012-12-12 Thread Chris Cogdon
I've no answers for you, but you might want to have a look at other applications that use those products and see how they work. I know that "zinnia", a Django-based blog framework, uses "mptt", so you might want to have a look there. I've used zinnia, and I've never had to do any "reload" so to

Re: Model method versus overriding save()

2012-12-12 Thread Chris Cogdon
On Sunday, December 9, 2012 9:08:18 PM UTC-8, Mike Dewhirst wrote: > > On 10/12/2012 10:59am, Victor Hooi wrote: > > Also - in terms of using them with QuerySets - there aren't any > > workarounds to use model methods with QuerySets are there? It seems like > > that would be a definite argument

Re: IOError, Permission Denied using Amazon s3 w/ django-storage?

2012-12-09 Thread Chris Cogdon
If you're using ImageField, that by default verifies that what you've uploaded is in fact an image. It uses PIL (python image library, aka python-imaging) to do that. make sure you have PIL installed and it is working. On Sunday, December 9, 2012 12:40:22 AM UTC-8, easypie wrote: > > I got it w

Re: Model method versus overriding save()

2012-12-09 Thread Chris Cogdon
e of optimisation. > > Mike > > > > >- Tom > > > >> > >> Derek > >> > >> [1] https://docs.djangoproject.com/en/dev/topics/signals/ > >> > >> On Saturday, 8 December 2012 04:27:50 UTC+2, Chr

Re: Model method versus overriding save()

2012-12-07 Thread Chris Cogdon
It's a simple performance vs storage question. Storing a calculatable field also risks it getting out of sync with reality, but if you're doing the query on that _so_ much, then its usualyl worth it. Also, with the right database and a trigger, that's something the database can ensure for you.

Re: Django gracefully shutdown

2012-12-07 Thread Chris Cogdon
I would actually suggest using gunicorn to run django as a stand-along app server listening on localhost:some-local-port, and use nginx proxy passing to redirect queries to / to the local port. But that said, once a request is served, the listening processes are essentially idle. So, either jus

Re: Internal Error after chaning SITE domain name and modifying html file...?

2012-12-07 Thread Chris Cogdon
Okay, I've never tried using virtualenv's with django before... but from what I've read, one of the most important things to do is ensure that the virtualenv site-packages directory is the first thing in sys.path the wsgi.py file there doesn't seem to be manipulating sys.path at all. On Fr

Re: Internal Error after chaning SITE domain name and modifying html file...?

2012-12-07 Thread Chris Cogdon
Run ./manage.py shell ... since that imports settings, that should also fail, and will perhaps give you more information Django isn't very good at showing you the "root cause" when a module fails to import, unfortunately, you might want to figure out a way of importing them manually and seeing

Re: Multiple stackinline all sharing relation need assistance

2012-12-05 Thread Chris Cogdon
When you say "recommendations inline lists work history from all users" do you mean its showing up as multiple fields, or do you mean the selection box that gives you the option of adding a recommendation from the list of possible recommendations ? On Wednesday, December 5, 2012 8:06:55 PM UTC

Re: Help with registration backend

2012-12-05 Thread Chris Cogdon
on backend and build on that? Is there a ready made > solution I don't know about that would allow an authenticated user to > create accounts? > > I feel a bit unsure about how to proceed. Anyone have advice? > > Thanks! > > On Monday, December 3, 2012 6:10:07 PM UTC-4, C

Re: pyodbc utf-8

2012-12-05 Thread Chris Cogdon
You're totally correct. This is why I said "but please find out what pyodbc uses" :) sqlite3 uses %s On Wednesday, December 5, 2012 3:46:01 PM UTC-8, Dennis Lee Bieber wrote: > > On Wed, 5 Dec 2012 13:13:31 -0800 (PST), Chris Cogdon > > >

Re: pyodbc utf-8

2012-12-05 Thread Chris Cogdon
Perhaps you can help the django team figure out why the ORM doesn't work with MSSQL? I understand that its not technically supported, but there must be SOME people working on it. If you're going straight to pyodbc, then this is likeyl to be a python/pyodbc issue, and not django. So... you're no

Re: HELP!!! Admin Site app name rename

2012-12-05 Thread Chris Cogdon
Most objects have a way of giving them a "label" attribute, or even a "short_description" attribute. So, if you didn't want to go to the trouble of internationalizing (i17ning?) your application, just use those idioms to create visible names for your custom-created models and forms, etc. To cha

Re: django + fastcgi + lighttpd outlog and errlog not working

2012-12-05 Thread Chris Cogdon
Another way would be to set up a receiver for a signal, emit a message via the logging module, configure LOGGING to log those messages to stderr. Question for others: Is there a good document on what signals django sends? Since I have it available, here's how you would adjust the LOGGING setting

Re: django synchronize database over REST

2012-12-05 Thread Chris Cogdon
If you're not using synchronous replication (ie, something like a two-phase commit, or something very close to it), then it is impossible to come up with a generic solution for replication. you might be able to "come close", but how to deal with desync is application specific. Ie, say you had t

Re: Inline formset with different default values for each "extra" row

2012-12-04 Thread Chris Cogdon
Because Lee Hinde's thread is broken, I'm going to take a punt at what the question is :) in a formset (inline, model, or just a plain one), the "initial" parameter to the instantiation of the form takes an list of dictionaries. Each element in the list is the initial data for _that_ row... so

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-12-04 Thread Chris Cogdon
tl;dr :) I am going to guess that the server is not recognising tyour changes when you save them, and perhaps one copy of a server thinks the state is X, and the other thinks its Y, so you'll get different results each time you refresh. Are you running with manage.py runserver? When you save y

Re: how do I resolve this error: " (552, '5.6.0 Headers too large (32768 max)') "

2012-12-04 Thread Chris Cogdon
That's a message returned by your Mail Transport Agent. Django has no control. Either adjust the settings in your MTA or adjust your mail-send to send in batches. And, given that it sounds like you're sending to tens of thousands of users, please make sure those users are in the "Bcc" rather t

Re: Bulk db insert with a file through admin form

2012-12-04 Thread Chris Cogdon
My suggestion is to not have any kind of model-linked-file. Use a standard Form that accepts a file, then as part of the POST processing, you open the file, do all the necessary reading and object creation, then return a render/redirect for success. You might want to wrap the entire view in a c

Re: Using clean_fields and full_clean in django Admin

2012-12-04 Thread Chris Cogdon
Best thing I can suggest is to create a clean_FIELDNAME method in the ModelForm... this method should use self.cleaned_data['FIELDNAME'] to retrieve the value. check it, and return it if things are good, or raise ValidationError if things are bad. An alternate is to make the adjustment to the M

Re: django + fastcgi + lighttpd outlog and errlog not working

2012-12-04 Thread Chris Cogdon
I believe you only get the per-request logs when you're running the development server (runserver). When you're running in fastcgi mode (and its been a while since I have), you'll only get entries in outlog and errlog if you actually send stuff to stdout and stderr yourself. And THAT will requi

Re: Limiting the entry that loaded in django admin.

2012-12-03 Thread Chris Cogdon
raw_id_fields is the first step. also look at django-ajax-selects, which gives you a lot of interesting abilities. On Monday, December 3, 2012 8:13:02 PM UTC-8, Bo Lang wrote: > > Hi all, > need some input here. > > I have a site with > 15000 images, using django photologue. > > When we creat

Re: Help with registration backend

2012-12-03 Thread Chris Cogdon
modify the urlconf so that the function to send out registration keys can only be executed if someone is already logged in and/or has the right kind of permission. eg, instead of url( some-re some_function ) you can use url ( some-re, login_required(some_function) ) or has_perm, or a my

Re: Escape percent sign in QuerySet.extra() method

2012-12-02 Thread Chris Cogdon
On Sunday, December 2, 2012 1:55:05 AM UTC-8, Martin Svoboda wrote: > > Hello, > I'm want to use functionality of postgresql module > pg_trgmin django. > pg_trgm uses special operator % (percent sign). I don't know how > should I escape it

Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Chris Cogdon
On Saturday, December 1, 2012 3:47:39 AM UTC-8, Loai Ghoraba wrote: > > no I mean the root of my project guys :) thanks a lot :D which lives in > path/to/my/project :) > Oh thank god for that! I'd actually done something similiar once... I'd removed a bunch of permissions using chmod -R / r

Re: calling the view function in the other view function

2012-12-01 Thread Chris Cogdon
On Friday, November 30, 2012 9:22:08 PM UTC-8, Satinderpal Singh wrote: > > On Sat, Dec 1, 2012 at 4:45 AM, Chris Cogdon > > wrote: > > It's generally very messy for one "view" function to call another. > Then what is the fun of making the function, if

Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Chris Cogdon
On Friday, November 30, 2012 8:53:42 PM UTC-8, Mike Dewhirst wrote: > > 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 > Oh hell no, don't

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Chris Cogdon
Make sure all the directories, from static leading all the way up to the root, are chmod a+x On Friday, November 30, 2012 4:00:55 PM UTC-8, Loai Ghoraba wrote: > > Hi > > I have installed apache and mod_wsgi and my basic site *skeleton is > running* on local host, but with NO static files loade

Re: how to use named urls from apps

2012-11-30 Thread Chris Cogdon
And, don't forget, the form is: {% load url from future %} {% url 'auth_login' %} OR {% url auth_login %} The former is highly recommend, as the latter is deprecated and will become the default in a future Django release. If you ever get messages such as "view not found for reverse"... this h

Re: admin foreign key issues

2012-11-30 Thread Chris Cogdon
> class CategoryAdmin(admin.ModelAdmin): > list_display = ('name') > list_filter = ('name') > admin.site.register(Category, CategoryAdmin) > > But that fails with 'CategoryAdmin.list_display' must be a list or tuple. > use: list_display = ('name',) Note the trailing comma, there

Re: calling the view function in the other view function

2012-11-30 Thread Chris Cogdon
It's generally very messy for one "view" function to call another. Better solution is to factorise out the common parts into a third function, then make sure each of your two "view" functions have the required render_to_response. Also, I highly recommend using the "render" shortcut, which would

Re: Noobe alert

2012-11-30 Thread Chris Cogdon
Check the error log for nginx to see if there's any hint of why the statics aren't showing up. My best guess is that the web server is running as a user that does not have access to the files, and the error log should be showing up with various "permission denied" messages. The usual culprit i

Re: Is there a recommended pattern for creating "replaceable" apps?

2012-11-28 Thread Chris Cogdon
Alright! I've gone through the documentation, and waded through a lot of the Django source code that implements the AUTH_USER_MODEL setting (via Meta.swappable, and Model._meta.swapped, etc) and while I am not saying that this isn't a good idea, it seems very heavyweight for what I was trying t

Re: Is there a recommended pattern for creating "replaceable" apps?

2012-11-20 Thread Chris Cogdon
On Monday, November 19, 2012 9:36:40 PM UTC-6, Russell Keith-Magee wrote: > > > See the development docs for custom user models to see how this works in > practice, and adapt for your purposes. I'm intentionally going to leave the > rest vague. Call it an entrance exam -- if you can't work out

Is there a recommended pattern for creating "replaceable" apps?

2012-11-19 Thread Chris Cogdon
Hi folks! I'm creating an application to manage an art show (with art pieces to view and sell, silent and voice auctions, and a sales process). To have this work, it of course needs to keep track of people (including names, addresses, email, etc). But to make this more useful to anyone, I want

Re: TemplateDoesNotExist Error...

2012-11-19 Thread Chris Cogdon
If you're sure your error appears at the "txt=" line, look at the definition for that template. There is a good chance it's trying to pull in a template (via an include, or a extends) that doesn't exist. If you need more debugging, you can always modify the LOGGING variable to drop a bunch of l