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

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

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

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'] = {

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 :

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

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

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

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

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

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

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

Re: How to stop my views from cacheing

2012-12-17 Thread Chris Cogdon
/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 currently > doing? > >

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

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

Re: django doesn't send me error mails

2012-12-17 Thread Chris Cogdon
ns/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 something is different from mail

Re: django doesn't send me error mails

2012-12-16 Thread Chris Cogdon
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... you've set the admin email to ...

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

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

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/doc

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

2012-12-14 Thread Chris Cogdon
ors, 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 <ch...@cogdon.org> > wrote:

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

2012-12-14 Thread Chris Cogdon
Throw the code up somewhere I can see the results for myself? On Friday, December 14, 2012 3:52:11 PM UTC-8, bobhaugen wrote: > > But sincerely, Chris, thanks for hanging in there on this. I baffled. > > On Fri, Dec 14, 2012 at 5:51 PM, Bob Haugen <bob.h...@gmail.com> > wr

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 13, 2

Re: Helptext forms forms

2012-12-14 Thread Chris Cogdon
e standard behaviour is to put the help text into xxx ... its perfectly possible to use jQuery to replace all of those instances with whatever HTML you want. So... which route is going to get you what you need ? On Friday, December 14, 2012 12:52:23 PM UTC-8, 4 The good Life we work wr

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 <ch...@cogdon.org> > wrote: > > Nothing definitive, but from checking the

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

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 one d

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

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

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:

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

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

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.

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 <ch...@cogdon.org> > 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 > > i

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

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

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

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

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

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

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

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

Re: Model method versus overriding save()

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

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

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

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

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

Re: Help with registration backend

2012-12-05 Thread Chris Cogdon
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, Chris Cogdon wrote: >> >>

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 > <ch...@cogdon.org> &g

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

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

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

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

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

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

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

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

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

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

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

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

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 /

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 <ch...@cogdon.org> > wrote: > > It's generally very messy for one "view" function to call another. > Then what is the fun of making t

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

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

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,

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

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

Re: Error: No module named books

2012-11-29 Thread Chris Recher
Thanks for the help everyone. I was using 1.4.x, not the 1.0 the book is based on. After fooling around with the commands for a bit, I was able to figure out that the problem was in the INSTALLED_APPS section - I included 'mysite.books', but the new way to do that is just 'books'. -- You

Error: No module named books

2012-11-29 Thread Chris Recher
Hi all, I'm working through the Django book and I've run into an error that wasn't predicted. I've got a project called mysite. I used "python manage.py startapp books" to create an app called books inside of it. I added a few models to the models.py file inside books, then tried to use

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

Re: Can't get Web font loader in django

2012-11-21 Thread Chris Pagnutti
t; > In your head section template all you need to do is something of this kind : > > {% for jsscript in jsscript_list %} > > {{ jsscript }} > > > {% endfor %} > > assuming that jsscript is the text jsscript that you want to add to your web > page. > You can use

Can't get Web font loader in django

2012-11-20 Thread Chris Pagnutti
Hi. I'm trying to get the Google Web Font loader via http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";> in my section. But when I load the page I get (in Chromium's console) this message: GET https://www.googleapis.com/webfonts/v1/webfonts 403 (Forbidden) HOWEVER, if I call the

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

Using South with Custom User Model

2012-11-20 Thread Chris Pagnutti
I'm wondering if anyone has ever had success with using South when you have AUTH_USER_MODEL set to a custom User model. I've made various attempts, which are basically all the same steps but in different orders. Basically, my problems is related to this ticket

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

Re: Django in virtualenv + nginx + uwsgi set up guide

2012-11-16 Thread Chris Pagnutti
t; grosshat.com > Servicios de desarrollo web, usabilidad y sistemas > > > On Fri, 16 Nov 2012, Leonardo M. Millefiori wrote: > > Hi Chris, >> you may get some ideas from this long guide, which is fairly recent: >> >> [1] >> http://www.abidibo.net/blog/*

Re: index_together...shouldn't indexes be created AFTER populating the table?

2012-11-14 Thread Chris Pagnutti
ed, Nov 14, 2012 at 3:49 PM, Chris Pagnutti > <chris.p...@gmail.com > wrote: > > Thanks for your reply. The tables I'm dealing with are entirely static, > but > > some have many millions of records, which is why I want my indexes to > work > > as good as

Re: How to configure nginx to serve mail for django

