Re: UserWarning: A {% csrf_token %} was used in a template, but the context did not provide the value.

2013-11-19 Thread huw_at1
Hi,

Many thanks. There is another form in the page which does contain this {% 
csrf_token %} tag. Removing this does remove the warning so this is indeed 
the issue. I just need to write the other form out of the template.

Thanks for the answer :)

On Tuesday, 19 November 2013 13:51:55 UTC, Giulio Calacoci wrote:
>
>  Il 19/11/2013 13:45, huw_at1 ha scritto: 
>
> {% csrf_token %}
>
> If you are using the ajax metod, you don't need this tag in the form 
> template.
>
> According with the documentation, you set the csrf token using javascript 
> in the beforeSend part of the javascript code.
>
>
> Hope I've correctly understood your problem.
>
> Regards.
>
> Giulio
>
> -- 
>  Giulio Calacoci - 2ndQuadrant Italia
>  PostgreSQL Training, Services and Support
>  giulio@2ndquadrant.it  | www.2ndQuadrant.it 
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e599bf09-6e76-45e5-80eb-814986c0260f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: UserWarning: A {% csrf_token %} was used in a template, but the context did not provide the value.

2013-11-19 Thread huw_at1
Hi,

Many thanks. There is another form in the page which does contain this {% 
csrf token %}. Removing this does remove the warning so this is indeed the 
issue. I just need to write the other form out of the template.

Thanks for the answer :)

On Tuesday, 19 November 2013 13:51:55 UTC, Giulio Calacoci wrote:
>
>  Il 19/11/2013 13:45, huw_at1 ha scritto: 
>
> {% csrf_token %}
>
> If you are using the ajax metod, you don't need this tag in the form 
> template.
>
> According with the documentation, you set the csrf token using javascript 
> in the beforeSend part of the javascript code.
>
>
> Hope I've correctly understood your problem.
>
> Regards.
>
> Giulio
>
> -- 
>  Giulio Calacoci - 2ndQuadrant Italia
>  PostgreSQL Training, Services and Support
>  giulio@2ndquadrant.it  | www.2ndQuadrant.it 
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/230f16ed-f1d8-4f41-9de8-5ab8d231d397%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Problem with raw query and using in

2013-11-19 Thread huw_at1
Hi,

I think I had something similar and followed this thread:

http://stackoverflow.com/questions/4574609/executing-select-where-in-using-mysqldb

I think this is what Dennis has already said so apologies if it isn't 
helpful.

Kindest regards

On Saturday, 16 November 2013 12:40:52 UTC, Thorsten wrote:
>
> Hello, 
>
> wondering if I am doing something wrong or it is a bug, using django 
> 1.5.5, but also tried with 1.6 resulting in the same problem. 
>
> When I do the following: 
>
> realms=[1] 
> data = AuctionData.objects.filter(itemid__exact=itemid,realm__in=realms) 
> data2 = AuctionData.objects.raw('SELECT * FROM auctiondata_auctiondata 
> WHERE itemid_id=%s AND realm_id in %s ',[itemid,realms]) 
>
> The first query works as expected, but the 2nd one fails, because the 
> query ends up as: 
>
> SELECT * FROM auctiondata_auctiondata WHERE itemid_id='43552' AND 
> realm_id in ('1',) 
>
> The last comma shouldnt be there, if I use more than 1 value with the 
> realms variable it works and the last comma isn't there. 
>
> Greetings, 
> Thorsten 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/79829d6d-6f82-4de9-823d-8cbfb1cade7e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


UserWarning: A {% csrf_token %} was used in a template, but the context did not provide the value.

2013-11-19 Thread huw_at1
Hi there,

I'm trying to get to the bottom of this warning that I am getting:

/usr/local/lib/python2.7/site-packages/django/template/defaulttags.py:59: 
UserWarning: A {% csrf_token %} was used in a template, but the context did 
not provide the value.  This is usually caused by not using RequestContext.
  warnings.warn("A {% csrf_token %} was used in a template, but the context 
did not provide the value.  This is usually caused by not using 
RequestContext.")

My setup is that I have a form that I am passing to my views via AJAX. I 
prepare the AJAX POST following the guidelines at:

https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax

I am then returning the response using:

return HttpResponse(json.dumps(data), content_type="application/json")

The data returned in the response is then used to update the template that 
also includes the form.

>From the warning I guess I am not returning the CSRF token in the response? 
Is that the issue? I did try adding the @ensure_csrf_cookie decorator to 
the views function but still got this warning. Should I manually return a 
RequestContext and modify my javascript to handle the token accordingly? 
Apologies - it's the first time I've done anything like this...

Many thanks for any help or light anyone can shed on this.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/26e4e778-5dbd-45ed-86ea-353f02dc9016%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Greyed out models in Django Admin

2013-09-06 Thread huw_at1
Ah great I can confirm that moving the admin model settings into a seperate 
admin.py file fixed the issue. I have to say though I'm not sure I 
understand why that issue occurs and also that I'm pretty sure I was 
following a recommended tutorial for setting up models in the admin.

Thanks for the help.

huw_at1

On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>
> Hi,
>
> Using Django 1.4, have registered 3 model classes with admin. When 
> accessing admin page provided by test server can select each class and edit 
> entries. However when accessing production admin the classes are greyed 
> out, only the users, groups and sites are selectable. I thought this might 
> be database access issues however I can run syncdb without any problems. 
> Any ideas?
>
> Many thanks
>
> Huw Jones.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Greyed out models in Django Admin

2013-09-06 Thread huw_at1
Ah ok thanks I will try that and update.

On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>
> Hi,
>
> Using Django 1.4, have registered 3 model classes with admin. When 
> accessing admin page provided by test server can select each class and edit 
> entries. However when accessing production admin the classes are greyed 
> out, only the users, groups and sites are selectable. I thought this might 
> be database access issues however I can run syncdb without any problems. 
> Any ideas?
>
> Many thanks
>
> Huw Jones.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Greyed out models in Django Admin

2013-09-06 Thread huw_at1
Attached a screenshot to show what I mean (photoshopped a couple of model 
names)

On Friday, 6 September 2013 13:19:34 UTC+1, huw_at1 wrote:
>
> Hmm looks like the django user account has full permissions granted 
> although I am no expert with PostgreSQL.
>
> This is still an issue - any other ideas?
>
> Has anyone else seen this before?
>
> Many thanks
>
> On Sunday, 18 August 2013 22:58:06 UTC+1, huw_at1 wrote:
>>
>> Hi,
>>
>> I'm using the latest Apache server on production.
>>
>> The DEBUG setting is the standard setting that exists within the 
>> settings.py file.
>>
>> I'll check what write permissions the production database user has.
>>
>> Thanks
>>
>> On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>>>
>>> Hi,
>>>
>>> Using Django 1.4, have registered 3 model classes with admin. When 
>>> accessing admin page provided by test server can select each class and edit 
>>> entries. However when accessing production admin the classes are greyed 
>>> out, only the users, groups and sites are selectable. I thought this might 
>>> be database access issues however I can run syncdb without any problems. 
>>> Any ideas?
>>>
>>> Many thanks
>>>
>>> Huw Jones.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
<>

Re: Greyed out models in Django Admin

2013-09-06 Thread huw_at1
Hmm looks like the django user account has full permissions granted 
although I am no expert with PostgreSQL.

This is still an issue - any other ideas?

Has anyone else seen this before?

Many thanks

On Sunday, 18 August 2013 22:58:06 UTC+1, huw_at1 wrote:
>
> Hi,
>
> I'm using the latest Apache server on production.
>
> The DEBUG setting is the standard setting that exists within the 
> settings.py file.
>
> I'll check what write permissions the production database user has.
>
> Thanks
>
> On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>>
>> Hi,
>>
>> Using Django 1.4, have registered 3 model classes with admin. When 
>> accessing admin page provided by test server can select each class and edit 
>> entries. However when accessing production admin the classes are greyed 
>> out, only the users, groups and sites are selectable. I thought this might 
>> be database access issues however I can run syncdb without any problems. 
>> Any ideas?
>>
>> Many thanks
>>
>> Huw Jones.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Greyed out models in Django Admin

2013-08-18 Thread huw_at1
Hi,

I'm using the latest Apache server on production.

The DEBUG setting is the standard setting that exists within the 
settings.py file.

I'll check what write permissions the production database user has.

Thanks

On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>
> Hi,
>
> Using Django 1.4, have registered 3 model classes with admin. When 
> accessing admin page provided by test server can select each class and edit 
> entries. However when accessing production admin the classes are greyed 
> out, only the users, groups and sites are selectable. I thought this might 
> be database access issues however I can run syncdb without any problems. 
> Any ideas?
>
> Many thanks
>
> Huw Jones.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Greyed out models in Django Admin

2013-08-15 Thread huw_at1
Hi,

I still have this issue and can't really figure out what the problem is. I 
have found that if I turn on DEBUG then the apps models become active again 
such that I can add new records via the admin interface. However when 
turning off DEBUG they become inactive and greyed out again.

I have tried altering the order in which my apps are loaded and also 
altered the permissions on the applications folder however nothing seems to 
solve this.

Sorry for the BUMP but does anyone have any further info on this?

Many thanks

Huw Jones

On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>
> Hi,
>
> Using Django 1.4, have registered 3 model classes with admin. When 
> accessing admin page provided by test server can select each class and edit 
> entries. However when accessing production admin the classes are greyed 
> out, only the users, groups and sites are selectable. I thought this might 
> be database access issues however I can run syncdb without any problems. 
> Any ideas?
>
> Many thanks
>
> Huw Jones.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Development Server Root URL...

2013-08-06 Thread huw_at1
Thanks so much for this. Exactly what I needed. Works great and I've also 
discovered reverse_lazy() for use with my urls.py in cases such as the 
next_page variable for authentication. One issue I have found is when 
wanting to have urls with optional arguments. Overloading the view function 
with several urls can cause issues with the reversing although I guess this 
forces one to write better URLs...

Again many thanks for the help with this - much appreciated.

Kind regards

Huw

On Monday, 3 June 2013 15:50:21 UTC+1, huw_at1 wrote:
>
> Hi there, I've run into an issue whereby on production my Django project 
> is accessed from a URL such as http://example.com/django_project/. Apache 
> is configured to host the code under this URL since I do not want the 
> entire site managed by the Django project. My problem is that when I run 
> the Django test server I have a lot of broken links as it wants to run the 
> project from 127.0.0.1 instead of 127.0.0.1/django_project/. Ideally I'd 
> like to have the Django test server reproduce the apache configuration. 
> What is the best way to resolve this does anyone have any experience?
>
> Many thanks
>
> Huw
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Django Development Server Root URL...

2013-06-03 Thread huw_at1


Hi there, I've run into an issue whereby on production my Django project is 
accessed from a URL such as http://example.com/django_project/. Apache is 
configured to host the code under this URL since I do not want the entire 
site managed by the Django project. My problem is that when I run the 
Django test server I have a lot of broken links as it wants to run the 
project from 127.0.0.1 instead of 127.0.0.1/django_project/. Ideally I'd 
like to have the Django test server reproduce the apache configuration. 
What is the best way to resolve this does anyone have any experience?

Many thanks

Huw

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django 1.4 Development Workflow Using Static Files

2012-12-26 Thread huw_at1
Thanks for the reply. I realised a few moments ago that I can use a 
relative STATIC_URL rather than an absolute one so now I just have 
'/static/' set as the value which works well.

Many thanks

RESOLVED

On Wednesday, 26 December 2012 00:53:42 UTC, אברהם סרור wrote:
>
> Maybe you can just upload the files directly to the collect static folder 
> on the server
>
> In any case maybe you want them under version control, so I guess you 
> could just automate all these steps with fabric
> On Dec 26, 2012 1:00 AM, "huw_at1" <huwd...@gmail.com > 
> wrote:
>
>> Hi again,
>>
>> Another quick question. I'm still getting used to 1.4 and I've been 
>> setting up a remote static file service for the production deployment of my 
>> web app. This works just great however it seems a little cumbersome when 
>> developing if I want to add fresh image content I have to add it to the 
>> project locally, commit and push the changes, deploy to production and 
>> collect the static files there before the image is available to the 
>> development server...This seems like a very round about way of developing - 
>> I must be missing something here although I do not know what? Should I 
>> modify the setting.py to change the STATIC_URL value dependent on whether 
>> the server is production or development or is there any smarter way?
>>
>> As ever any advice is much appreciated.
>>
>> Huw_at1
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/SL1HBsWfETwJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/BpNp4qTuVbgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django 1.4 Development Workflow Using Static Files

2012-12-25 Thread huw_at1
Hi again,

Another quick question. I'm still getting used to 1.4 and I've been setting 
up a remote static file service for the production deployment of my web 
app. This works just great however it seems a little cumbersome when 
developing if I want to add fresh image content I have to add it to the 
project locally, commit and push the changes, deploy to production and 
collect the static files there before the image is available to the 
development server...This seems like a very round about way of developing - 
I must be missing something here although I do not know what? Should I 
modify the setting.py to change the STATIC_URL value dependent on whether 
the server is production or development or is there any smarter way?

As ever any advice is much appreciated.

Huw_at1

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/SL1HBsWfETwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
[RESOLVED]

On Tuesday, 25 December 2012 17:28:15 UTC, Victor Rocha wrote:
>
> Your welcome! Merry Christmas
>
>
>
> On Tue, Dec 25, 2012 at 12:25 PM, huw_at1 <huwd...@gmail.com 
> > wrote:
>
>> Hiya - sorry yeah I pasted the wrong manage.py file initially. It should 
>> have been the test.settings manage.py.
>>
>> I figured it out partially anyway - I needed to change the project 
>> directory setting in the IDE as you said.
>>
>> Thanks for the help.
>>
>>
>> On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>>
>>> I don't think I can be of more help. Hopefully someone with experience 
>>> with PyCharm can chime in.
>>> This is probably not what you want to hear but ditch windows, ditch 
>>> pycharm use windows and vim or at least gedit.
>>>
>>> One last comment, in your manage.py file i can see this 'pkadata.settings'; 
>>> i didnt see that directory when you showed me your file structure.
>>>
>>>
>>>
>>> On Tue, Dec 25, 2012 at 12:01 PM, huw_at1 <huwd...@gmail.com> wrote:
>>>
>>>> pkadata.settings
>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/xbeOEaE7Ah4J.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QDMIerGSTp8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hiya - sorry yeah I pasted the wrong manage.py file initially. It should 
have been the test.settings manage.py.

I figured it out partially anyway - I needed to change the project 
directory setting in the IDE as you said.

Thanks for the help.

On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>
> I don't think I can be of more help. Hopefully someone with experience 
> with PyCharm can chime in.
> This is probably not what you want to hear but ditch windows, ditch 
> pycharm use windows and vim or at least gedit.
>
> One last comment, in your manage.py file i can see this 'pkadata.settings'; 
> i didnt see that directory when you showed me your file structure.
>
>
>
> On Tue, Dec 25, 2012 at 12:01 PM, huw_at1 <huwd...@gmail.com 
> > wrote:
>
>> pkadata.settings
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xbeOEaE7Ah4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

manage.py is show below:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)


I think you may be right...I think I have the project directory set at a 
level too high some how...


On Tuesday, December 25, 2012 1:22:10 PM UTC, huw_at1 wrote:
>
> Hi,
>
> This has probably been asked a million times before so apologies. I'm new 
> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
> perform a simple import from within my shell:
>
> from django.contrib.sites.models import Site
>
> However I am constantly getting the problem that my settings are not being 
> found:
>
> raise ImportError("Could not import settings '%s' (Is it on 
> sys.path?): %s" % (self.SETTINGS_MODULE, e))
> ImportError: Could not import settings 'test.test.settings' (Is it on 
> sys.path?): No module named test.settings
>
> In the past I would have thought that this was an issue as the project and 
> the "app" had the same name although in the case of 1.4 the settings are 
> placed in a directory with the same name as the project. I'm not sure what 
> I should change to get this to work.
>
> Has this been seen before or any ideas?
>
> Many thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/EGGUxTvjArEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

manage.py contents below:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pkadata.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)


