How to deploy a project on apache2.2.6 and mod_wsgi

2008-01-10 Thread gaojiawang
Hi,all Now I want to deploy my project on apache2.2 and mode_wsgi. But no have idea,Can you give me some suggestions? -- Jiawang Gao(高加旺) [EMAIL PROTECTED] NOTHING IS IMPOSSIBLE --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Very Easy Question

2008-01-10 Thread MariusB
I had the same problem on Vista with v0.96.1... Following Richards solution, I've copied the django subfolder into C: \Pythong25\lib\site-packages\ and I get no error for import django Are there any problems for this solution or is this all there is to it? On Dec 20 2007, 9:06 pm, "Richard

Re: Forms and non-editable fields

2008-01-10 Thread Matt Hoskins
> Interestingly, I wanted to write very similar request, but you passed > ahead of me. :) I'm writing form/questionnaire site for our summer > school and I want to be able render filled forms as text, easy readable > and easy printable. So, my needs are pretty close to yours. It struck me as not

Re: How to deploy a project on apache2.2.6 and mod_wsgi

2008-01-10 Thread Aleš Krištof
gaojiawang wrote: > Hi,all > Now I want to deploy my project on apache2.2 and mode_wsgi. > But no have idea,Can you give me some suggestions? > > -- > Jiawang Gao(高加旺) > > [EMAIL PROTECTED] > > NOTHING IS IMPOSSIBLE Hi, have you seen this link: http://code.google.com/p

Question about views.py

2008-01-10 Thread Matic Žgur
Hi everybody, being new in Django, I'd like to ask you for some tips about what should be in views.py and what shouldn't be. I'm writing a blog app with custom views.py. I know that it would be a lot easier (and wiser) to use generic views for what I'm trying to accomplish, but I'd like to learn

MemoryError with zip file upload

2008-01-10 Thread [EMAIL PROTECTED]
Hello All, I don't really know if this is django specific or more python related but i hope someone can help me out here. I'm currently migrating a application to django and one of the new requirements is that people can upload zip files. I talked with the system administrator and he only let's m

Re: advice on table joins

2008-01-10 Thread Maarten
Hi, I'm notan expert with django yet, but I do recommend to keep your models and not throw everything into 1 big model. The relations are powerfull, don't throw it out even if it means having to write a nest or two. Let's use the following model to look into this: Models: A, B and C. C is a pa

Postgresql setup

2008-01-10 Thread mjj
Hello I need to get a postgresql db sorted out for my django install, having never used it before its a little tricky. Postgres etc is installed as are the appropriate python bits etc etc, the problem I get is an IDENT error when I try to connect. Anyone have any postgres config example files

Re: An easier way to do this Pagination in a template?

2008-01-10 Thread Paul Childs
Take a look here too... http://code.djangoproject.com/wiki/PaginatorTag --~--~-~--~~~---~--~~ 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 unsu

Re: Very Easy Question

2008-01-10 Thread koenb
Especially take note of the hint to use junction.exe [1]. It allows you to use kind of like symlinks on windows. Especially interesting if you use different versions and branches. Koen [1] http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx --~--~-~--~~--

When to use templatetags and how to use views.py

2008-01-10 Thread Darthmahon
Hey, I've recently stumbled on templatetags as a great way of pulling in data you need within a specific template file. Previously I would have done all of the logic to pull in data from within a views.py file and then just pass that data into a specified template. Is there any real difference b

Re: Question about views.py

2008-01-10 Thread Wiley
Just off the top, it looks like the get_all_tags function could be re- written as a list comprehension. As for the more django oriented stuff, I'll leave that to the pros. On Jan 10, 7:12 am, "Matic Žgur" <[EMAIL PROTECTED]> wrote: > Hi everybody, > > being new in Django, I'd like to ask you for

Re: Question about views.py

2008-01-10 Thread David Grant
I think you should be able to access the query sets directly in your template. Not sure why that didn't work for you. Here they pass a queryset to render_to_response: http://www.djangoproject.com/documentation/tutorial03/#a-shortcut-render-to-response Put a loop in your template and then access a

Re: Postgresql setup

2008-01-10 Thread David Grant
Your problem is with postgres not django. The permissions of your database are not set up so a postgres-django config example will not help. Make sure you can connect to the database from the command line or some UI first before trying to get django to connect to it. Dave On Jan 10, 2008 6:50 AM,

shared apps and template tags

2008-01-10 Thread [EMAIL PROTECTED]
OK, I've got two sites with a lot of shared code. I'm attempting to set up apps something like this: site1app/ site2app/ utils/ Which doesn't seem all that problematic. Where I AM running into is accessing code in utils. In particular I have templatetags that don't seem to be working with this s

