multiple Sites, multiple Users, a User is restricted to one Site

2009-10-22 Thread ncherro
I'm working on a CMS project, and my idea is to have one Django project serve multiple websites. I want to set things up so that user1, user2, user3, etc... can log into my CMS website (e.g. www.cms.com) and update their respective websites (e.g. user1 updates www.user1.com, user2 updates www.use

Re: Dreamhost PS installation problems.

2009-10-22 Thread Richard Jeong
As a follow up, does anyone know of a individual/group that I can pay to help me resolve this error? As this is work related I need to get it resolve and I can't afford to leave dreamhost right now. I'd like to see if I can find someone who can spend an hour or two an help me find out if it's pr

Re: Caching performance regression between django 1.0 and django 1.1.1

2009-10-22 Thread mt
On Oct 19, 1:08 pm, Russell Keith-Magee wrote: > On Mon, Oct 19, 2009 at 6:52 PM, mt wrote: > > > Hi All, > > I recently upgraded a high traffic site from django 1.0 to django > > 1.1.1 and noticed that the load on the server went through the roof, > > so I had to revert to django 1.0. > > I'v

apache authentication with django+flip+fastcgi

2009-10-22 Thread Robin Becker
We currently have django(using flup) running as a fastcgi external server (via a socket) and would like to use django to control access to static apache files (to avoid duplicate logins etc etc); I see that fastcgi can do Authentication (in the http sense) and access checking. Is there a way t

Re: installing Django on Mac OS 10.6

2009-10-22 Thread dk
Perhaps you could post about your results. I tried this, in setting up a deployment server, and ran into roadblocks (which I did not document) so I switched to sqlite. The latter comes with the python on snow-leopard, and the only issues I had were with permissions; I had to make the database AN

Inner Join perhaps?

2009-10-22 Thread The Danny Bos
Hey there, I want to loop through all items in CollectionItem (models.py below), build a list of the items, then get CollectionUser.grade if that exists where (user=request.user) and it's associated with the item in CollectionItem list. eg: "Item 1" - "" "Item 2" - "Grade = 89" "Item 3" - "" "It

Re: concurrency and threading question

2009-10-22 Thread Graham Dumpleton
On Oct 22, 3:44 am, Javier Guerra wrote: > On Wed, Oct 21, 2009 at 9:49 AM, Michael Thon wrote: > > Thanks for pointing me towards celery.  Its probably overkill for what > > I want to do right now but I'm going to try to set it up anyway. > > the roll-your-own alternative is just setting a DB

Re: Dreamhost PS installation problems.

2009-10-22 Thread Daniel Roseman
On Oct 20, 2:04 pm, wonderfullyrich wrote: > I'm trying to use a mix between thehttp://wiki.dreamhost.com/Django#Setup > andhttp://webhostingreal.com/content/view/18/1/(which looks slightly > more recent then the wiki) to setup django on a PS server with > Dreamhost.  I'm stuck at the easy_instal

Re: Which apps/solutions are most appropriate for model based search in Django?

2009-10-22 Thread bruno desthuilliers
On 22 oct, 07:54, chefsmart wrote: > This is on stackoverflow.com also, but I guess not all Django users > visit that site so I am posting this here also: - > > I have a Django app where most of the search is driven by foreign > keys. For example, assuming Student, School, State, and > Educatio

Re: Inner Join perhaps?

2009-10-22 Thread The Danny Bos
I think I've got it. Does the below look right and would it run ok with 1000 Items on a page? test_sql = ((t, t.collectionuser_set.get(user=request.user)) for t in CollectionItem.objects.filter(collection=collection)) for item, useritems in test_sql: print 'Test:

Re: Problem about write data into the DB

2009-10-22 Thread bruno desthuilliers
On 21 oct, 17:28, 邓超 wrote: > Hi all, >   I deployed a django app on my laptop, the whole environment is like this: > the OS is UBUNTU904, the web server is Apache, If it's only for personal use on a single laptop, setting up Apache is possibly overkill - you could as well use the builtin dev se

Re: 500.html does not load