I think you maybe right - I think it may be somewhere the project directory 
is set a level too high...

On Tuesday, December 25, 2012 1:22:10 PM UTC, huw_at1 wrote:
>
> Hi,
>
> This has probably been asked a million times before so apologies. I'm new 
> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
> perform a simple import from within my shell:
>
> from django.contrib.sites.models import Site
>
> However I am constantly getting the problem that my settings are not being 
> found:
>
> raise ImportError("Could not import settings '%s' (Is it on 
> sys.path?): %s" % (self.SETTINGS_MODULE, e))
> ImportError: Could not import settings 'test.test.settings' (Is it on 
> sys.path?): No module named test.settings
>
> In the past I would have thought that this was an issue as the project and 
> the "app" had the same name although in the case of 1.4 the settings are 
> placed in a directory with the same name as the project. I'm not sure what 
> I should change to get this to work.
>
> Has this been seen before or any ideas?
>
> Many thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/oGSYDONdBzUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

This project was created using django 1.4. The structure is as follows:

/home
  |
  --/huw_at1
  |
  ---/TEST
|

-/test-/test-settings.py
 .git   /static 
  urls.py
 /templates
wsgi.py   
 /test_app
 manage.py

So I have a parent container directory called TEST, then the project 
directory within this and then within the project directory django has set 
up the test subdirectory with the settings in. I am using PyCharm to try 
and run the Django console or shell as it is known which appears to run 
from the TEST container directory.

Does this make things clearer? Currently trying to run syncdb has issues 
creating the site because of this issue with not finding the settings as 
well I suspect. Are there any particular environment variables I should be 
setting considering I am running this from Win7?

Many thanks for the response

Huw_at1