Problem with two applications importing models from each other?

2008-01-10 Thread Josh Ourisman
I have two models, modelA and modelB. ModelA needs classB1 and classB2 from modelB, while modelB needs classA1 from classA. So, in the models.py file for modelA I have 'from modelB.models import classB1, classB2'. This worked just fine until I added to the models.py file for modelB 'from modelA.m

Re: shared apps and template tags

2008-01-10 Thread [EMAIL PROTECTED]
Disregard. I figured something out: I created utils/shared/templatetags then in settings imported utils.shared --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: shared apps and template tags

2008-01-10 Thread Karen Tracey
On Jan 10, 2008 12:54 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > OK, I've got two sites with a lot of shared code. I'm attempting to > set up apps something like this: > > site1app/ > site2app/ > utils/ > > Which doesn't seem all that problematic. Where I AM running into is > accessing c

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Muchanic
Check this out: http://www.python.org/doc/faq/programming/#what-are-the-best-practices-for-using-import-in-a-module On Jan 11, 6:54 am, Josh Ourisman <[EMAIL PROTECTED]> wrote: > I have two models, modelA and modelB. ModelA needs classB1 and classB2 > from modelB, while modelB needs classA1 from

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Josh Ourisman
Hmm. That implies that I should be using 'import modelA.models.Class1' rather than 'from modelA.models import Class1'. However, that syntax doesn't seem to actually work. If I remove the circular imports for a moment, 'from modelA.models import Class1' works just fine, but if I use 'import modelA.

Re: Question about views.py

2008-01-10 Thread Matic Žgur
Thanks for your suggestions. I have managed to get rid of my get_entries_list() and pass queryset directly to the template. I made the mistake of using {{ entry.get_absolute_path() }} instead of {{ entry.get_absolute_path }} in the templates. I've also rewritten a lot of for loops into list compre

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Muchanic
import xxx means 'import module xxx' - since Class1 is a class, and not a module, that won't work. If you change the import statements in both modules to something of the form 'import modelA.models as models_A' then referencing the classes as 'models_A.Class1', does that work? On Jan 11, 8:27 am

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Rajesh Dhawan
Hi, On Jan 10, 12:54 pm, Josh Ourisman <[EMAIL PROTECTED]> wrote: > I have two models, modelA and modelB. ModelA needs classB1 and classB2 > from modelB, while modelB needs classA1 from classA. Can you explain what you mean by "needs"? Is there a class method in modelA that needs to instantiate/

Re: Basic MySQLdb Install

2008-01-10 Thread rob_mazur
On Jan 9, 10:58 pm, "David Grant" <[EMAIL PROTECTED]> wrote: > Well it is still trying to import from /root/.python-eggs/... I would also > be interested in knowing why you are doing things as root, but I guess > that's not important... > > It's still trying to import from /root/.python-eggs so g

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Josh Ourisman
Nope, that just gets me "AttributeError: 'module' objects has no attribute 'models'". :/ It doesn't work to just to 'import modelA' and then reference modelA.Class1 or modelA.models.Class1 either; that just gives me the same error. On Jan 10, 2:38 pm, Muchanic <[EMAIL PROTECTED]> wrote: > import

Re: Basic MySQLdb Install

2008-01-10 Thread rob_mazur
p.s. Off-topic, but I noticed that you appear to be up in Vancouver, and saw at least one reference to [Trevor] Linden on your blog (a photo). I'm down here in Seattle, a rabid Canucks fan...counting minutes til tonight's game. Thanks for your help from the Northwest. Rob --~--~-~--~--

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Josh Ourisman
It's for the purpose of defining foreign keys. Basically, ClassA1 needs to be able to reference ClassB1 and ClassB2 as foreign keys, while ClassB3 needs to reference ClassA1 as a foreign key. More specifically, the project has (among others) a news application and a portfolio application. An item

django-registration mysterious errror

2008-01-10 Thread [EMAIL PROTECTED]
never had any problem with django-registration until today, when I got two of these: Traceback (most recent call last): File "/home/grmadmin/webapps/django/django/core/handlers/base.py", line 77, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/grm

Re: Question about views.py