2012-11-14 Thread Chris Pagnutti
, Nov 14, 2012 at 4:37 PM, Dennis Lee Bieber <wlfr...@ix.netcom.com>wrote: > On Wed, 14 Nov 2012 11:41:11 -0800 (PST), Chris Pagnutti > <chris.pagnu...@gmail.com> declaimed the following in > gmane.comp.python.django.user: > > > Good point. At the moment, sending mail

Re: index_together...shouldn't indexes be created AFTER populating the table?

2012-11-14 Thread Chris Pagnutti
those indexes properly? I'm thinking the answer is yes, since the use of the indexes happens at the mysql level, and django just has to issue the select statement. On Wed, Nov 14, 2012 at 3:42 PM, Javier Guerra Giraldez <jav...@guerrag.com>wrote: > On Wed, Nov 14, 2012 at 3:14 PM, Chris

index_together...shouldn't indexes be created AFTER populating the table?

2012-11-14 Thread Chris Pagnutti
Hi. The new index_together feature is great, but I think it's best to create an index on a table AFTER the table is filled, and assuming there won't be many new inserts. But in django, syncdb creates the index at the same time the table is created, and of course, the table is initially

Re: How to configure nginx to serve mail for django

2012-11-14 Thread Chris Pagnutti
Lee Bieber wrote: > > On Mon, 12 Nov 2012 20:48:04 -0500, Chris Pagnutti > <chris.p...@gmail.com > declaimed the following in > gmane.comp.python.django.user: > > > Not sure. It's VPS and I was handed a Debian install with practically > > nothing on it. I ev

Re: How to configure nginx to serve mail for django

2012-11-12 Thread Chris Pagnutti
;wrote: > On Mon, 12 Nov 2012 12:51:57 -0800 (PST), Chris Pagnutti > <chris.pagnu...@gmail.com> declaimed the following in > gmane.comp.python.django.user: > > > Yeah. Makes good sense. I guess that Postfix is one of the more popular > > options. Is there any

Re: How to configure nginx to serve mail for django

2012-11-12 Thread Chris Pagnutti
you use GMail, you can > configure Django to use GMail's mail servers to send email). > > _Nik > > On 11/12/2012 10:22 AM, Chris Pagnutti wrote: > > Hi. I'm using nginx+uwsgi to serve a django app. I'd like to configure > it to be able to send mail with django's sen

How to configure nginx to serve mail for django

2012-11-12 Thread Chris Pagnutti
Hi. I'm using nginx+uwsgi to serve a django app. I'd like to configure it to be able to send mail with django's send_mail() and send_mass_mail() functions. I've played with the nginx configuration files using the examples here http://wiki.nginx.org/Configuration#Mail_examples I have a very

Django in virtualenv + nginx + uwsgi set up guide

2012-11-08 Thread Chris Pagnutti
Hi. I'm looking for a recent guide for setting up nginx to serve django projects in a virtualenv via uwsgi. I can find a whole pile of them, but they're all so different, and some are dated. I'm looking for something complete and recent that actually works. Ideally, I'd like it to be for a

Re: Help with Custom model field and Custom validation for EmailField().

2012-11-03 Thread Chris Pagnutti
the call would look something like this super(YourFormClass,self).clean() On Sat, Nov 3, 2012 at 6:55 AM, Dilip M <dilip...@gmail.com> wrote: > Hi Chris, > > Thank you very much for your time on this. I am not able to make out on > how could I put this under clean() method. Ex: W

Re: Help with Custom model field and Custom validation for EmailField().

2012-11-02 Thread Chris Pagnutti
Ahh. Just saw your link to overriding the clean() method. So you could put all the same logic above into the clean() method instead. On Friday, November 2, 2012 4:36:20 AM UTC-4, Dilip M wrote: > > Hi, > > I am new to Django. Went through docs before posting this.. I have a model > and form

Re: Help with Custom model field and Custom validation for EmailField().

2012-11-02 Thread Chris Pagnutti
Again, I'm not sure, but I think to do it at Model validation level you'd have to modify some of the django core files themselve. I think what you're looking for is in django.core.validators (in my install this file is at /lib/python2.7/site-packages/django/core/validators.py, or you can just

Re: Help with Custom model field and Custom validation for EmailField().

2012-11-02 Thread Chris Pagnutti
Hi. I'm pretty new to Django too, so someone else probably has a better idea. But I think that on the server side, you can handle additional validation in the view that handles the form submission (i.e. the view that the "action" attribute in your form points to). You can probably attach

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