On Tuesday, December 25, 2012 2:19:10 PM UTC, Victor Rocha wrote:
>
> Hi,
>
> I would like to ask you to post a snapshot of your dir structure. In the 
> mean time, I am going to give you some pointers that you could consider. Is 
> the an app you converted to django 1.4 or did you created your app from 
> scratch(using 1.4 from the beginning)?
>
> If you converted you app your Error("Could not import settings 
> 'test.test.settings' (Is it on sys.path?): ") indicates that you set your 
> "DJANGO_SETTINGS_MODULE" is set incorrectly. Open your manage.py file and 
> set it the django environmental variable to "test.settings".
>
> If you created your app using django 1.4 from the beginning, I don't see 
> how this error could happen! Django lays out your project for you and sets 
> everything correctly. 
>
> Thank you,
> Victor Rocha
> RochApps <http://www.rochapps.com>
>
>
> On Tuesday, December 25, 2012 8:22:10 AM UTC-5, huw_at1 wrote:
>>
>> Hi,
>>
>> This has probably been asked a million times before so apologies. I'm new 
>> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
>> perform a simple import from within my shell:
>>
>> from django.contrib.sites.models import Site
>>
>> However I am constantly getting the problem that my settings are not 
>> being found:
>>
>> raise ImportError("Could not import settings '%s' (Is it on 
>> sys.path?): %s" % (self.SETTINGS_MODULE, e))
>> ImportError: Could not import settings 'test.test.settings' (Is it on 
>> sys.path?): No module named test.settings
>>
>> In the past I would have thought that this was an issue as the project 
>> and the "app" had the same name although in the case of 1.4 the settings 
>> are placed in a directory with the same name as the project. I'm not sure 
>> what I should change to get this to work.
>>
>> Has this been seen before or any ideas?
>>
>> Many thanks
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QfQAXqhRxVoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

This has probably been asked a million times before so apologies. I'm new 
to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
perform a simple import from within my shell:

from django.contrib.sites.models import Site

However I am constantly getting the problem that my settings are not being 
found:

raise ImportError("Could not import settings '%s' (Is it on sys.path?): 
%s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'test.test.settings' (Is it on 
sys.path?): No module named test.settings

In the past I would have thought that this was an issue as the project and 
the "app" had the same name although in the case of 1.4 the settings are 
placed in a directory with the same name as the project. I'm not sure what 
I should change to get this to work.

Has this been seen before or any ideas?

Many thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jseW7hnxiUgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django RawQuerySet with Oracle CLOB

2010-09-01 Thread huw_at1
Hi there,

I've recently been using the raw() manager method to perform a few
more complex SQL queries on my Oracle DB and this has been working
very nicely. One particular SQL, however, appears to be giving blank
or phantom objects:

raw_query_list = list(tmp_class.object.raw(SELECT TO_CHAR(clob_column)
AS tmp_char, pk AS tmp_pk FROM table_name WHERE conditions))

where the tmp_class consists of:

class tmp_class(models.Model):

tmp_pk = models.IntegerField(primary_key=True)
tmp_char = models.TextField()

class Meta:
managed=False

Running the SQL query through cx_Oracle gives expected results however
when trying to present the list through a template the objects all
appear as blank. I realise that strictly speaking converting CLOB to
VARCHAR2 gives rise to potential issues over string length however in
this case all values in the CLOB column are less than 4000 characters.
My problem is that I am unsure as to where to start debugging. If I
had to guess at what the source of the problem was given the symptoms
I would say that it was something to do with the fact that CLOBs
operate using memory pointers rather than actual values so the phantom
objects are displayed as a result of the pointer being at the end of
the column. I could have made a mistake with the model however so I am
unsure. Any suggestions?

Many thanks as ever.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Manager.Raw() + Pagination

2010-06-04 Thread huw_at1
Ah I solved this now by realising I simply needed to cast the
RawQuerySet as a list.

On Jun 2, 7:52 am, huw_at1 <huwdjo...@gmail.com> wrote:
> Hi all,
>
> I'm trying to use Djangos new Raw feature to run a custom SQL and
> return back a list of objects. This works fine however I then want to
> paginate to present the results as a list. The RawQuerySet has no
> length value it seems to be able to paginate. Is there a recognised
> way of achieving this? Do I also need to run a "SELECT COUNT(*)" or
> should I look at writing my own pagination?
>
> Many thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Manager.Raw() + Pagination

2010-06-02 Thread huw_at1
Hi all,

I'm trying to use Djangos new Raw feature to run a custom SQL and
return back a list of objects. This works fine however I then want to
paginate to present the results as a list. The RawQuerySet has no
length value it seems to be able to paginate. Is there a recognised
way of achieving this? Do I also need to run a "SELECT COUNT(*)" or
should I look at writing my own pagination?

Many thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and Oracle Cartridges

2010-03-19 Thread huw_at1
Hi Tom,

Sorry if I gave the impression that I had not read around before
posting here. Believe it or not I already have the top 5 hits on this
search marked as read. Was it a particular page you were referring to
since all the ones I have read are either out of date or mention
workarounds?

Cheers

Huw

On Mar 19, 12:26 pm, Tom Evans <tevans...@googlemail.com> wrote:
> On Fri, Mar 19, 2010 at 11:35 AM, huw_at1 <huwdjo...@gmail.com> wrote:
> > I guess what I am asking is - can Django handle BLOBs in its models?
>
> > On 18 Mar, 16:55, huw_at1 <huwdjo...@gmail.com> wrote:
> >> Hi
>
> >> I currently have an oraclecartridgewhich performs a specific type of
> >> search on large binary objects (which thecartridgealso creates and
> >> indexes). I want to try and integrate thecartridgeinto a web app
> >> using Django however from what I have read so far it appears that
> >> Django is not designed to store BLOBs. I think I can encode the SQL
> >> for thecartridgecommands as Django allows for this. My main concern
> >> is how I go about storing these BLOBS however. Does anyone know about
> >> this or have any experience with integrating other Oracle cartridges
> >> into Django?
>
> >> Many thanks
>
> >> Huw
>
> http://lmgtfy.com/?q=django+blob
>
> Cheers
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and Oracle Cartridges

2010-03-19 Thread huw_at1
I guess what I am asking is - can Django handle BLOBs in its models?

On 18 Mar, 16:55, huw_at1 <huwdjo...@gmail.com> wrote:
> Hi
>
> I currently have an oraclecartridgewhich performs a specific type of
> search on large binary objects (which thecartridgealso creates and
> indexes). I want to try and integrate thecartridgeinto a web app
> using Django however from what I have read so far it appears that
> Django is not designed to store BLOBs. I think I can encode the SQL
> for thecartridgecommands as Django allows for this. My main concern
> is how I go about storing these BLOBS however. Does anyone know about
> this or have any experience with integrating other Oracle cartridges
> into Django?
>
> Many thanks
>
> Huw

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django and Oracle Cartridges

2010-03-18 Thread huw_at1
Hi

I currently have an oracle cartridge which performs a specific type of
search on large binary objects (which the cartridge also creates and
indexes). I want to try and integrate the cartridge into a web app
using Django however from what I have read so far it appears that
Django is not designed to store BLOBs. I think I can encode the SQL
for the cartridge commands as Django allows for this. My main concern
is how I go about storing these BLOBS however. Does anyone know about
this or have any experience with integrating other Oracle cartridges
into Django?

Many thanks

Huw

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ImportError: No module named urls

2009-07-13 Thread huw_at1

Ah fantastic many thanks.

All working nicely now much appreciated.

On Jul 10, 4:16 pm, Russell Keith-Magee <freakboy3...@gmail.com>
wrote:
> On Fri, Jul 10, 2009 at 10:33 PM, huw_at1<huwdjo...@gmail.com> wrote:
>
> > So I switched from mod_python to mod_wsgi since I don;t really know
> > what is going on and I realise mod_wsgi is recommended for 1.1 now.
> > Anyway the rest of my site works fine now. The only part still not
> > working is the admin section which fails with this "No module named
> > urls" error as can be seen in the traceback above.
>
> > For my settings I have the root urlconf as "myapp.urls".
>
> > In the urls file I have:
>
> > (r'^admin/(.*)', include('admin.site.urls')),
>
> > as is specified in the latest release notes.
>
> That isn't what the release notes say - the new form for the admin includes 
> is:
>
> (r'^admin/', include(admin.site.urls)),
>
> Note that there is no need for the wildcard regex pattern, and there
> are no quotes around admin.site.urls - it isn't a string, it's an
> attribute on the site object. This form was introduced for Django
> v1.1.
>
> However, the old form ( the same as your include('admin.site.root') )
> should continue to work. This form has been officially deprecated, but
> it is guaranteed to work until the release of Django v1.3 (i.e., two
> full releases in a deprecated state).
>
> Yours,
> Russ Magee %-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: ImportError: No module named urls

2009-07-10 Thread huw_at1

So I switched from mod_python to mod_wsgi since I don;t really know
what is going on and I realise mod_wsgi is recommended for 1.1 now.
Anyway the rest of my site works fine now. The only part still not
working is the admin section which fails with this "No module named
urls" error as can be seen in the traceback above.

For my settings I have the root urlconf as "myapp.urls".

In the urls file I have:

(r'^admin/(.*)', include('admin.site.urls')),

as is specified in the latest release notes. Although googling around
it is confusing as to whether this should be used or:

(r'^admin/(.*)', include('admin.site.root')),

should be used. Also I'm not sure if I should substitute "site" for
"myapp" in here.

Again I have found a couple of threads where someone has experienced
something similar better exaclty the same as what I am experiencing.
Any further suggestions?

Many thanks

On Jul 9, 5:44 pm, huw_at1 <huwdjo...@gmail.com> wrote:
> Hmm I didn't change any imports as far as i am aware.
>
> By full traceback do you mean the entirety of the error in the error
> log?
>
> Such as:
>
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] mod_python
> (pid=26734, interpreter='ccprod.arrowt.co.uk', phase='PythonHandler',
> handler='django.core.handlers.modpython'): Application error
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ServerName:
> 'ccprod.arrowt.co.uk'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] DocumentRoot:
> '/var/www'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] URI: '/admin'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Location: '/'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Directory:
> None
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Filename: '/
> var/www/admin'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] PathInfo: ''
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Traceback
> (most recent call last):
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/mod_python/importer.py", line 1542, in
> HandlerDispatch\n    default=default_handler, arg=req,
> silent=hlist.silent)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/mod_python/importer.py", line 1234, in
> _process_target\n    result = _execute_target(config, req, object,
> arg)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/mod_python/importer.py", line 1133, in
> _execute_target\n    result = object(arg)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/handlers/modpython.py", line
> 228, in handler\n    return ModPythonHandler()(req)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/handlers/modpython.py", line
> 201, in __call__\n    response = self.get_response(request)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/handlers/base.py", line 73, in
> get_response\n    response = middleware_method(request)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/middleware/common.py", line 57, in
> process_request\n    _is_valid_path("%s/" % request.path_info)):
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/middleware/common.py", line 142, in
> _is_valid_path\n    urlresolvers.resolve(path)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 262, in
> resolve\n    return get_resolver(urlconf).resolve(path)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 186, in
> resolve\n    sub_match = pattern.resolve(new_path)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 184, in
> resolve\n    for pattern in self.url_patterns:
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 213, in
> _get_url_patterns\n    patterns = getattr(self.urlconf_module,
> "urlpatterns", self.urlconf_module)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 208, in
> _g

Re: ImportError: No module named urls

2009-07-09 Thread huw_at1

Hmm I didn't change any imports as far as i am aware.

By full traceback do you mean the entirety of the error in the error
log?

Such as:

[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] mod_python
(pid=26734, interpreter='ccprod.arrowt.co.uk', phase='PythonHandler',
handler='django.core.handlers.modpython'): Application error
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ServerName:
'ccprod.arrowt.co.uk'
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] DocumentRoot:
'/var/www'
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] URI: '/admin'
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Location: '/'
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Directory:
None
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Filename: '/
var/www/admin'
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] PathInfo: ''
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Traceback
(most recent call last):
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/mod_python/importer.py", line 1542, in
HandlerDispatch\ndefault=default_handler, arg=req,
silent=hlist.silent)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/mod_python/importer.py", line 1234, in
_process_target\nresult = _execute_target(config, req, object,
arg)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/mod_python/importer.py", line 1133, in
_execute_target\nresult = object(arg)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/handlers/modpython.py", line
228, in handler\nreturn ModPythonHandler()(req)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/handlers/modpython.py", line
201, in __call__\nresponse = self.get_response(request)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/handlers/base.py", line 73, in
get_response\nresponse = middleware_method(request)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/middleware/common.py", line 57, in
process_request\n_is_valid_path("%s/" % request.path_info)):
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/middleware/common.py", line 142, in
_is_valid_path\nurlresolvers.resolve(path)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/urlresolvers.py", line 262, in
resolve\nreturn get_resolver(urlconf).resolve(path)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/urlresolvers.py", line 186, in
resolve\nsub_match = pattern.resolve(new_path)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/urlresolvers.py", line 184, in
resolve\nfor pattern in self.url_patterns:
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/urlresolvers.py", line 213, in
_get_url_patterns\npatterns = getattr(self.urlconf_module,
"urlpatterns", self.urlconf_module)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/core/urlresolvers.py", line 208, in
_get_urlconf_module\nself._urlconf_module = import_module
(self.urlconf_name)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in
import_module\n__import__(name)
[Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ImportError:
No module named urls


On 9 July, 16:59, Friðrik Már Jónsson <frid...@pyth.net> wrote:
> Hey!
>
> A full traceback could be helpful.
>
> A lot of time when you've got really strange import errors they have  
> something to do with circular imports. Did you change any imports  
> right before or after the upgrade?
>
> Regards,
> Friðrik Már
>
> On Jul 9, 2009, at 3:25 PM, huw_at1 wrote:
>
>
>
> > Hi all,
>
> > I have just been moving my website to a production server and am
> > having some difficulty getting it working. I have upgraded the Django
> > from 1.0 on my development server to 1.1 on the production server.
> > When I try to access the admin pages I get an Internal Server Error
> > and a message in the apache logs stating "Import Error: No module
> > named urls". I have tried running the shell and importing the urls
> > module from within an

ImportError: No module named urls

2009-07-09 Thread huw_at1

Hi all,

I have just been moving my website to a production server and am
having some difficulty getting it working. I have upgraded the Django
from 1.0 on my development server to 1.1 on the production server.
When I try to access the admin pages I get an Internal Server Error
and a message in the apache logs stating "Import Error: No module
named urls". I have tried running the shell and importing the urls
module from within and outside of the local directory both of which
work fine.

I'm guessing it's either some value in my settings file or something
is non-backwards compatible going from 1.0 to 1.1 but I am a bit
clueless as to what atm. Any suggestions would be most welcome.

Many thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Passing data back into forms

2009-02-20 Thread huw_at1

Hi,

I have an app which starts with a form. Following user input and
submission I generate another form as a table where results are rows
in the table and the number of results varies. Each row has a checkbox
so that the user can select rows to further process on submitting this
form. My question is how can I pass the data in the first form into
the second using a django form object. The reason I ask is that
currently selected rows are added to the URL string such that if the
user selects too many rows they will hit the length limit on the URL
string. I am trying to find ways around this and was hoping that by
passing the table as a form back into my views I will not encounter
this issue but I don't know how to do it. Any hints or tips on where
to go and read up on this would be greatfully appreciated.

Many thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: File Uploading

2009-02-12 Thread huw_at1

Yep I just found the thread about the enctype and indeed it was this
and not my comp catching fire!!! Many thanks :)

On Feb 12, 2:48 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Thu, Feb 12, 2009 at 9:38 AM, Karen Tracey <kmtra...@gmail.com> wrote:
> > On Thu, Feb 12, 2009 at 8:02 AM, huw_at1 <huwdjo...@gmail.com> wrote:
>
> >> Hi all,
>
> >> I am trying to write a simple app that allows a user to select a file
> >> (via the browse button) from which data can be read in and parsed. I
> >> have read several examples but none seem to do exactly what I want. I
> >> have built a form and so am trying to use forms.FileField(). I can add
> >> this field no problem to my form. However I am not sure I understand
> >> how I am supposed to pull the data contained within the file from
> >> within my views. I tried:
>
> >> 
> >> file = forms.FileField()
>
> >> 
>
> >> if request.FILES:
> >>   filename = request.FILES['file']
>
> >>   ...
>
> >> However I cant seem to get this to work. Does anyone have any good
> >> tutorials or can offer any suggestions?
>
> > Can't get it to work means what, exactly?  Your get an error message?  Your
> > filename variable winds up being set to to something you aren't expecting?
> > Your computer catches fire?
>
> > This page:
>
> >http://docs.djangoproject.com/en/dev/topics/http/file-uploads/
>
> > discusses handling uploaded files in some detail.  As described there,
> > request.FILES['file'] will be an UploadedFile object, so your assignment of
> > it to a variable named 'filename' rather sounds like you have misunderstood
> > something there, since request.FILES['file'] will be more than the file's
> > name, it will be an object with methods and attributes that (as detailed on
> > that page) that let you access the uploaded file's name, size, and data
> > (either in chunks or in one piece).  There's an example handle_uploaded_file
> > function that iterates through the data chunks and does something with
> > them.  Obviously it's not going to do exactly what you want to do with your
> > file data, but that page lays out a whole working structure and would seem
> > to be a good starting point for you to use in developing your specific
> > file-handling code.
>
> > Karen
>
> Remember to set the enctype on your form, this is something a lot of people
> forget.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



File Uploading

2009-02-12 Thread huw_at1

Hi all,

I am trying to write a simple app that allows a user to select a file
(via the browse button) from which data can be read in and parsed. I
have read several examples but none seem to do exactly what I want. I
have built a form and so am trying to use forms.FileField(). I can add
this field no problem to my form. However I am not sure I understand
how I am supposed to pull the data contained within the file from
within my views. I tried:


file = forms.FileField()



if request.FILES:
   filename = request.FILES['file']

   ...

However I cant seem to get this to work. Does anyone have any good
tutorials or can offer any suggestions?

Many thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Pagination of non-Django database

2008-11-26 Thread huw_at1

Ahh great - many thanks. I did wonder this but without better
documentation I could not be certain. I currently build a list from my
sql query so this should be no problem.

Much appreciated.

On Nov 26, 12:47 pm, Thomas Kerpe <[EMAIL PROTECTED]> wrote:
> Am 26.11.2008 13:19 Uhr, huw_at1 schrieb:> A small part of my framework 
> queries a non-Django db due to it being a
> > legacy db with primary keys already in use. My question is is there a
> > recognised way of applying pagination to non-Django db objects such
> > that I can paginate the sql select query on this database?
>
> I am not shure I had understand your question correct.
>
> The Django paginator works with lists/tuples, so all you have to do is
> either let your "other DB" act like a list/tuple, or build a small
> wrapper that allows the [from:to] syntax and a count() or __len__() method.
>
> If that don't work you can of course overload the Paginator itself. I
> have done this [1] for CouchDB which has not yet any compatible wrapper
> and uses a completely different approach as it is an document-oriented
> database. My code is more a hack but it works well.
>
> I would recommend to use the first approach if possible.
>
> This is only my opinion and is of course not in any way official.
>
> //Thomas
>
> [1]http://www.djangosnippets.org/snippets/1208/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Pagination of non-Django database

2008-11-26 Thread huw_at1

Hey all,

A small part of my framework queries a non-Django db due to it being a
legacy db with primary keys already in use. My question is is there a
recognised way of applying pagination to non-Django db objects such
that I can paginate the sql select query on this database?

Many thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache Segmentation Fault on succesful authentication

2008-11-20 Thread huw_at1

OK I'll give it a go when I get some time to try mod_wsgi. Thanks for
all the help regarding this matter.