2009-10-22 Thread raj
Hi, > On Oct 21, 2:50 pm, NoviceSortOf wrote: > > Although I have 500.html in my > > site-packages/django/contrib/admin/templates folder 500.html does not > > appear when it should, below see my errors (I've included the > > traceback items below). > > > Is there something else I need to configu

Re: Inner Join perhaps?

2009-10-22 Thread The Danny Bos
Actually, that's no good as it craps out if there's no matching records in CollectionUser. Back to the drawing board ... Any better ideas? d - - - On Oct 22, 9:01 pm, The Danny Bos wrote: > Hey there, I want to loop through all items in CollectionItem > (models.py below), build a list of t

Re: edit fieldset.html template

2009-10-22 Thread onoxo
is there some kind of manual/procedure to use objects in template pages? On Oct 21, 10:40 pm, onoxo wrote: > hi! > i have a model and I'm using it as inline in admin site. here is the > code: > > models.py > > class PhotoItem(models.Model): >     order = models.IntegerField(blank = True, null =

Re: "Unsupressing" errors when called from templates

2009-10-22 Thread bruno desthuilliers
On 21 oct, 16:00, Peter Bengtsson wrote: > On 21 Oct, 14:29, bruno desthuilliers > wrote:> On 21 oct, 15:05, Peter Bengtsson wrote: > > > a NotImplementedError would be more appropriate !-) > > I don't know what means oops, sorry - it's french for "OT". > > > Did you actually tried with

Re: "Unsupressing" errors when called from templates

2009-10-22 Thread Peter Bengtsson
2009/10/22 bruno desthuilliers : > > > > On 21 oct, 16:00, Peter Bengtsson wrote: >> On 21 Oct, 14:29, bruno desthuilliers >> wrote:> On 21 oct, 15:05, Peter Bengtsson wrote: >> >> > a NotImplementedError would be more appropriate !-) >> >> I don't know what means > > oops, sorry - it's fren

Redirects on HTTPS

2009-10-22 Thread Tim Sawyer
Hi, I have a django app that works fine using http. We have a requirement to serve the entire site using https, which is being done at the proxy level - so the Apache that my django is running inside (mod_wsgi) doesn't know about the https. I have a problem with using HttpResponseRedirect - the

Re: Preview model before saving it

2009-10-22 Thread Aaron
I've thought about using a "published" boolean but I'm not sure how that would help. These models are displayed on a live site, and it will be existing models I'll be editing and previewing. While a model is in "draft mode" I still want the old unchanged version of the model displayed on the live

Re: Which apps/solutions are most appropriate for model based search in Django?

2009-10-22 Thread chefsmart
Yes, I am also not convinced that an engine focused on full-text search is relevant in this case. But i am no expert on that. I haven't actually benchmarked the performance of the current solution I am using, I am just looking to get some opinions or solutions if django users have encountered thi

Re: Caching performance regression between django 1.0 and django 1.1.1

2009-10-22 Thread Russell Keith-Magee
On Thu, Oct 22, 2009 at 4:38 PM, mt wrote: > > > > On Oct 19, 1:08 pm, Russell Keith-Magee > wrote: >> On Mon, Oct 19, 2009 at 6:52 PM, mt wrote: >> >> > Hi All, >> > I recently upgraded a high traffic site from django 1.0 to django >> > 1.1.1 and noticed that the load on the server went throug

Re: 500.html does not load

2009-10-22 Thread NoviceSortOf
>> Traceback error : TemplateDoesNotExist: 500.html Thanks for the note Akonsu, I'm looking at my template settings in settings.py on my production server and don't see any anomalies. As well all my other templates load -- so I'm not sure where else to go to trouble shoot this. TEMPLATE_LOADERS

Re: Redirects on HTTPS

2009-10-22 Thread Tom Evans
On Thu, 2009-10-22 at 12:45 +0100, Tim Sawyer wrote: > Hi, > > I have a django app that works fine using http. We have a requirement to > serve the entire site using https, which is being done at the proxy level > - so the Apache that my django is running inside (mod_wsgi) doesn't know > about t

Re: Which apps/solutions are most appropriate for model based search in Django?

2009-10-22 Thread David De La Harpe Golden
>>> That is, a search on students >>> is essentially an answer to the question "Show students that belong to >>> the following schools, and who belong to the following states, and who >>> have the following degrees / diplomas". N.B. That in particular does sound like what might sometimes be calle

Re: admin actions bar in django 1.1

2009-10-22 Thread kkerbel
I think I found the problem...I have some files missing in my media folder...namely 'actions.js'...I'm assuming adding this back will fix my problem...if I could just figure out how to get my site to read the media directory to begin with. ha. On Oct 21, 4:53 pm, kkerbel wrote: > it doesn't app