2008-01-10 Thread David Grant
In your case the list comprehensions probably made it more readable. In other cases list comprehensions can make things less readable (I'm guilty of doing this sometimes). I thought maybe you were using brackets as I did that too the first time I wrote a template. Dave On Jan 10, 2008 11:28 AM, M

Re: shared apps and template tags

2008-01-10 Thread [EMAIL PROTECTED]
OK, new question along the same lines I've got site1/ site2/ shared/ (not utils) shared/samples/ all in line, the template tags are working, but in trying to implement the sites framework I'm hitting a snag when I try to syndb or use sqlall: ImportError: No module named shared I get the same th

Re: django

2008-01-10 Thread Patricia Ramirez
you solve your problem with django, i have the same error message, and i don't not why happend > > File "", line 1 > django-admin.py startproject mysite >^ > SyntaxError: invalid syntax > > --~--~-~--~~~---~--~~ You received th

Re: Basic MySQLdb Install

2008-01-10 Thread David Grant
Eggs are totally new to me although I have heard of them. Sorry for top-quoting, I use gmail and I'm lazy... Distributions usually clear these issues up by having everything compiled with the same compiler, everything linked to the right libraries that are included in the distro, etc... Maybe what

Re: django

2008-01-10 Thread Fredrik Lundh
Patricia Ramirez wrote: > you solve your problem with django, i have the same error message, and i > don't not why happend > > File "", line 1 > django-admin.py startproject mysite >^ > SyntaxError: invalid syntax looks like you typed the "

Multiple sites, shared hosting

2008-01-10 Thread Michael Hipp
Hello, My "main" Django site is working great. But on my shared hosting account (HostMonster) I have multiple sites. Some will be Django, some will be plain html. How do I set this up (specifically in settings.py, urls.py and .htaccess). I'm using FastCGI and a script for the main site. I onl

Restart Django site?

2008-01-10 Thread Michael Hipp
How do I restart my Django site (uses FastCGI and shared hosting via .htaccess)? The docs say 'touch mysite.fcgi' but that does not seem to work. Tried touching all the py files as well as .htaccess. I can see the python process still running in memory. If I kill it then it re-loads my code a

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Rajesh Dhawan
On Jan 10, 4:00 pm, Josh Ourisman <[EMAIL PROTECTED]> wrote: > It's for the purpose of defining foreign keys. Basically, ClassA1 > needs to be able to reference ClassB1 and ClassB2 as foreign keys, > while ClassB3 needs to reference ClassA1 as a foreign key. By now you know why this isn't working

Re: Restart Django site?

2008-01-10 Thread Fredrik Lundh
Michael Hipp wrote: > How do I restart my Django site (uses FastCGI and shared hosting via > .htaccess)? > > The docs say 'touch mysite.fcgi' but that does not seem to work. Tried > touching all the py files as well as .htaccess. > > I can see the python process still running in memory. If I

Re: Multiple sites, shared hosting

2008-01-10 Thread [EMAIL PROTECTED]
it's been a long time since I fooled with an fcgi setup, but as I recall you can setup htaccess to just work on certain folders rather than root, which sounds like what you want. On Jan 10, 3:50 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > Hello, > > My "main" Django site is working great. But o

Re: Basic MySQLdb Install

2008-01-10 Thread rob_mazur
Thanks David. I believe I am nearly there...one last hurdle I believe. So, I deleted all traces of the compiled version of MySQLdb. Meaning, I deleted it from: $HOME/.python-eggs/MySQLdb*.egg /usr/lib/python2.4/site-packages/MySQLdb*.egg (or whatever it was) And, I removed my compiled Python

Re: An easier way to do this Pagination in a template?

2008-01-10 Thread Prof. William Battersea
Ahh. I eventually did write an inclusion tag. I see I could have saved myself some time, but it was nice to learn how to do it. Thanks! On Jan 10, 2008 9:53 AM, Paul Childs <[EMAIL PROTECTED]> wrote: > > Take a look here too... > > http://code.djangoproject.com/wiki/PaginatorTag > > > --~--~---

Re: Getting exception 'User' object has no attribute 'backend'

2008-01-10 Thread Shev
On a related note, I ran into a situation where I needed to login a user automatically, without knowing the plaintext password. So I did: the_user.backend='django.contrib.auth.backends.ModelBackend' login(request, the_user) ...and skipped the usage of authenticate(). If this is a terrible idea

Re: Basic MySQLdb Install

2008-01-10 Thread David Grant
I would work on it the other way around...tell mysql to put it's socket somewhere else... I'd be surprised if Suse's mysql package would put it in /tmp by default. Maybe that's where your compiled version of mysql was putting it (might make sense, then the compiled mysql versions would collide with

Re: django-registration mysterious errror

2008-01-10 Thread Karen Tracey
On Jan 10, 2008 3:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > never had any problem with django-registration until today, when I got > two of these: > Traceback (most recent call last): > > File "/home/grmadmin/webapps/django/django/core/handlers/base.py", > line 77, in get_response >

Re: Problem with two applications importing models from each other?

2008-01-10 Thread Josh Ourisman
Ok, that should help. Thanks very much. On Jan 10, 4:58 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Jan 10, 4:00 pm, Josh Ourisman <[EMAIL PROTECTED]> wrote: > > > It's for the purpose of defining foreign keys. Basically, ClassA1 > > needs to be able to reference ClassB1 and ClassB2 as fore

Re: Basic MySQLdb Install

2008-01-10 Thread rob_mazur
On Jan 10, 2:51 pm, "David Grant" <[EMAIL PROTECTED]> wrote: > I would work on it the other way around...tell mysql to put it's socket > somewhere else... I'd be surprised if Suse's mysql package would put it in > /tmp by default. Maybe that's where your compiled version of mysql was > putting it

Re: Multiple sites, shared hosting

2008-01-10 Thread Graham Dumpleton
On Jan 11, 8:50 am, Michael Hipp <[EMAIL PROTECTED]> wrote: > Hello, > > My "main" Django site is working great. But on my shared hosting account > (HostMonster) I have multiple sites. Some will be Django, some will be > plain html. > > How do I set this up (specifically in settings.py, urls.py an

Re: django-registration mysterious errror

2008-01-10 Thread [EMAIL PROTECTED]
Yup, it's django-registration... Not sure what version. Probably about six months old. Maybe it's something James has already seen and fixed. On Jan 10, 4:55 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Jan 10, 2008 3:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > > > > > > never

Re: SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-10 Thread Eoin
I just started to deploy my app to the webserver, grabbed the latest svn and am having exactly the same issue, its creating a session entry per page viewed. But with a difference the users aren't logged in, they are still viewing anonymously despite the cookie and a session corresponding. So 7001

i18n problem: Some template variables "get stuck" in one language

2008-01-10 Thread Emil
Hi folks, I have a rather peculiar problem. I created translations for my project, and mostly they work fine. Except that on a couple of pages, the language seems to get stuck on the translated language after the first time I change languages. Example: I visist the site. It's in english (which i

Re: django-registration mysterious errror

2008-01-10 Thread James Bennett
On Jan 10, 2008 2:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > File "/home/grmadmin/webapps/django/classic/registration/views.py", > line 35, in activate >account.backend = 'django.contrib.auth.backends.ModelBackend' There is not and never has been any such line of code in django-re

Re: Basic MySQLdb Install

2008-01-10 Thread David Grant
On Jan 10, 2008 3:24 PM, rob_mazur <[EMAIL PROTECTED]> wrote: > > On Jan 10, 2:51 pm, "David Grant" <[EMAIL PROTECTED]> wrote: > > I would work on it the other way around...tell mysql to put it's socket > > somewhere else... I'd be surprised if Suse's mysql package would put it > in > > /tmp by de

Re: Postgresql setup

2008-01-10 Thread Kenneth Gonsalves
On 10-Jan-08, at 8:20 PM, mjj wrote: > I need to get a postgresql db sorted out for my django install, having > never used it before its a little tricky. Postgres etc is installed as > are the appropriate python bits etc etc, the problem I get is an IDENT > error when I try to connect. Anyone ha

markdown, html2text & pygments clashes

2008-01-10 Thread mamcxyz
Hi, I'm building a site where I wanna let insert sourcecode in the comments, but then I clean everything to markdown using html2text. I don't wanna force to use markdown syntax and i setup http://code.google.com/p/mooeditable/ for the end-users. However, I get the problem that html2text not pre

Re: SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-10 Thread Peter Rowell
Eoin: Do you have SESSION_SAVE_EVERY_REQUEST = True in your settings.py file? I found that with that set to False, the problem went away. From something Malcolm said, it may also go away if you explicitly set SESSION_COOKIE_DOMAIN. --~--~-~--~~~---~--~~ You receiv

Re: When to use templatetags and how to use views.py

2008-01-10 Thread Kenneth Gonsalves
On 10-Jan-08, at 8:54 PM, Darthmahon wrote: > Is there any real difference between passing the data from a views.py > file into a template compared with asking for the data using a > templatetag? if you are only using it in one template - do it in the view. If you are doing it in several or a

Re: django-registration mysterious errror

2008-01-10 Thread [EMAIL PROTECTED]
Thanks James. So the mystery remains... here's the full error I got,if it helps. I can't figure out where it came from. Never happened before. Traceback (most recent call last): File "/home/grmadmin/webapps/django/django/core/handlers/base.py", line 77, in get_response response = callback(re

Re: Multiple sites, shared hosting

2008-01-10 Thread Michael Hipp
Graham Dumpleton wrote: > On Jan 11, 8:50 am, Michael Hipp <[EMAIL PROTECTED]> wrote: >> Hello, >> >> My "main" Django site is working great. But on my shared hosting account >> (HostMonster) I have multiple sites. Some will be Django, some will be >> plain html. >> >> How do I set this up (specif

Re: i18n problem: Some template variables "get stuck" in one language

2008-01-10 Thread Peter Rowell
Emil: > Except that on a couple of pages, > the language seems to get stuck on the translated language after the > first time I change languages. This smells very much like a caching issue. Do you have any form of caching enabled? If so, turn it off and see if the problem is magically fixed. Yo

Re: Multiple sites, shared hosting

2008-01-10 Thread Graham Dumpleton
On Jan 11, 1:13 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > On Jan 11, 8:50 am, Michael Hipp <[EMAIL PROTECTED]> wrote: > >> Hello, > > >> My "main" Django site is working great. But on my shared hosting account > >> (HostMonster) I have multiple sites. Some will be D

Re: SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-10 Thread Eoin
I actually found (few hours later) it was a rehash of : http://groups.google.com/group/django-users/browse_thread/thread/7f4becc6b0a482d0/669b3e3e68f80f84 the md5 of php conflicting with the md5 python ... i disabled php and all has been great since --~--~-~--~~~---~--

Re: Multiple sites, shared hosting

2008-01-10 Thread Michael Hipp
Graham Dumpleton wrote: > On Jan 11, 1:13 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: >> Graham Dumpleton wrote: >>> On Jan 11, 8:50 am, Michael Hipp <[EMAIL PROTECTED]> wrote: Hello, My "main" Django site is working great. But on my shared hosting account (HostMonster) I have multi

Re: django-registration mysterious errror

2008-01-10 Thread Karen Tracey
On Jan 10, 2008 9:11 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Thanks James. So the mystery remains... here's the full error I got,if > it helps. I can't figure out where it came from. Never happened > before. > > Traceback (most recent call last): > > File "/home/grmadmin/webapps/djan

Re: django-registration mysterious errror

2008-01-10 Thread [EMAIL PROTECTED]
Unless I've gone utterly mad, it IS django-registration. I remember installing django-registration, and most all of the code looks just like django-registration, albeit an older version. Not that any of that explains the error, or where line 35 or 36 came from (they differ from the current django-

Re: Multiple sites, shared hosting

2008-01-10 Thread Michael Hipp
Michael Hipp wrote: > Graham Dumpleton wrote: >> On Jan 11, 1:13 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: >>> Graham Dumpleton wrote: On Jan 11, 8:50 am, Michael Hipp <[EMAIL PROTECTED]> wrote: > Hello, > My "main" Django site is working great. But on my shared hosting account

Re: django-registration mysterious errror

2008-01-10 Thread James Bennett
On Jan 10, 2008 9:14 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Unless I've gone utterly mad, it IS django-registration. I remember > installing django-registration, and most all of the code looks just > like django-registration, albeit an older version. Not that any of > that explains the

Dev server hangs based on Site settings?

2008-01-10 Thread Andrew
I'm seeing some very strange behavior on my development box... If I have the current site (the one returned by Site.get_current_site()) set to the same address as my development server, the server will hang. The server with run, but stalls when I try to make a request -- it doesn't even print out

Re: django-registration mysterious errror

2008-01-10 Thread [EMAIL PROTECTED]
That's it. That's exactly it, and I remember doing it, now that you put it that way. All right, now that I know what's going on, maybe I can figure out where the error's coming from. Thank you. I like this explanation way more than the possiblility that I was going mad. On Jan 10, 9:47 pm, "James

win a million doller & make ur life sweeter

2008-01-10 Thread jones
win a million doller & make ur life sweeter http://lawbido.blogspot.com/ --~--~-~--~~~---~--~~ 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 unsu

Re: advice on table joins

2008-01-10 Thread Sean Perry
Ken wrote: > I need some advice. I'm struggling with a query that spans 4 tables. > "Struggling" is a bad word; I'll explain later. Django uses a model- > oriented query system together with a Foreign Key manager to get to > the "next" joining table. A query that spans several tables results >

Re: When to use templatetags and how to use views.py

2008-01-10 Thread Darthmahon
Thanks for the reply, I've also just found out about context processors, which to me sound extremely similar to templatetags. The only problem I can see with both of these options is that I can't see how you pass extra options into them, whereas you can if the logic is contained within views.py I