On Nov 17, 10:30 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> Can you try building mod_wsgi instead and see if it picks up the
> correct library?
>
> If it doesn't work, post the output from running 'configure' script
> and running 'make' for mod_wsgi.
>
> I trust mod_wsgi build process more than I do mod_python.
>
> Graham
>
> On Nov 17, 9:04 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > ls -ltr /usr/local/lib/python2.5/config/libpython2.5.so
>
> > lrwxrwxrwx 1 root root 21 Nov 12 10:48 /usr/local/lib/python2.5/config/
> > libpython2.5.so -> ../../libpython2.5.so
>
> > ls -ltr /usr/local/lib
>
> > -r-xr-xr-x  1 root root  4806649 Nov 11 11:22 libpython2.5.a
> > -r-xr-xr-x  1 root root  4806649 Nov 12 12:49 libpython2.5.so.1.0
> > lrwxrwxrwx  1 root root       19 Nov 12 12:49 libpython2.5.so ->
> > libpython2.5.so.1.0
> > drwxr-xr-x 21 root root    20480 Nov 12 12:50 python2.5
>
> > ldd /usr/local/apache2/modules/mod_python.so
>
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2b2d9e698000)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x2b2d9e8b2000)
> >         libutil.so.1 => /lib64/libutil.so.1 (0x2b2d9eab6000)
> >         libm.so.6 => /lib64/libm.so.6 (0x2b2d9ecba000)
> >         libc.so.6 => /lib64/libc.so.6 (0x2b2d9ef3d000)
> >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > echo $LD_LIBRARY_PATH
>
> > /usr/local/lib
>
> > On Nov 14, 5:17 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > Did you do a 'ls -L' on the symlink to validate it pointed at
> > > something?
>
> > > The relative location of where the .so will be is more a hint as for
> > > different systems it may not be in same relative location.
>
> > > Graham
>
> > > On Nov 13, 10:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > My apologies. I forgot to mention that I already tried what was
> > > > suggested in the article you pointed me at. I created a symlink in /
> > > > usr/local/lib/python2.5/config as directed however recompiling
> > > > mod_python still links to the library statically. Unless I missed a
> > > > step in the article I am starting to wonder if mod_python just
> > > > includes this library statically by default. Still, thanks for all the
> > > > help so far. I really appreciate it.
>
> > > > On Nov 13, 9:55 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > Because you have created the symlink for the .so file so it appears
> > > > > next to the static library. It is arguably a a failing of standard
> > > > > Python installer that it doesn't do this. What to do is explained in
> > > > > document I previously pointed you at:
>
> > > > >  http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> > > > > Yes I know this is for mod_wsgi but same applies to mod_python.
>
> > > > > Graham
>
> > > > > On Nov 13, 8:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > > > ls -ltr /usr/local/lib
>
> > > > > > -r-xr-xr-x     1 root root  4806649 Nov 11 11:22 libpython2.5.a
> > > > > > -r-xr-xr-x     1 root root  4806649 Nov 12 12:49 libpython2.5.so.1.0
> > > > > > lrwxrwxrwx  1 root root            19 Nov 12 12:49 libpython2.5.so 
> > > > > > ->
> > > > > > libpython2.5.so.1.0
>
> > > > > > echo $LD_LIBRARY_PATH
>
> > > > > > /usr/local/lib
>
> > > > > > ldd /usr/local/bin/python
>
> > > > > >         libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
> > > > > > (0x2b6d8efc5000)
> > > > > >         libpthread.so.0 => /lib64/libpthread.so.0 
> > > > > > (0x0039a4a0)
> > > > > >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> > > > > >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> > > > > >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> > > > > >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> > > > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > > > > recompile mod_python and do ldd /usr/local/apache2/modules/
> > &

Re: Apache Segmentation Fault on succesful authentication

2008-11-17 Thread huw_at1

ls -ltr /usr/local/lib/python2.5/config/libpython2.5.so

lrwxrwxrwx 1 root root 21 Nov 12 10:48 /usr/local/lib/python2.5/config/
libpython2.5.so -> ../../libpython2.5.so

ls -ltr /usr/local/lib

-r-xr-xr-x  1 root root  4806649 Nov 11 11:22 libpython2.5.a
-r-xr-xr-x  1 root root  4806649 Nov 12 12:49 libpython2.5.so.1.0
lrwxrwxrwx  1 root root   19 Nov 12 12:49 libpython2.5.so ->
libpython2.5.so.1.0
drwxr-xr-x 21 root root20480 Nov 12 12:50 python2.5

ldd /usr/local/apache2/modules/mod_python.so

libpthread.so.0 => /lib64/libpthread.so.0 (0x2b2d9e698000)
libdl.so.2 => /lib64/libdl.so.2 (0x2b2d9e8b2000)
libutil.so.1 => /lib64/libutil.so.1 (0x2b2d9eab6000)
libm.so.6 => /lib64/libm.so.6 (0x2b2d9ecba000)
libc.so.6 => /lib64/libc.so.6 (0x2b2d9ef3d000)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)

echo $LD_LIBRARY_PATH

/usr/local/lib