Re: Problem about write data into the DB

2009-10-22 Thread 邓超
HI Bruno, Thank you for your answer. The reason I choose setup the whole environment is I need setup them in a virtual machine and send this virtual machine to my friends to test it, they are not familiar with django, they just want to open the web browser and test the site. And I also want to ge

Advantages of using ManyToManyField(Bar, through='Foo_Bar') syntax vs not declaring a ManyToManyField at all

2009-10-22 Thread Monika Sulik
Hi, I was wondering what exactly are the advantages of having code like this: >> class Foo (models.Model): bar_m2m = models.ManyToManyField(Bar,through='Foo_Bar') class Bar (models.Model): pass class Foo_Bar (models.Model): foo = models.ForeignKey(Foo)

authenticated CDN content

2009-10-22 Thread captainmish
Hello We have been using a view that implements X-Sendfile (with apache's mod_xsendfile) to serve content to authorised users, but now need to switch to cloudfiles. Cloudfiles doesnt offer any kind of authentication, so we'll need to implement it in django / apache somehow. What I have done is j

Re: Do I have to pass the httprequest object to render_to_response every time?

2009-10-22 Thread jul
But I still have to pass RequestContext(request) to render_to_response if I'm not using generic views, right? On Oct 21, 8:38 pm, Andrew Ingram wrote: > jul wrote: > > hi, > > > in my base.html template I've got a header which needs httprequest > > (request.path, request.user.is_authenticated...

Re: Advantages of using ManyToManyField(Bar, through='Foo_Bar') syntax vs not declaring a ManyToManyField at all

2009-10-22 Thread Tom Evans
On Thu, 2009-10-22 at 07:57 -0700, Monika Sulik wrote: > Hi, > > I was wondering what exactly are the advantages of having code like > this: > > >> > class Foo (models.Model): > bar_m2m = models.ManyToManyField(Bar,through='Foo_Bar') > > class Bar (models.Model):

Re: Do I have to pass the httprequest object to render_to_response every time?

2009-10-22 Thread Bayuadji
IMHO Yes, otherwise the context_processor variable won't be available in template -djibon- On Thu, Oct 22, 2009 at 11:43 AM, jul wrote: > > But I still have to pass RequestContext(request) to render_to_response > if I'm not using generic views, right? > > On Oct 21, 8:38 pm, Andrew Ingram wrot

Re: Preview model before saving it

2009-10-22 Thread Ethan Jucovy
Do you need one-time previews ("are you sure you want to save this?") or real drafts that can be viewed more than once? If you just need an intermediate preview step for the user who's submitting the data, you can do it without saving any data on the backend -- write a "preview" view that validat

displaying posted data

2009-10-22 Thread Dhruv Adhia
Hello, Quite a basic question.. I am posting data from Unity, its like name and score. I want to read the posted data and display it. Here is the code that I currently have inside views.py def add_score(request): response_dict ={} if request.POST: name = request.GET['name']

Re: displaying posted data

2009-10-22 Thread f4nt
You're initting your variables from request.GET instead of request.POST. On Oct 22, 12:20 pm, Dhruv Adhia wrote: > Hello, > > Quite a basic question.. I am posting data from Unity, its like name > and score. I want to read the posted data and display it. > > Here is the code that I currently hav

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
do you mean name = request.POST['name'] ? Thanks Dhruv Adhia http://thirdimension.com On Thu, Oct 22, 2009 at 10:48 AM, f4nt wrote: > > You're initting your variables from request.GET instead of > request.POST. > > On Oct 22, 12:20 pm, Dhruv Adhia wrote: > > Hello, > > > > Quite a basic ques

Re: displaying posted data

2009-10-22 Thread Daniel Roseman
On Oct 22, 6:20 pm, Dhruv Adhia wrote: > Hello, > > Quite a basic question.. I am posting data from Unity, its like name > and score. I want to read the posted data and display it. > > Here is the code that I currently have inside views.py > > def add_score(request): >    response_dict ={} >    i

Filtering my User list based on a UserProfile field?

2009-10-22 Thread Jean-Nicolas
Hi there... I've extended my User model (with both UserProfile and UserPaymentInformation) to hold additional information about a user. I'm able to add both to my admin area using Inlines (and re- registering my admin site)... However, I'm facing a problem that I'm not sure how to resolve: A ver

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
oops that was a typo.. thanks for pointing that out... Yep I see atleast the html elements getting displayed like those arrows... on the views side I didnt get what f4nt meant.. can you show me an example? Thanks Dhruv Adhia http://thirdimension.com On Thu, Oct 22, 2009 at 11:05 AM, Daniel Ros

Re: displaying posted data

2009-10-22 Thread Daniel Roseman
On Oct 22, 7:19 pm, Dhruv Adhia wrote: > oops that was a typo.. thanks for pointing that out... Yep I see atleast the > html elements getting displayed like those arrows... > > on the views side I didnt get what f4nt meant.. can you show me an example? > You had it right in your reply to him: re

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Allright, I see some progress, so now my views looks like this with that little modification def add_score(request): response_dict ={} if request.POST: name = request.POST['name'] score = request.POST['score'] hash = request.POST['hash'] response_dict = {'name': n

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Inside my urls, I have the url pattern as (r'^add_score/', 'carbon_chaos.highscore.views.add_score'), # for displaying posted data from unity.. is the url pattern wrong? Thanks Dhruv Adhia http://thirdimension.com On Thu, Oct 22, 2009 at 11:35 AM, Dhruv Adhia wrote: > Allright, I see some p

Re: displaying posted data

2009-10-22 Thread Daniel Roseman
On Oct 22, 7:35 pm, Dhruv Adhia wrote: > Allright, I see some progress, so now my views looks like this with that > little modification > > def add_score(request): >    response_dict ={} >    if request.POST: >        name = request.POST['name'] >        score = request.POST['score'] >        has

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
ohk , corrected. But then why am I not getting to see the values on browser? is it because the url pattern is not matching? Thanks Daniel. Dhruv Adhia http://thirdimension.com On Thu, Oct 22, 2009 at 12:05 PM, Daniel Roseman wrote: > > On Oct 22, 7:35 pm, Dhruv Adhia wrote: > > Allright, I se

Re: displaying posted data

2009-10-22 Thread Karen Tracey
On Thu, Oct 22, 2009 at 2:35 PM, Dhruv Adhia wrote: > Allright, I see some progress, so now my views looks like this with that > little modification > > > def add_score(request): >response_dict ={} >if request.POST: >name = request.POST['name'] >score = request.POST['score

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Yep and sorry I am bit new to this stuff, I mistook 69 for 200. This explained it http://cwiki.apache.org/GMOxSAMPLES/using-asynchronous-http-client.data/s200.log so for '?' then should my url pattern for add_Score look like this (r'^add_score/?', 'carbon_chaos.highscore.views.add_score'), Tha

Re: Preview model before saving it

2009-10-22 Thread Aaron
On Oct 22, 1:41 pm, Ethan Jucovy wrote: > Do you need one-time previews ("are you sure you want to save this?") or > real drafts that can be viewed more than once?  If you just need an > intermediate preview step for the user who's submitting the data, you can do > it without saving any data on t

Re: displaying posted data

2009-10-22 Thread Karen Tracey
On Thu, Oct 22, 2009 at 3:25 PM, Dhruv Adhia wrote: > Yep and sorry I am bit new to this stuff, I mistook 69 for 200. This > explained it > http://cwiki.apache.org/GMOxSAMPLES/using-asynchronous-http-client.data/s200.log > > so for '?' then should my url pattern for add_Score look like this > >

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Allright, I get that part. the url is coming from unity javascript part inside unity the part in bold is doing the post data. private var secretKey="mySecretKey"; function postScore(name, score) { //This connects to a server side php script that will add the name and score to a MySQL DB.

base.css not being included

2009-10-22 Thread kkerbel
Hello all... I upgraded from django 1.0 to 1.1.1 and when I copied the new admin media folder into my apache media root...the only css that loads when I visit the main admin page is dashboard.css which basically just gives me text. It appears that base.css needs to be loaded as well since that's

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
here is the version I thought should have worked, but its not quite there def add_score(request): #response_dict ={} secret_key = "asdf789as7df89asdf87ds89a8f7sfd8" name ="" score=0 hash="" # getting the posted data if request.GET: name = request.POST['name'] pr

Re: edit fieldset.html template

2009-10-22 Thread onoxo
some hint? On Oct 22, 12:28 pm, onoxo wrote: > is there some kind of manual/procedure to use objects in template > pages? > > On Oct 21, 10:40 pm, onoxo wrote: > > > > > hi! > > i have a model and I'm using it as inline in admin site. here is the > > code: > > > models.py > > > class PhotoItem(

Re: base.css not being included

2009-10-22 Thread kkerbel
Nevermind...i fixed it. The previous programmer had copied the templates into the project. On Oct 22, 3:59 pm, kkerbel wrote: > Hello all... > > I upgraded from django 1.0 to 1.1.1 and when I copied the new admin > media folder into my apache media root...the only css that loads when > I visit

Re: admin actions bar in django 1.1

2009-10-22 Thread kkerbel
fixed it...it was a template issue. On Oct 22, 9:10 am, kkerbel wrote: > I think I found the problem...I have some files missing in my media > folder...namely 'actions.js'...I'm assuming adding this back will fix > my problem...if I could just figure out how to get my site to read the > media di

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Just ignore past messages. I got successful posting of data from unity to django localhost server. Now I am creating POST request from unity thats why I am doing request.POST if condition. I could see that through print statements inside this code if request.POST: name = request.POST['nam

Passing Parameter to form in inlineformset_factory

2009-10-22 Thread Andew Gee
Hi, I have the following Form defined class MyForm(ModelForm) def __init__(self, readOnly=False, *args, **kwargs): if readOnly: Do stuff to make the inputs readonly MyForm works perfectly when I instantiate it in the view as a form form = MyForm(readOnly=True, instance=ModelA

Re: Redirects on HTTPS

2009-10-22 Thread Graham Dumpleton
The easier thing to do and which works for both HTTP and HTTPS is to have have any front end web server such as nginx which is handling the actual request set a special header when request came via HTTPS. In Apache configuration you then use mod_setenvif to set HTTPS variable. As an example, WebF

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Allright, working :) Thank you all! Dhruv Adhia http://thirdimension.com On Thu, Oct 22, 2009 at 4:09 PM, Dhruv Adhia wrote: > Just ignore past messages. I got successful posting of data from unity to > django localhost server. Now I am creating POST request from unity thats why > I am doing

Debugging SQL Queries: Correlating with Python Code

2009-10-22 Thread Brian Neal
Currently I am keeping an eye on SQL queries by displaying at the bottom of my base template sql_queries. I'm seeing some queries that look kind of strange to me, and I was wondering if there was a way to somehow correlate the queries with my app's Python code. For example, amongst the SQL querie

If search string contains a number ... Do this ...

2009-10-22 Thread The Danny Bos
Hey guys, In a view, is there a way to check if a search/querystring has a number in it? If number in string: do this otherwise: do this instead ... Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: Debugging SQL Queries: Correlating with Python Code

2009-10-22 Thread Russell Keith-Magee
On Fri, Oct 23, 2009 at 11:03 AM, Brian Neal wrote: > > Currently I am keeping an eye on SQL queries by displaying at the > bottom of my base template sql_queries. I'm seeing some queries that > look kind of strange to me, and I was wondering if there was a way to > somehow correlate the queries

Re: Limit choices based on a foreign key

2009-10-22 Thread Tim Valenta
I would very much be interested in a solution to this problem. I can't yet understand why Django is so wonderful at so many things, yet has absolutely no mechanism for this. Every time there seems to be hope of a working solution, it never works for inlines. For the sake of painting up another

how to cut and paste image into django app

2009-10-22 Thread Margie Roginski
I have a django app that uses Eric Florenzano's threadedcomments app to allow my users to comment on issues. My users are asking for the ability to cut and paste images into their comments. They want to use an windows app called mwsnap to basically snap images from their desktop, then ctrl-v to

Interesting code abstraction Challenge

2009-10-22 Thread Jason Beaudoin
Why hello there, I have been thinking over this system design for quite a while now, and I'm still a bit unsure of the sensible way to properly (and sufficiently) abstract the system - the django-way, so to speak. I am very interested in what other folks have to say - maybe I have been thinking a

Re: If search string contains a number ... Do this ...

2009-10-22 Thread Grant Livingston
What about using pythons regular expression module (re) ? Example, if re.search("\d", "Search query 2 search"): # Do this. else: # Do this instead. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users