On Nov 14, 5:17 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> Did you do a 'ls -L' on the symlink to validate it pointed at
> something?
>
> The relative location of where the .so will be is more a hint as for
> different systems it may not be in same relative location.
>
> Graham
>
> On Nov 13, 10:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > My apologies. I forgot to mention that I already tried what was
> > suggested in the article you pointed me at. I created a symlink in /
> > usr/local/lib/python2.5/config as directed however recompiling
> > mod_python still links to the library statically. Unless I missed a
> > step in the article I am starting to wonder if mod_python just
> > includes this library statically by default. Still, thanks for all the
> > help so far. I really appreciate it.
>
> > On Nov 13, 9:55 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > Because you have created the symlink for the .so file so it appears
> > > next to the static library. It is arguably a a failing of standard
> > > Python installer that it doesn't do this. What to do is explained in
> > > document I previously pointed you at:
>
> > >  http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> > > Yes I know this is for mod_wsgi but same applies to mod_python.
>
> > > Graham
>
> > > On Nov 13, 8:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > ls -ltr /usr/local/lib
>
> > > > -r-xr-xr-x     1 root root  4806649 Nov 11 11:22 libpython2.5.a
> > > > -r-xr-xr-x     1 root root  4806649 Nov 12 12:49 libpython2.5.so.1.0
> > > > lrwxrwxrwx  1 root root            19 Nov 12 12:49 libpython2.5.so ->
> > > > libpython2.5.so.1.0
>
> > > > echo $LD_LIBRARY_PATH
>
> > > > /usr/local/lib
>
> > > > ldd /usr/local/bin/python
>
> > > >         libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
> > > > (0x2b6d8efc5000)
> > > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
> > > >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> > > >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> > > >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> > > >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > > recompile mod_python and do ldd /usr/local/apache2/modules/
> > > > mod_python.so
>
> > > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2b74c34f7000)
> > > >         libdl.so.2 => /lib64/libdl.so.2 (0x2b74c3711000)
> > > >         libutil.so.1 => /lib64/libutil.so.1 (0x2b74c3915000)
> > > >         libm.so.6 => /lib64/libm.so.6 (0x2b74c3b19000)
> > > >         libc.so.6 => /lib64/libc.so.6 (0x2b74c3d9c000)
> > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > > I still don't get why the library is being compiled in statically.
>
> > > > On Nov 13, 12:11 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > On Nov 12, 11:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > > > echo '/usr/local/lib' >> /etc/ld.so.conf
>
> > > > > > more /etc/ld.so.conf
>
> > > > > > include ld.so.conf.d/*.conf
> > > > > > /usr/local/lib
>
> > > > > > ldd /usr/local/bin/python
>
> > > > > >         libpython2.5.so.1.0 => not found
> > > > > >

Re: Apache Segmentation Fault on succesful authentication

2008-11-13 Thread huw_at1

My apologies. I forgot to mention that I already tried what was
suggested in the article you pointed me at. I created a symlink in /
usr/local/lib/python2.5/config as directed however recompiling
mod_python still links to the library statically. Unless I missed a
step in the article I am starting to wonder if mod_python just
includes this library statically by default. Still, thanks for all the
help so far. I really appreciate it.

On Nov 13, 9:55 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> Because you have created the symlink for the .so file so it appears
> next to the static library. It is arguably a a failing of standard
> Python installer that it doesn't do this. What to do is explained in
> document I previously pointed you at:
>
>  http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> Yes I know this is for mod_wsgi but same applies to mod_python.
>
> Graham
>
> On Nov 13, 8:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > ls -ltr /usr/local/lib
>
> > -r-xr-xr-x     1 root root  4806649 Nov 11 11:22 libpython2.5.a
> > -r-xr-xr-x     1 root root  4806649 Nov 12 12:49 libpython2.5.so.1.0
> > lrwxrwxrwx  1 root root            19 Nov 12 12:49 libpython2.5.so ->
> > libpython2.5.so.1.0
>
> > echo $LD_LIBRARY_PATH
>
> > /usr/local/lib
>
> > ldd /usr/local/bin/python
>
> >         libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
> > (0x2b6d8efc5000)
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > recompile mod_python and do ldd /usr/local/apache2/modules/
> > mod_python.so
>
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2b74c34f7000)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x2b74c3711000)
> >         libutil.so.1 => /lib64/libutil.so.1 (0x2b74c3915000)
> >         libm.so.6 => /lib64/libm.so.6 (0x2b74c3b19000)
> >         libc.so.6 => /lib64/libc.so.6 (0x2b74c3d9c000)
> >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > I still don't get why the library is being compiled in statically.
>
> > On Nov 13, 12:11 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Nov 12, 11:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > echo '/usr/local/lib' >> /etc/ld.so.conf
>
> > > > more /etc/ld.so.conf
>
> > > > include ld.so.conf.d/*.conf
> > > > /usr/local/lib
>
> > > > ldd /usr/local/bin/python
>
> > > >         libpython2.5.so.1.0 => not found
> > > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
> > > >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> > > >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> > > >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> > > >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > Where is libpython2.5.so installed? What are the permissions on it?
>
> > > What do you get for:
>
> > >   echo $LD_LIBRARY_PATH
>
> > > just prior to running 'ld'?
>
> > > Graham
>
> > > > On Nov 12, 11:57 am, marco ghidinelli <[EMAIL PROTECTED]> wrote:
>
> > > > > On Wed, Nov 12, 2008 at 03:22:02AM -0800, huw_at1 wrote:
>
> > > > > > An update on this.
>
> > > > > > 'which python' returns:
>
> > > > > >         libpython2.5.so.1.0 => not found
> > > > > >         libpthread.so.0 => /lib64/libpthread.so.0 
> > > > > > (0x0039a4a0)
> > > > > >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> > > > > >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> > > > > >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> > > > > >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> > > > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > > > > This explains why I cannot compile mod_python without first setting
> > > > > > the LD_LIBRARY_PAT

Re: Apache Segmentation Fault on succesful authentication

2008-11-13 Thread huw_at1

ls -ltr /usr/local/lib

-r-xr-xr-x 1 root root  4806649 Nov 11 11:22 libpython2.5.a
-r-xr-xr-x 1 root root  4806649 Nov 12 12:49 libpython2.5.so.1.0
lrwxrwxrwx  1 root root19 Nov 12 12:49 libpython2.5.so ->
libpython2.5.so.1.0

echo $LD_LIBRARY_PATH

/usr/local/lib

ldd /usr/local/bin/python

libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
(0x2b6d8efc5000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
libm.so.6 => /lib64/libm.so.6 (0x0039a420)
libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)

recompile mod_python and do ldd /usr/local/apache2/modules/
mod_python.so

libpthread.so.0 => /lib64/libpthread.so.0 (0x2b74c34f7000)
libdl.so.2 => /lib64/libdl.so.2 (0x2b74c3711000)
libutil.so.1 => /lib64/libutil.so.1 (0x2b74c3915000)
libm.so.6 => /lib64/libm.so.6 (0x2b74c3b19000)
libc.so.6 => /lib64/libc.so.6 (0x2b74c3d9c000)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)

I still don't get why the library is being compiled in statically.

On Nov 13, 12:11 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 12, 11:44 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
>
>
> > echo '/usr/local/lib' >> /etc/ld.so.conf
>
> > more /etc/ld.so.conf
>
> > include ld.so.conf.d/*.conf
> > /usr/local/lib
>
> > ldd /usr/local/bin/python
>
> >         libpython2.5.so.1.0 => not found
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> Where is libpython2.5.so installed? What are the permissions on it?
>
> What do you get for:
>
>   echo $LD_LIBRARY_PATH
>
> just prior to running 'ld'?
>
> Graham
>
> > On Nov 12, 11:57 am, marco ghidinelli <[EMAIL PROTECTED]> wrote:
>
> > > On Wed, Nov 12, 2008 at 03:22:02AM -0800, huw_at1 wrote:
>
> > > > An update on this.
>
> > > > 'which python' returns:
>
> > > >         libpython2.5.so.1.0 => not found
> > > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
> > > >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> > > >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> > > >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> > > >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > > This explains why I cannot compile mod_python without first setting
> > > > the LD_LIBRARY_PATH to '/usr/local/lib'. I don't know if this is the
> > > > reason why the mod_python compilation continuously compiles with the
> > > > python library as static. I upgraded my apache to the latest version
> > > > however I still am getting segmentation faults on user authentication.
> > > > Which potentially suggests that the problem is not apache and is
> > > > something else like this issue.
>
> > > echo '/usr/local/lib' >> /etc/ld.so.conf
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache Segmentation Fault on succesful authentication

2008-11-12 Thread huw_at1

echo '/usr/local/lib' >> /etc/ld.so.conf

more /etc/ld.so.conf

include ld.so.conf.d/*.conf
/usr/local/lib

ldd /usr/local/bin/python

libpython2.5.so.1.0 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
libm.so.6 => /lib64/libm.so.6 (0x0039a420)
libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)


On Nov 12, 11:57 am, marco ghidinelli <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 12, 2008 at 03:22:02AM -0800, huw_at1 wrote:
>
> > An update on this.
>
> > 'which python' returns:
>
> >         libpython2.5.so.1.0 => not found
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
> >         libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
> >         libm.so.6 => /lib64/libm.so.6 (0x0039a420)
> >         libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
> >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > This explains why I cannot compile mod_python without first setting
> > the LD_LIBRARY_PATH to '/usr/local/lib'. I don't know if this is the
> > reason why the mod_python compilation continuously compiles with the
> > python library as static. I upgraded my apache to the latest version
> > however I still am getting segmentation faults on user authentication.
> > Which potentially suggests that the problem is not apache and is
> > something else like this issue.
>
> echo '/usr/local/lib' >> /etc/ld.so.conf
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache Segmentation Fault on succesful authentication

2008-11-12 Thread huw_at1

An update on this.

'which python' returns:

libpython2.5.so.1.0 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x0039a4a0)
libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
libutil.so.1 => /lib64/libutil.so.1 (0x0039b340)
libm.so.6 => /lib64/libm.so.6 (0x0039a420)
libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)

This explains why I cannot compile mod_python without first setting
the LD_LIBRARY_PATH to '/usr/local/lib'. I don't know if this is the
reason why the mod_python compilation continuously compiles with the
python library as static. I upgraded my apache to the latest version
however I still am getting segmentation faults on user authentication.
Which potentially suggests that the problem is not apache and is
something else like this issue.

On Nov 11, 10:54 am, huw_at1 <[EMAIL PROTECTED]> wrote:
> I'm having difficulty getting the mod_python.so to link dynamically.
> I'm trying to compile the python interpreter with the "--enable-
> shared" and compiling mod_python with the "--with-python" flags.
> However the "ldd" always shows the mod_python.so as not dynamically
> linking to the python libraries.
>
> On Nov 11, 12:44 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Nov 10, 8:53 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > Hi Graham and thanks for the response again.
>
> > > I seem to remember when I originally built this 64-bit mod_python
> > > module I had a lot of difficulty. I was getting error messages which I
> > > solved by following the solution in this article:
>
> > >http://agiletesting.blogspot.com/2007_10_01_archive.html
>
> > > Although I didn't fully understand what I was doing, the instructions
> > > fixed the issue I was having. I'm hoping that as a result this is a 64-
> > > bit issue which I can get around when I move to a 32-bit production
> > > server.
>
> > Solve the static vs shared library issue for mod_python first and then
> > we can see.
>
> > > I have never tried nor heard of mod_wsgi. Is this just a new
> > > replacement for mod_python which I can run Django and other python web
> > > apps through? Are there any changes I need to make to them if I
> > > implement this module?
>
> > No changes required to Django user application code. Just how you
> > configure Apache and how you need to use a WSGI script file as bridge
> > to Django application is different.
>
> > The mod_wsgi module isn't a replacement for mod_python as mod_wsgi
> > only supports Python web application supporting WSGI interface, as
> > nearly all do these days. The mod_python module provides its own
> > framework for developing web applications as well.
>
> > Graham
>
> > > Many thanks
>
> > > Huw
>
> > > On Nov 8, 10:05 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > On Nov 7, 10:29 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > > Graham thanks,
>
> > > > > First of all here is my httpd.conf file modules:
>
> > > > > # Example:
> > > > > # LoadModule foo_module modules/mod_foo.so
> > > > > #
>
> > > > > LoadModule python_module modules/mod_python.so
> > > > > #LoadModule dav_svn_module     modules/mod_dav_svn.so
> > > > > #LoadModule authz_svn_module   modules/mod_authz_svn.so
>
> > > > > 
> > > > > 
> > > > > #
>
> > > > > So as you can see the only module I am actually using is the
> > > > > mod_python one. 'httpd -l' reveals:
>
> > > > >   core.c
> > > > >   mod_authn_file.c
> > > > >   mod_authn_default.c
> > > > >   mod_authz_host.c
> > > > >   mod_authz_groupfile.c
> > > > >   mod_authz_user.c
> > > > >   mod_authz_default.c
> > > > >   mod_auth_basic.c
> > > > >   mod_include.c
> > > > >   mod_filter.c
> > > > >   mod_log_config.c
> > > > >   mod_env.c
> > > > >   mod_setenvif.c
> > > > >   prefork.c
> > > > >   http_core.c
> > > > >   mod_mime.c
> > > > >   mod_status.c
> > > > >   mod_autoindex.c
> > > > >   mod_asis.c
> > > > >   mod_cgi.c
> > > > >   mod_negotiation.c
> > > > >   mod_dir.c
> >

Re: Apache Segmentation Fault on succesful authentication

2008-11-11 Thread huw_at1

I'm having difficulty getting the mod_python.so to link dynamically.
I'm trying to compile the python interpreter with the "--enable-
shared" and compiling mod_python with the "--with-python" flags.
However the "ldd" always shows the mod_python.so as not dynamically
linking to the python libraries.

On Nov 11, 12:44 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 10, 8:53 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > Hi Graham and thanks for the response again.
>
> > I seem to remember when I originally built this 64-bit mod_python
> > module I had a lot of difficulty. I was getting error messages which I
> > solved by following the solution in this article:
>
> >http://agiletesting.blogspot.com/2007_10_01_archive.html
>
> > Although I didn't fully understand what I was doing, the instructions
> > fixed the issue I was having. I'm hoping that as a result this is a 64-
> > bit issue which I can get around when I move to a 32-bit production
> > server.
>
> Solve the static vs shared library issue for mod_python first and then
> we can see.
>
> > I have never tried nor heard of mod_wsgi. Is this just a new
> > replacement for mod_python which I can run Django and other python web
> > apps through? Are there any changes I need to make to them if I
> > implement this module?
>
> No changes required to Django user application code. Just how you
> configure Apache and how you need to use a WSGI script file as bridge
> to Django application is different.
>
> The mod_wsgi module isn't a replacement for mod_python as mod_wsgi
> only supports Python web application supporting WSGI interface, as
> nearly all do these days. The mod_python module provides its own
> framework for developing web applications as well.
>
> Graham
>
> > Many thanks
>
> > Huw
>
> > On Nov 8, 10:05 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Nov 7, 10:29 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > > Graham thanks,
>
> > > > First of all here is my httpd.conf file modules:
>
> > > > # Example:
> > > > # LoadModule foo_module modules/mod_foo.so
> > > > #
>
> > > > LoadModule python_module modules/mod_python.so
> > > > #LoadModule dav_svn_module     modules/mod_dav_svn.so
> > > > #LoadModule authz_svn_module   modules/mod_authz_svn.so
>
> > > > 
> > > > 
> > > > #
>
> > > > So as you can see the only module I am actually using is the
> > > > mod_python one. 'httpd -l' reveals:
>
> > > >   core.c
> > > >   mod_authn_file.c
> > > >   mod_authn_default.c
> > > >   mod_authz_host.c
> > > >   mod_authz_groupfile.c
> > > >   mod_authz_user.c
> > > >   mod_authz_default.c
> > > >   mod_auth_basic.c
> > > >   mod_include.c
> > > >   mod_filter.c
> > > >   mod_log_config.c
> > > >   mod_env.c
> > > >   mod_setenvif.c
> > > >   prefork.c
> > > >   http_core.c
> > > >   mod_mime.c
> > > >   mod_status.c
> > > >   mod_autoindex.c
> > > >   mod_asis.c
> > > >   mod_cgi.c
> > > >   mod_negotiation.c
> > > >   mod_dir.c
> > > >   mod_actions.c
> > > >   mod_userdir.c
> > > >   mod_alias.c
> > > >   mod_so.c
>
> > > > Running ldd on mod_python reveals:
>
> > > > /usr/local/apache2/modules/mod_python.so:
> > > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2af216d13000)
> > > >         libdl.so.2 => /lib64/libdl.so.2 (0x2af216f2d000)
> > > >         libutil.so.1 => /lib64/libutil.so.1 (0x2af217131000)
> > > >         libm.so.6 => /lib64/libm.so.6 (0x2af217335000)
> > > >         libc.so.6 => /lib64/libc.so.6 (0x2af2175b8000)
> > > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > > The mod_python module isn't linking to shared Python library but has
> > > linked it statically. This can cause problems, see below.
>
> > > > and on the python ldap module:
>
> > > > /usr/local/lib/python2.5/site-packages/python_ldap-2.3.5-py2.5-linux-
> > > > x86_64.egg/_ldap.so
> > > >         libldap_r-2.3.so.0 => /usr/lib64/libldap_r-2.3.so.0
> > > > (0x2aad1567e000)
> > > >         liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0
> > > > (0x2aad158c7000)
&g

Re: Apache Segmentation Fault on succesful authentication

2008-11-10 Thread huw_at1

Some more info. Apache also segfaults when I succesfully sign in to
the admin site.

On Nov 10, 9:53 am, huw_at1 <[EMAIL PROTECTED]> wrote:
> Hi Graham and thanks for the response again.
>
> I seem to remember when I originally built this 64-bit mod_python
> module I had a lot of difficulty. I was getting error messages which I
> solved by following the solution in this article:
>
> http://agiletesting.blogspot.com/2007_10_01_archive.html
>
> Although I didn't fully understand what I was doing, the instructions
> fixed the issue I was having. I'm hoping that as a result this is a 64-
> bit issue which I can get around when I move to a 32-bit production
> server.
>
> I have never tried nor heard of mod_wsgi. Is this just a new
> replacement for mod_python which I can run Django and other python web
> apps through? Are there any changes I need to make to them if I
> implement this module?
>
> Many thanks
>
> Huw
>
> On Nov 8, 10:05 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Nov 7, 10:29 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
> > > Graham thanks,
>
> > > First of all here is my httpd.conf file modules:
>
> > > # Example:
> > > # LoadModule foo_module modules/mod_foo.so
> > > #
>
> > > LoadModule python_module modules/mod_python.so
> > > #LoadModule dav_svn_module     modules/mod_dav_svn.so
> > > #LoadModule authz_svn_module   modules/mod_authz_svn.so
>
> > > 
> > > 
> > > #
>
> > > So as you can see the only module I am actually using is the
> > > mod_python one. 'httpd -l' reveals:
>
> > >   core.c
> > >   mod_authn_file.c
> > >   mod_authn_default.c
> > >   mod_authz_host.c
> > >   mod_authz_groupfile.c
> > >   mod_authz_user.c
> > >   mod_authz_default.c
> > >   mod_auth_basic.c
> > >   mod_include.c
> > >   mod_filter.c
> > >   mod_log_config.c
> > >   mod_env.c
> > >   mod_setenvif.c
> > >   prefork.c
> > >   http_core.c
> > >   mod_mime.c
> > >   mod_status.c
> > >   mod_autoindex.c
> > >   mod_asis.c
> > >   mod_cgi.c
> > >   mod_negotiation.c
> > >   mod_dir.c
> > >   mod_actions.c
> > >   mod_userdir.c
> > >   mod_alias.c
> > >   mod_so.c
>
> > > Running ldd on mod_python reveals:
>
> > > /usr/local/apache2/modules/mod_python.so:
> > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2af216d13000)
> > >         libdl.so.2 => /lib64/libdl.so.2 (0x2af216f2d000)
> > >         libutil.so.1 => /lib64/libutil.so.1 (0x2af217131000)
> > >         libm.so.6 => /lib64/libm.so.6 (0x2af217335000)
> > >         libc.so.6 => /lib64/libc.so.6 (0x2af2175b8000)
> > >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> > The mod_python module isn't linking to shared Python library but has
> > linked it statically. This can cause problems, see below.
>
> > > and on the python ldap module:
>
> > > /usr/local/lib/python2.5/site-packages/python_ldap-2.3.5-py2.5-linux-
> > > x86_64.egg/_ldap.so
> > >         libldap_r-2.3.so.0 => /usr/lib64/libldap_r-2.3.so.0
> > > (0x2aad1567e000)
> > >         liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0
> > > (0x2aad158c7000)
> > >         libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x2aad15ad5000)
> > >         libssl.so.6 => /lib64/libssl.so.6 (0x2aad15cef000)
> > >         libcrypto.so.6 => /lib64/libcrypto.so.6 (0x2aad15f38000)
> > >         libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
> > > (0x2aad1628)
>
> > The ldap module is link Python shared library.
>
> > That mod_python.so has embedded static module and you can shared being
> > linked in here can cause crashes.
>
> > Haven't seen this variation of problem before, but see:
>
> >http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> > This describes issues with use of static and shared library for Python
> > at same time when using mod_python and mod_wsgi together.
>
> > In short, rebuild mod_python so it uses shared Python library instead.
>
> > Maybe also consider using mod_wsgi as well. It will not solve the
> > problem, but arguable better solution these days. :-)
>
> > Graham
>
> > >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2aad165ef000)
> > >         libc.so.6 => /lib64/libc.so.6 (0x2aa

Re: Apache Segmentation Fault on succesful authentication

2008-11-10 Thread huw_at1

Hi Graham and thanks for the response again.

I seem to remember when I originally built this 64-bit mod_python
module I had a lot of difficulty. I was getting error messages which I
solved by following the solution in this article:

http://agiletesting.blogspot.com/2007_10_01_archive.html

Although I didn't fully understand what I was doing, the instructions
fixed the issue I was having. I'm hoping that as a result this is a 64-
bit issue which I can get around when I move to a 32-bit production
server.

I have never tried nor heard of mod_wsgi. Is this just a new
replacement for mod_python which I can run Django and other python web
apps through? Are there any changes I need to make to them if I
implement this module?

Many thanks

Huw

On Nov 8, 10:05 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 7, 10:29 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Graham thanks,
>
> > First of all here is my httpd.conf file modules:
>
> > # Example:
> > # LoadModule foo_module modules/mod_foo.so
> > #
>
> > LoadModule python_module modules/mod_python.so
> > #LoadModule dav_svn_module     modules/mod_dav_svn.so
> > #LoadModule authz_svn_module   modules/mod_authz_svn.so
>
> > 
> > 
> > #
>
> > So as you can see the only module I am actually using is the
> > mod_python one. 'httpd -l' reveals:
>
> >   core.c
> >   mod_authn_file.c
> >   mod_authn_default.c
> >   mod_authz_host.c
> >   mod_authz_groupfile.c
> >   mod_authz_user.c
> >   mod_authz_default.c
> >   mod_auth_basic.c
> >   mod_include.c
> >   mod_filter.c
> >   mod_log_config.c
> >   mod_env.c
> >   mod_setenvif.c
> >   prefork.c
> >   http_core.c
> >   mod_mime.c
> >   mod_status.c
> >   mod_autoindex.c
> >   mod_asis.c
> >   mod_cgi.c
> >   mod_negotiation.c
> >   mod_dir.c
> >   mod_actions.c
> >   mod_userdir.c
> >   mod_alias.c
> >   mod_so.c
>
> > Running ldd on mod_python reveals:
>
> > /usr/local/apache2/modules/mod_python.so:
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2af216d13000)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x2af216f2d000)
> >         libutil.so.1 => /lib64/libutil.so.1 (0x2af217131000)
> >         libm.so.6 => /lib64/libm.so.6 (0x2af217335000)
> >         libc.so.6 => /lib64/libc.so.6 (0x2af2175b8000)
> >         /lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
>
> The mod_python module isn't linking to shared Python library but has
> linked it statically. This can cause problems, see below.
>
> > and on the python ldap module:
>
> > /usr/local/lib/python2.5/site-packages/python_ldap-2.3.5-py2.5-linux-
> > x86_64.egg/_ldap.so
> >         libldap_r-2.3.so.0 => /usr/lib64/libldap_r-2.3.so.0
> > (0x2aad1567e000)
> >         liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0
> > (0x2aad158c7000)
> >         libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x2aad15ad5000)
> >         libssl.so.6 => /lib64/libssl.so.6 (0x2aad15cef000)
> >         libcrypto.so.6 => /lib64/libcrypto.so.6 (0x2aad15f38000)
> >         libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
> > (0x2aad1628)
>
> The ldap module is link Python shared library.
>
> That mod_python.so has embedded static module and you can shared being
> linked in here can cause crashes.
>
> Haven't seen this variation of problem before, but see:
>
> http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> This describes issues with use of static and shared library for Python
> at same time when using mod_python and mod_wsgi together.
>
> In short, rebuild mod_python so it uses shared Python library instead.
>
> Maybe also consider using mod_wsgi as well. It will not solve the
> problem, but arguable better solution these days. :-)
>
> Graham
>
> >         libpthread.so.0 => /lib64/libpthread.so.0 (0x2aad165ef000)
> >         libc.so.6 => /lib64/libc.so.6 (0x2aad16809000)
> >         libresolv.so.2 => /lib64/libresolv.so.2 (0x2aad16b5c000)
> >         libdl.so.2 => /lib64/libdl.so.2 (0x2aad16d72000)
> >         libcrypt.so.1 => /lib64/libcrypt.so.1 (0x2aad16f76000)
> >         libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2
> > (0x2aad171ae000)
> >         libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x2aad173dd000)
> >         libcom_err.so.2 => /lib64/libcom_err.so.2 (0x2aad1767)
> >         libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3
> > (0x2aad17872000)
&g

Re: Apache Segmentation Fault on succesful authentication

2008-11-07 Thread huw_at1

Graham thanks,

First of all here is my httpd.conf file modules:

# Example:
# LoadModule foo_module modules/mod_foo.so
#

LoadModule python_module modules/mod_python.so
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module   modules/mod_authz_svn.so



#

So as you can see the only module I am actually using is the
mod_python one. 'httpd -l' reveals:

  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

Running ldd on mod_python reveals:

/usr/local/apache2/modules/mod_python.so:
libpthread.so.0 => /lib64/libpthread.so.0 (0x2af216d13000)
libdl.so.2 => /lib64/libdl.so.2 (0x2af216f2d000)
libutil.so.1 => /lib64/libutil.so.1 (0x2af217131000)
libm.so.6 => /lib64/libm.so.6 (0x2af217335000)
libc.so.6 => /lib64/libc.so.6 (0x2af2175b8000)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)

and on the python ldap module:

/usr/local/lib/python2.5/site-packages/python_ldap-2.3.5-py2.5-linux-
x86_64.egg/_ldap.so
libldap_r-2.3.so.0 => /usr/lib64/libldap_r-2.3.so.0
(0x2aad1567e000)
liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0
(0x2aad158c7000)
libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x2aad15ad5000)
libssl.so.6 => /lib64/libssl.so.6 (0x2aad15cef000)
libcrypto.so.6 => /lib64/libcrypto.so.6 (0x2aad15f38000)
libpython2.5.so.1.0 => /usr/local/lib/libpython2.5.so.1.0
(0x2aad1628)
libpthread.so.0 => /lib64/libpthread.so.0 (0x2aad165ef000)
libc.so.6 => /lib64/libc.so.6 (0x2aad16809000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x2aad16b5c000)
libdl.so.2 => /lib64/libdl.so.2 (0x2aad16d72000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x2aad16f76000)
libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2
(0x2aad171ae000)
libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x2aad173dd000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x2aad1767)
libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3
(0x2aad17872000)
libz.so.1 => /usr/lib64/libz.so.1 (0x2aad17a98000)
libutil.so.1 => /lib64/libutil.so.1 (0x2aad17cac000)
libm.so.6 => /lib64/libm.so.6 (0x2aad17eaf000)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0
(0x2aad18133000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1
(0x2aad1833b000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x2aad1853e000)
libsepol.so.1 => /lib64/libsepol.so.1 (0x2aad18756000)

and:

/usr/lib64/libldap.so:
liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0
(0x0039ad40)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0039ae80)
libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x0035dd20)
libssl.so.6 => /lib64/libssl.so.6 (0x003b6960)
libcrypto.so.6 => /lib64/libcrypto.so.6 (0x0039a380)
libc.so.6 => /lib64/libc.so.6 (0x0039a3e0)
libdl.so.2 => /lib64/libdl.so.2 (0x0039a460)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0035daa0)
libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2
(0x003b68a0)
libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x003b68e0)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0039ad80)
libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3
(0x003b6860)
libz.so.1 => /usr/lib64/libz.so.1 (0x0039a4e0)
/lib64/ld-linux-x86-64.so.2 (0x0039a2c0)
libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0
(0x003b6920)
libkeyutils.so.1 => /lib64/libkeyutils.so.1
(0x0039af80)
libselinux.so.1 => /lib64/libselinux.so.1 (0x0039a340)
libsepol.so.1 => /lib64/libsepol.so.1 (0x0039a300)

To me everything matches up. I have had a few other suggestions such
as using strace. This however has so much detail in it is difficult to
trace anything in a multi-thread/child environment. I have also had
suggested mod_backtrace and mod_whatkilledus however these require
recompiling my apache server which is something I am loathed to do as
it is something I have never done before and am worried I will lose my
setup if I do this. So I guess I am open to suggestions as I am trying
to weigh up my options.


On Nov 6, 10:33 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On

Re: Apache Segmentation Fault on succesful authentication

2008-11-06 Thread huw_at1

I tried running a strace on apache for this but I am still no wiser?
Anyone?

On Nov 6, 3:38 pm, huw_at1 <[EMAIL PROTECTED]> wrote:
> Hi all. I am having some real problems with this. I have an LDAP
> authentication backend that I have hooked up to my app. Standalone it
> appears to run fine. However when running it through my apache server
> I am seeing alot ofsegmentationfaults in my error log coupled with
> the redirection page not loading on succesful authentication.
>
> I have googled around a bit and seen a few other threads with LDAP
> authentication and apache segementation faults. However none of them
> seem to be quite the same issue that I am experiencing. The only thing
> I have managed to garner thus far is that there may be a version
> mismatch betweem the openldap libraries used to compile apache with
> and those used to compile the python-ldap module.
>
> If anyone has any ideas about this or, miraculously, has a solution I
> would be most grateful.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Apache Segmentation Fault on succesful authentication

2008-11-06 Thread huw_at1

Hi all. I am having some real problems with this. I have an LDAP
authentication backend that I have hooked up to my app. Standalone it
appears to run fine. However when running it through my apache server
I am seeing alot of segmentation faults in my error log coupled with
the redirection page not loading on succesful authentication.

I have googled around a bit and seen a few other threads with LDAP
authentication and apache segementation faults. However none of them
seem to be quite the same issue that I am experiencing. The only thing
I have managed to garner thus far is that there may be a version
mismatch betweem the openldap libraries used to compile apache with
and those used to compile the python-ldap module.

If anyone has any ideas about this or, miraculously, has a solution I
would be most grateful.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Legacy databases

2008-10-16 Thread huw_at1

Hi,

I want to use Django to query two legacy Oracle databases.

>From what I have read Django can handle legacy databases provided the
primary key is an auto-incremented integer field in the tables of the
databases.

Does Django work in such a way that it will take these databases and
rebuild them in its own format in a seperate table or can I get it to
access the original tables? Such as with foreign keys? My main concern
is that I don't want to corrupt/change the legacy databases in anyway
since they are used by other applications as well.

This is not clear to me from what I have read so far so any tips or
pointers would be most gratefully received.

Many thanks

Huw Jones
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 404 not found for media files

2008-10-13 Thread huw_at1

Hi Erik,

Ok this did something now. Instead of a 404 page not found on server
message I am getting a "403 Forbidden" "You don't have permission to
access /media/test.js" on this server. I have checked my file and
directory permissions which all seem fine all the way thorugh /var/www/
django_projects/proj_name/media. Any suggestions? If not, many thanks
for all your help anyway.

Huw

On Oct 13, 11:35 am, Erik Allik <[EMAIL PROTECTED]> wrote:
> Just use RequestContext instead of Context when passing context to  
> templates to be rendered.
>
> Like:
>
> return render_to_response("my_app/my_template.html", {"some_var":  
> "foo"},
>                             context_instance=RequestContext(request))
>
> or:
>
> return render_to_response("my_app/my_template.html",  
> RequestContext(request, {"some_var": "foo"})
>
> And yes, Alias is the way to go in Apache configuration. Probably  
> mod_rewrite would work, too.
>
> Erik
>
> On 13.10.2008, at 13:20, huw_at1 wrote:
>
>
>
> > Hi Erik,
>
> > Many thanks for your reply. This is somewhat more complicate dthan I
> > had hoped. Does this mean I am going about this the wrong way and that
> > there is a simpler way? If not then is Alias a command I use from
> > within the apache conf file? Also how do I check if I have the request
> > context processor activated and also do I need to pass the MEDIA_URL
> > value into the template from the views/urls?
>
> > Many thanks again
>
> > Huw
>
> > On Oct 13, 10:54 am, Erik Allik <[EMAIL PROTECTED]> wrote:
> >> First of all, you should set MEDIA_URL to '/media/' and Alias /media
> >> as /var/www/django_projects/proj_name/media/ or use mod_rewrite. Then
> >> you should instead request for {{ MEDIA_URL }}test.js not the
> >> hardcoded /media/test.js. This requires that you have request context
> >> processor activated and MEDIA_URL is available in the template  
> >> context.
>
> >> Erik
>
> >> On 13.10.2008, at 12:34, huw_at1 wrote:
>
> >>> Hi there. I have a website running out of django on my apache/
> >>> mod_python web server. When trying to link javascript to my  
> >>> templates
> >>> such as:
>
> >>> 

Re: 404 not found for media files

2008-10-13 Thread huw_at1

Hi Erik,

Many thanks for your reply. This is somewhat more complicate dthan I
had hoped. Does this mean I am going about this the wrong way and that
there is a simpler way? If not then is Alias a command I use from
within the apache conf file? Also how do I check if I have the request
context processor activated and also do I need to pass the MEDIA_URL
value into the template from the views/urls?

Many thanks again

Huw

On Oct 13, 10:54 am, Erik Allik <[EMAIL PROTECTED]> wrote:
> First of all, you should set MEDIA_URL to '/media/' and Alias /media  
> as /var/www/django_projects/proj_name/media/ or use mod_rewrite. Then  
> you should instead request for {{ MEDIA_URL }}test.js not the  
> hardcoded /media/test.js. This requires that you have request context  
> processor activated and MEDIA_URL is available in the template context.
>
> Erik
>
> On 13.10.2008, at 12:34, huw_at1 wrote:
>
>
>
> > Hi there. I have a website running out of django on my apache/
> > mod_python web server. When trying to link javascript to my templates
> > such as:
>
> > 

404 not found for media files

2008-10-13 Thread huw_at1

Hi there. I have a website running out of django on my apache/
mod_python web server. When trying to link javascript to my templates
such as: