Re: mod_wsgi+apache2.2+django1+WindowsXP: can't serve images

2009-02-16 Thread Angel Cruz
Thank you Graham!  All of my reference materials, including the Django book
I am currently reading (mod_wsgi was toward the end of the book and I should
have looked there first :>) ), has the "Alias" directive.  Why I typed Match
in there, I am now at a lost :>)
Off I gothank you again!

On Sun, Feb 15, 2009 at 4:11 PM, Graham Dumpleton <
graham.dumple...@gmail.com> wrote:

>
>
>
> On Feb 16, 10:19 am, MrBodjangles  wrote:
> > I am going thru the sample blog application introduced in the book
> > "Python Web Development with Django (covers Django 1.0)".
> >
> > Before getting too deep into the book, I decided I wanted to first
> > ensure that the application will render in apache since I want to
> > include an image at the bottom of the blog posts (I have been hacking
> > spaghetti code in php for a couple of years now, but now, am intent on
> > coding neatly with python).
> >
> > The blog application works partially in that apache renders the text
> > contents, but not the image.
> >
> > Note the access.log contents in the end ( "GET /media/img/
> > people_rose.jpg HTTP/1.1" 404 2001)
> >
> > I have read so much good stuff about Django that I want to dive into
> > it full speed ahead, but now I am stuck in serving a simple image.
> >
> > Help?
> >
> > --
> > httpd.conf:
> > ===
> > .
> > .
> > .
> > 
> > # I will put this later in a separe conf file
> > ###
> > # This did not work ==>>>  AliasMatch ^/([^/]+)/media/(.*) "c:/my_wsgi/
> > media"
> > #
> > # trying AliasMatch below...still does not work :>(
> > #
> >
> > AliasMatch ^media/(.*) "c:/my_wsgi/media/"
>
> Use Alias directive, not AliasMatch, as described in mod_wsgi
> documentation. See:
>
>  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> Perform direct URL accesses against stuff in media directory to
> ascertain if working or not.
>
> > 
> > Order allow,deny
> > Options Indexes
> > Allow from all
> > IndexOptions FancyIndexing
> > 
> >
> > WSGIScriptAliasMatch ^/([^/]+) "c:/my_wsgi/apache/django.wsgi"
>
> Again, read the documentation. Do not use WSGIScriptAliasMatch, use
> WSGIScriptAlias.
>
> Why are you using the Match variants? Where did you get the idea you
> had to do that?
>
> Try what is in the documentation instead.
>
> Graham
>
> > 
> > Order deny,allow
> > Allow from all
> > 
> > 
> >
> > #
> > # DirectoryIndex: sets the file that Apache will serve if a directory
> > # is requested.
> > .
> > .
> > .
> >
> > 
> > django.wsgi:
> > 
> > import os, sys
> >
> > #Calculate the path based on the location of the WSGI script.
> > apache_configuration= os.path.dirname(__file__)
> > project = os.path.dirname(apache_configuration)
> > workspace = os.path.dirname(project)
> >
> > sys.path.append(workspace)
> > sys.path.append('c:\\my_wsgi')
> >
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'blog.settings'
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
> >
> > 
> > settings.py:
> > 
> > .
> > .
> > .
> > # Absolute path to the directory that holds media.
> > # Example: "/home/media/media.lawrence.com/"
> > MEDIA_ROOT = ''
> >
> > # URL that handles the media served from MEDIA_ROOT. Make sure to use
> > a
> > # trailing slash if there is a path component (optional in other
> > cases).
> > # Examples: "http://media.lawrence.com";, "http://example.com/media/";
> > MEDIA_URL = ''
> >
> > # URL prefix for admin media -- CSS, JavaScript and images. Make sure
> > to use a
> > # trailing slash.
> > # Examples: "http://foo.com/media/";, "/media/".
> > ADMIN_MEDIA_PREFIX = '/media/'
> > .
> > .
> > .
> >
> > 
> > base.html (lives in c:\my_wsgi\blog\templates):
> > ==
> > .
> > .
> > .
> > 
> > {%block content %}
> > {%endblock%}
> >
> >  
> >  > height="848"> 
> > .
> > .
> > .
> >
> > -
> > access.log:
> > =
> > 127.0.0.1 - - [15/Feb/2009:15:05:41 -0800] "GET /blog/v_blog/ HTTP/
> > 1.1" 200 565
> > 127.0.0.1 - - [15/Feb/2009:15:05:43 -0800] "GET /media/img/
> > people_rose.jpg HTTP/1.1" 404 2001
> > 127.0.0.1 - - [15/Feb/2009:15:05:44 -0800] "GET /favicon.ico HTTP/1.1"
> > 404 1944
> >
>

--~--~-~--~~~---~--~~
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: sql query for manytomany table

2009-02-18 Thread Angel Cruz
this off topic, but i am saving these postings in my gmail.  The problem
with putting  your code in dpaste is that in 29 days, that link is invalid,
and when I look upon this thread in the future, I will have no idea what
your source looks like and what the possible solutions are.

dpaste looks cool, but may be a bad idea to use here?

On Wed, Feb 18, 2009 at 11:48 AM, May  wrote:

>
> The complete view is here:
>
> http://dpaste.com/17/
>
> On Feb 18, 11:46 am, May  wrote:
> > Hello Karen,
> >
> > Here are my views and models:
> >
> > http://dpaste.com/122204/
> >
> > http://dpaste.com/14/
> >
> > The manytomany table is actually a tertiary table.  I was just trying
> > to use django terms, so people would understand what type of table.
> >
> > Thanks for your help!
> >
> > May
> >
> > On Feb 18, 11:33 am, Karen Tracey  wrote:
> >
> > > On Wed, Feb 18, 2009 at 1:43 PM, May  wrote:
> >
> > > > I need to get the institution name through an intermediary table (two
> > > > foreign keys) to display in a template.
> >
> > > > The code is here:
> >
> > > >http://dpaste.com/122204/
> >
> > > > Thank you anyone,
> >
> > > (Your subject line says manytomany but I don't see any evidence of
> > > ManyToMany relations in the page you point to, there you just mention
> > > ForeignKeys?)
> >
> > > Your view passes in a results variable to your template where you have:
> >
> > > {% for project in results %}
> > > {{Project.contact|safe}}
> > > {{Contact.institutionname|safe}} # the institutionname (isn't
> retrieving)...
> > > {% endfor %}
> >
> > > First, I don't see how the {{Project..}} bit can be working since
> you've got
> > > a case mismatch on the leading 'p' between {% for project ... %} and {{
> > > Project...}}
> >
> > > Second, {{ Contact...}} won't be resolving to anything because you
> don't
> > > have any variable named Contact.  Perhaps you want:
> >
> > > {{ project.contact.institution }}
> >
> > > or
> >
> > > {{ project.contact.institution.institutionname }}
> >
> > > it's a little hard to tell because you didn't actually include your
> model
> > > definitions.  If it's just following foreign keys to get to the field
> you
> > > want, though, it's quite easy to do using the dot notation if you know
> the
> > > right field names.
> >
> > > Karen
> >
> >
> >
>

--~--~-~--~~~---~--~~
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: Debugging methodology suggestion on PIL file upload problems

2009-06-13 Thread Angel Cruz
Finally getting back into the swing of things in studying django.

I discovered 'Werkzeug debugger' and found out I was doing many things wrong
(saving to wrong place, trying to open the Image prior to saving it locally,
etc.).

Great debugging tool (wish I had an IDE, but this is better than printing to
files for debugging info, etc.).
Any other great debugging tool you guys have used?
On Thu, May 14, 2009 at 11:04 PM, MrBodjangos  wrote:

> Hi,
>
> Please give me pointers on how to debug this.
>
> Basic form error:
>
> "Upload a valid image. The file you uploaded was either not an image
> or a corrupted image."
>
> I have googled around and the problems I have read regards recompiling
> jpeg for MAC after installing PIL.  I have Windows, and so I believe
> everything is bundled correctly.
>
> I have a Windows XP box,  Python 2.5, django 1.0,  and Python Imaging
> Library 1.1.6 for Python 2.5 (Windows only).
>
> I have created a simple form with a browse and submit.
>
> I upload a jpg file and the form keeps returning "Upload a valid
> image. The file you uploaded was either not an image or a corrupted
> image."
>
> Now, I know PIL is working because in the shell, I can do this:
> --
> $ python manage.py shell
> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
> (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from PIL import Image
> >>> im=Image.open("C:\\my_wsgi\\media\\photos\\name.jpg")
> >>> print im.format
> JPEG
> >>>
> --
>
> In my google search efforts, one suggestion was to just change the
> raise exception in fields.py (C:\Python25\Lib\site-packages\django
> \forms):
>
> class ImageField(FileField):
> .
> .
> .
> .
>try:
># load() is the only method that can spot a truncated
> JPEG,
>#  but it cannot be called sanely after verify()
>trial_image = Image.open(file)
>trial_image.load()
>
># Since we're about to use the file again we have to reset
> the
># file object if possible.
>if hasattr(file, 'reset'):
>file.reset()
>
># verify() is the only method that can spot a corrupt PNG,
>#  but it must be called immediately after the constructor
>trial_image = Image.open(file)
>trial_image.verify()
>except ImportError:
># Under PyPy, it is possible to import PIL. However, the
> underlying
># _imaging C module isn't available, so an ImportError
> will be
># raised. Catch and re-raise.
>raise
>except Exception: # Python Imaging Library doesn't recognize
> it as an image
>
>raise  # << I comment the original below, and I just call
> raise here >>>
>#raise ValidationError(self.error_messages
> ['invalid_image'])
> .
> .
> .
>
>
> Having the raise bubble all the way up leads to:
>
> TemplateSyntaxError at /upload_file/
>
> Caught an exception while rendering: cannot identify image file
>
> Original Traceback (most recent call last):
>  File "C:\Python25\lib\site-packages\django\template\debug.py", line
> 71, in render_node
>result = node.render(context)
>  File "C:\Python25\lib\site-packages\django\template\defaulttags.py",
> line 241, in render
>value = bool_expr.resolve(context, True)
>  File "C:\Python25\lib\site-packages\django\template\__init__.py",
> line 535, in resolve
>obj = self.var.resolve(context)
>  File "C:\Python25\lib\site-packages\django\template\__init__.py",
> line 676, in resolve
>value = self._resolve_lookup(context)
>  File "C:\Python25\lib\site-packages\django\template\__init__.py",
> line 705, in _resolve_lookup
>current = getattr(current, bit)
>  File "C:\Python25\lib\site-packages\django\forms\forms.py", line
> 340, in _errors
>return self.form.errors.get(self.name, self.form.error_class())
>  File "C:\Python25\lib\site-packages\django\forms\forms.py", line
> 111, in _get_errors
>self.full_clean()
>  File "C:\Python25\lib\site-packages\django\forms\forms.py", line
> 229, in full_clean
>value = field.clean(value, initial)
>  File "c:\Python25\lib\site-packages\django\forms\fields.py", line
> 505, in clean
>trial_image = Image.open(file)
>  File "C:\Python25\Lib\site-packages\PIL\Image.py", line 1916, in
> open
>raise IOError("cannot identify image file")
> IOError: cannot identify image file
>
> 
>
> So, it seems that one of these two are failing in fields.py:
>trial_image = Image.open(file)
>trial_image.load()
>
> Here is my question:
> How do I find out what that 'file' is the Image object is trying to
> open?
> It would be nice if I can just put a print statement in between the
> two, something like:
>

Re: Changes not reflected in templates

2009-08-25 Thread Angel Cruz
Since you say you refreshed your web browsers and refreshed your web server,
the only thing I can guess is that you did not save your edits or you did
not commit to your source repositories and do an update of the source on the
server.  If you are sure your edits are there, perhaps there is a hung
server not realeasing the cache.  Reboot.  If that fails, then you have a
gremlin.

On Tue, Aug 25, 2009 at 2:10 PM, neri...@gmail.com wrote:

>
> When I make changes to templates they are not showing up upon refresh
> or restarting the test server, any ideas?
> >
>

--~--~-~--~~~---~--~~
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: Session problem?

2009-08-28 Thread Angel Cruz
How does your view.py look like?

I use the decorator @login_required right before each def that I want to
ensure is viewable only to the logged-in user.

On Fri, Aug 28, 2009 at 12:00 PM, David  wrote:

>
> hello Django community,
>
> I met this problem and can not find a solution. I wonder if any people
> has met this problem before? Can anybody give a clue or hint how to
> fix it?
>
> For my project, I have enabled sessions and I use
> contrib.auth.models.User. If one user logins into his/her account, all
> is perfect. However, if another user logins (no matter if it is from
> the same computer or from another computer), then the two users sees
> each other's information in their own account.
>
> I also found that
>
> (1.) request.user.username gives another logined user's name instead
> of this one (the correct one) even though I called
> request.user.is_authenticated().
>
> (2.)  request.session['username']  does not give the username that I
> assigned it earlier.
>
> (3.) Old session is still there even though a user log-out correctly,
> closes the browser (IE) and then opens another browser (Firefox).
>
> I have put "SESSION_EXPIRE_AT_BROWSER_CLOSE = True" in settings
> already. In my code I have request.session.set_expiry(0).
>
> Checking my session table, I can see that the "expire date" for
> sessions are in two weeks. Does this mean that
> "SESSION_EXPIRE_AT_BROWSER_CLOSE = True" did not work?
>
> Any suggestions?
>
> Thanks so much.
> >
>

--~--~-~--~~~---~--~~
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: Session problem?

2009-08-28 Thread Angel Cruz
Your implementation is dependent upon session cookies, and I am sure you
have a good reason for it.  I am as stomped as you are why that is (unless
you are like me, who confuses 127.0.0.1:8080 w/ localhost as I open multiple
browsers in testing my site...each will have different session cookies).

My implementation is dependent more on the user id being passed in from the
login page if a user is not logged in and just passing the User object into
the template:

my view.py has:
---
@login_required
def index(request):
.
.
.
 if request.user.is_authenticated():
 my_id=request.user.id
 user = get_object_or_404(User, id=my_id)

 context = {'my_auth_user': user, blah blah }
.
.
.
 return render_to_response('registration/detail.html',
  context,
  context_instance =
RequestContext(request))

my template ('registration/detail.html') has:
-
{{ my_auth_user.username}}
{{ my_auth_user.first_name}}
{{ my_auth_user.last_name}}
{{ my_auth_user.email}}

This ensures the the User object for that id belongs to is being called to
get the username and other information.

Of course, you can pass into the template the cookies and session id stuff
by placing them in the context variable.



On Fri, Aug 28, 2009 at 1:15 PM, David  wrote:

>
> Hi Angel,
>
> Thanks for your reply. I just tested with decorator @login_required.
> The problem still exists.
>
> Following is script for my homepage.
>
> # this is the homepage
> @login_required
> def my_view(request):
>if request.session.test_cookie_worked():
>#username = request.user.username
>if request.user.is_authenticated():
>username = request.session['username']
>#username = request.user.username
>return render_to_response('my_view.html',
> {'username':username})
>else:
>return HttpResponse("Please enable cookies and try again.")
>
>
> Neither request.session nor request.user can give a correct user's
> name all the time. In my login(request) I have
>
>  if request.method == "POST" :
>username = request.POST['username']
>password = request.POST['password']
>
>user = authenticate(username=username, password=password)
>if user is not None:
>if user.is_active:
>
>request.session['password'] = password
>request.session['username'] = username
>request.session.set_expiry(0)
>
>login(request, user)
> 
>
> So, why can not session bind username to it? And why can not
> request.user give the correct logined user? it seems to me that
> sessions are interweaved when two users login at the same time. Or one
> session over-writes the other? Checking session keys in session table,
> I can see that each session key is unique.
>
> Thanks again for your reply. I appreciate it. Do you have more ideas
> where I missed?
>
>
>
>
>
>
>
>
>
>
> On Aug 28, 12:35 pm, Angel Cruz  wrote:
> > How does your view.py look like?
> >
> > I use the decorator @login_required right before each def that I want to
> > ensure is viewable only to the logged-in user.
> >
> >
> >
> > On Fri, Aug 28, 2009 at 12:00 PM, David  wrote:
> >
> > > hello Django community,
> >
> > > I met this problem and can not find a solution. I wonder if any people
> > > has met this problem before? Can anybody give a clue or hint how to
> > > fix it?
> >
> > > For my project, I have enabled sessions and I use
> > > contrib.auth.models.User. If one user logins into his/her account, all
> > > is perfect. However, if another user logins (no matter if it is from
> > > the same computer or from another computer), then the two users sees
> > > each other's information in their own account.
> >
> > > I also found that
> >
> > > (1.) request.user.username gives another logined user's name instead
> > > of this one (the correct one) even though I called
> > > request.user.is_authenticated().
> >
> > > (2.)  request.session['username']  does not give the username that I
> > > assigned it earlier.
> >
> > > (3.) Old session is still there even though a user log-out correctly,
> > > closes the browser (IE) and then opens another browser (Firefox).
> >
> > > I have put "SESSION_EXPIRE_AT_BROWSER_CLOSE = True" in s

Re: newbie question: django-registration

2009-04-12 Thread Angel Cruz
Eh,
Never mind.  Something is wrong with my root url (fixing the link from the
email activated the account).

I will fix it.



On Sun, Apr 12, 2009 at 12:21 PM, MrBodjangles wrote:

> Hi Folks and Happy Easter!
>
> OK, making slow but sure progress on learning Django.
>
> I am using django-registration, have provided the simple templates
> required, and am to the point that a user can register (their usename,
> password, etc. get populated in the auth_user table of the PostgreSQL
> databae I am using), and receives an email.
>
> I am stuck on the activation.
>
> When I check my email and click on the link, I receive the following:
> "The requested URL /accounts/activate/
> 637cd08106eea9b1139efd34a0fa79a5d7f90494/ was not found on this
> server"
>
> I had assumed that the /accounts/activate/ folder
> would have been automatically generated?
>
> I added this line to my URLConf, thinking this was the reason:
>(r'^accounts/activate//
> $','registration.views.activate'),
>
> What step am I missing?
>
> Advanced 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: newbie question: django-registration

2009-04-13 Thread Angel Cruz
Also,
I had to go use the admin interface, go to Sites and change the 'site name'
from 'example.com' to mine.  A little required edit that I missed.

On Sun, Apr 12, 2009 at 10:00 PM, Praveen wrote:

>
> You should change the site domain name example.com to 127.0.0.1:8000
> check in your django-site table..
> http://www.example.com/accounts/activate/
> 637cd08106eea9b1139efd34a0fa79a5d7f90494/<http://www.example.com/accounts/activate/%0A637cd08106eea9b1139efd34a0fa79a5d7f90494/>
>  for instance
> http://127.0.0.1:8000/accounts/activate/
> 637cd08106eea9b1139efd34a0fa79a5d7f90494/<http://127.0.0.1:8000/accounts/activate/%0A637cd08106eea9b1139efd34a0fa79a5d7f90494/>
>
> On Apr 13, 12:55 am, Angel Cruz  wrote:
> > Eh,
> > Never mind.  Something is wrong with my root url (fixing the link from
> the
> > email activated the account).
> >
> > I will fix it.
> >
> > On Sun, Apr 12, 2009 at 12:21 PM, MrBodjangles  >wrote:
> >
> > > Hi Folks and Happy Easter!
> >
> > > OK, making slow but sure progress on learning Django.
> >
> > > I am using django-registration, have provided the simple templates
> > > required, and am to the point that a user can register (their usename,
> > > password, etc. get populated in the auth_user table of the PostgreSQL
> > > databae I am using), and receives an email.
> >
> > > I am stuck on the activation.
> >
> > > When I check my email and click on the link, I receive the following:
> > > "The requested URL /accounts/activate/
> > > 637cd08106eea9b1139efd34a0fa79a5d7f90494/ was not found on this
> > > server"
> >
> > > I had assumed that the /accounts/activate/ folder
> > > would have been automatically generated?
> >
> > > I added this line to my URLConf, thinking this was the reason:
> > >(r'^accounts/activate//
> > > $','registration.views.activate'),
> >
> > > What step am I missing?
> >
> > > Advanced 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
-~--~~~~--~~--~--~---



popping a bigger picture from thumbnail on hover..

2009-05-05 Thread Angel Cruz
Does django have an app available that will have a big picture pop open if I
hover over its thumbnail?

Something like the behavior shown in this site's gallery:
http://www.dailymugshot.com/main/browse

I tried doing something in javascript, but Internet Explorer blocks the
popup.

Advance thanks who can point me to the right direction!

--~--~-~--~~~---~--~~
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: psycopg2.OperationalError: FATAL: role "root" does not exist

2009-09-07 Thread Angel Cruz

You don't have a user account named 'root' in your database.  You should
probably use another user besides root.  Change your settings.py file to the
correct database user?

-Original Message-
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of Zico
Sent: Monday, September 07, 2009 2:04 PM
To: Django users
Subject: psycopg2.OperationalError: FATAL: role "root" does not exist


Hi, i have been trying to put the command: python manage.py syncdb in
my fixmystreet directory. But, these error shows: do you have any
idea.. how to solve this??

[r...@fedora fixmystreet]# python manage.py syncdb
local_settings.py not set; using default settings
local_settings.py not set; using default settings
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/usr/lib/python2.6/site-packages/django/core/management/
__init__.py", line 362, in execute_manager
utility.execute()
  File "/usr/lib/python2.6/site-packages/django/core/management/
__init__.py", line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/
base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.6/site-packages/django/core/management/
base.py", line 221, in execute
self.validate()
  File "/usr/lib/python2.6/site-packages/django/core/management/
base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
  File "/usr/lib/python2.6/site-packages/django/core/management/
validation.py", line 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File "/usr/lib/python2.6/site-packages/django/db/models/loading.py",
line 131, in get_app_errors
self._populate()
  File "/usr/lib/python2.6/site-packages/django/db/models/loading.py",
line 58, in _populate
self.load_app(app_name, True)
  File "/usr/lib/python2.6/site-packages/django/db/models/loading.py",
line 74, in load_app
models = import_module('.models', app_name)
  File "/usr/lib/python2.6/site-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
  File "/opt/fixmystreet/mainapp/models.py", line 3, in 
from django.contrib.gis.db import models
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/models/
__init__.py", line 5, in 
from django.contrib.gis.db.models.aggregates import *
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/models/
aggregates.py", line 2, in 
from django.contrib.gis.db.backend import SpatialBackend
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
__init__.py", line 12, in 
from django.contrib.gis.db.backend.postgis import
create_test_spatial_db, get_geo_where_clause, SpatialBackend
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
postgis/__init__.py", line 4, in 
from django.contrib.gis.db.backend.postgis.adaptor import
PostGISAdaptor
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
postgis/adaptor.py", line 5, in 
from django.contrib.gis.db.backend.postgis.query import
GEOM_FROM_WKB
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
postgis/query.py", line 27, in 
version_tuple = postgis_version_tuple()
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
postgis/management.py", line 45, in postgis_version_tuple
version = postgis_lib_version()
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
postgis/management.py", line 25, in postgis_lib_version
return _get_postgis_func('postgis_lib_version')
  File "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/
postgis/management.py", line 12, in _get_postgis_func
cursor = connection.cursor()
  File "/usr/lib/python2.6/site-packages/django/db/backends/
__init__.py", line 81, in cursor
cursor = self._cursor()
  File "/usr/lib/python2.6/site-packages/django/db/backends/
postgresql_psycopg2/base.py", line 98, in _cursor
self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: FATAL:  role "root" does not exist




--~--~-~--~~~---~--~~
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: psycopg2.OperationalError: FATAL: role "root" does not exist

2009-09-07 Thread Angel Cruz
Restart postgres, python manage.py syncdb, restart apachectl

 

If you still get the message below, it looks like you have a malformed query
(it this a raw sql query of via the django ORM?).

 

  _  

From: Zico [mailto:mailz...@gmail.com] 
Sent: Monday, September 07, 2009 2:15 PM
To: django-users@googlegroups.com
Cc: mrangelc...@gmail.com
Subject: Re: psycopg2.OperationalError: FATAL: role "root" does not exist

 

 

On Tue, Sep 8, 2009 at 3:06 AM, Angel Cruz  wrote:


You don't have a user account named 'root' in your database.  You should
probably use another user besides root.  Change your settings.py file to the
correct database user?


Ok, if i put my database user "fixmystreet" .. which is the exact user..
then this error comes:

psycopg2.InternalError: current transaction is aborted, commands ignored
until end of transaction block 




-- 
Best,
Zico


--~--~-~--~~~---~--~~
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: Editors of choice

2009-09-07 Thread Angel Cruz
I would go with an IDE.

 

I don't thnk anyone can progress quickly without being able to step through
the code and look at the variables and objects.  My productivity skyrocketed
when I discovered WingIDE under Windows.  It almost feels like I am in
Visual Studio.  It is not free, but it will not break the bank as well.  I
am not sure how it works in FreeBSD (god I hope it does because that is the
production server I will launch).

 

  _  

From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of Joshua Russo
Sent: Monday, September 07, 2009 4:30 PM
To: django-users@googlegroups.com
Subject: Re: Editors of choice

 

On Mon, Sep 7, 2009 at 2:55 PM, Samuel Hopkins 
wrote:

Hello Django peeps,

I am a Django newbee. I have had my eye on Djanjo for a year or so now but
held off because I had limited python experience. However, after a summer of
python and watching Django's popularity snowball, I think I am ready to go
:)

Anyhow, the purpose of this email was just to ask the community what
editor(s) they preferred to use with Django.

 

I have used and enjoyed the Python support NetBeans. It's almost complete
but if you like to have a visual debugger it works well. The only real nag
is that I had to kill the Python process that it started durring debug
because for some reason it didn't kill it automatically when the debug
session ended. 

 

The other problem I had was that I'm doing the bulk of my development work
on a very old computer (PIII 350 w/ 256 megs ram, impressive huh? :o) ) so
Netbeans being a fairly new fangled piece of software didn't run very well.
Though I did actually struggle through it for about a month or so, which
says some good things about it's performance that I was even able to do
that. 

 

I then switched to just using Textpad with Python highlighting and pdb
(http://docs.python.org/library/pdb.html) for debugging. Once you get the
hang of pdb it's extremely powerful. It basically drops you right into the
code with a Python command line. If you don't yet have experience with the
Python command line I would highly recommend getting a feel for it. They use
it through out the Python tutorial in the docs
(http://docs.python.org/tutorial/index.html), so that would be a good place
to start if you haven't done that yet.

 

Just yesterday I downloaded Komodo Edit
(http://www.activestate.com/komodo_edit/) it's half way between a text
editor and an IDE like Netbeans. I only have a few days experience with it
and I've just been doing HTML and CSS work the last few days, so I'm not
sure about it's debugging capabilities. It does have code completion that
works well.

 

That's my experience so far. I hope it helps.

 

Josh

 




--~--~-~--~~~---~--~~
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: psycopg2.OperationalError: FATAL: role "root" does not exist

2009-09-08 Thread Angel Cruz
That is another forum and postgresql question, and they provide fantastic
documentation:
http://www.postgresql.org/docs/8.1/static/sql-createrole.html

I use pd-Admin tool myself to totally control the database.
I would suggest think you make sure you are able to play around with the
database first creating tables, assigning values, etc.  (via psql or
pg-Admin) with the user you have created before dealing with django.
On Tue, Sep 8, 2009 at 12:03 AM, Jan Ostrochovsky <
jan.ostrochov...@gmail.com> wrote:

>
> How exactly did you put your database user? What is content of your
> pg_hba.conf?
> Maybe some parts of this could be helpful:
>
> http://sharpe-s-postgres.blogspot.com/2009/09/how-to-install-and-configure-postgresql.html/
>
> On Sep 7, 11:15 pm, Zico  wrote:
> > On Tue, Sep 8, 2009 at 3:06 AM, Angel Cruz 
> wrote:
> >
> > > You don't have a user account named 'root' in your database.  You
> should
> > > probably use another user besides root.  Change your settings.py file
> to
> > > the
> > > correct database user?
> >
> > Ok, if i put my database user "fixmystreet" .. which is the exact user..
> > then this error comes:
> >
> > *psycopg2.InternalError: current transaction is aborted, commands ignored
> > until end of transaction block*
> >
> > --
> > Best,
> > Zico
>  >
>

--~--~-~--~~~---~--~~
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: custom methods

2009-09-08 Thread Angel Cruz
I think it is just my vision problems, but I can't find where you are
calling the method 'ptot' in your view.

to debug, I would add this in my view (after instantiating with your line:
player = Player.objects.filter(p_uffl__icontains=q):
.
my_total=player.ptot # -- if I was debugging in an IDE, I would put a
breakpoint here and step over and then check the value ##
.
.
return render_to_response('search_results.html',
   {'player': player, 'query':q, 'my_total':my_total})

and in your template, just for debug add:
 Here is my total: {{my_total}}


On Tue, Sep 8, 2009 at 11:29 AM, Slammer  wrote:

>
> FYI, I'm a beginner,  I'm having trouble with custom methods,  I'm
> using an existing database which is used for a fantasy football
> site,   the primary data return is a list of players for a particular
> team, I've done that fine, but the score for those players is in a
> different table,  So to return the list of players with their current
> scores I tried to create a custom method as such in my models.py
>
> class Player(models.Model):
>p_keyid = models.IntegerField(primary_key=True)
>p_lname = models.CharField(max_length=135)
>#bla bla bla more fieldnames
>...
>
>
>def ptot(self):
>from django.db import connection
>cursor = connection.cursor()
>cursor.execute("""
>SELECT sum(s_total) s_total from score where s_pno =
> %s""", [self.p_keyid])
>#return [row[0] for row in cursor.fetchone()]
>#return [self.__class__(*row) for row in cursor.fetchone()]
>return u'S=%s' % (self.__class(*row).s_total)
>
> As you can see I've tried a bunch of ways to return the related score
> total, none have worked.
>
> in my views.py I have
> def search_roster(request):
>if 'q' in request.GET and request.GET['q']:
>q = request.GET['q']
>player = Player.objects.filter(p_uffl__icontains=q)
>return render_to_response('search_results.html',
>{'player': player, 'query':q})
>else:
>return render_to_response('search_form.html',
> {'error': True})
>
> in my search_results.html I have
> Team Listing for: {{ query }}
> {% if player %}
>Found {{ player|length }} player{{ player|pluralize }}.
>
> 
> PosName
> NFLValue
> Score
> {% for player in player %}
> {{ player.p_pos }}{{ player.p_lname }}
> {{ player.p_nfl }}{{ player.p_val }}
> {{ player.ptot }}
> {% endfor %}
> 
>
> {% else %}
>No players matched your search criteria.
> {% endif %}
>
> My questions are this,  when I just want a single field return for a
> custom method how do you form the return statement,  in my case I'm
> wanting what ever I alias the sum of s_total.   After which how does
> that value get successfully called from the html template.  All of it
> works but I never get a return value
>
> or is there an easier way to do this?  thanks in advance
>
>
> >
>

--~--~-~--~~~---~--~~
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: How to invoke hasNoProfanities?

2009-09-12 Thread Angel Cruz
I use the contribs.comments module, and in its clean_comment method:

if settings.COMMENTS_ALLOW_PROFANITIES == False:
bad_words = [w for w in settings.PROFANITIES_LIST if w in
comment.lower()]
if bad_words:



The file is in:
Python25\Lib\site-packages\django\contrib\comment\forms.py

It came for free, so I never stepped through this code.

On Sat, Sep 12, 2009 at 1:18 AM, Daniel Roseman wrote:

>
> On Sep 11, 10:40 pm, Brandon  wrote:
> > Uh, where? I see the definition in settings.py, but I can certainly
> > enter any of the words on the profanities list in:
> > django.conf.global_settings.py into a text field and it will not throw
> > an exception.
> >
>
> I actually think that this is a left-over setting from old code that
> has since been removed. The profanities checker was one of the
> oldforms validators, which were removed before version 1.0. So the
> setting is probably deprecated.
> --
> DR.
> >
>

--~--~-~--~~~---~--~~
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: PIL or an error elsewhere?

2009-10-06 Thread Angel Cruz
When I ran through this problem, there were a couple of things I was doing
wrong, none of which had to do with jpeg support.

Eventually, I found that my major problem was that my media directory (where
the upload directory resides) was not set properly in Apache.  It was not
writeable.  In my windows system's apache httpd.conf, I had to add this:

Alias /media/ "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/django/media/"

Order allow,deny
Options -Indexes
Allow from all



On Mon, Oct 5, 2009 at 6:41 PM, tdelam  wrote:

>
> Hey, I keep receiving this message on the production server when I try
> to upload an image through the admin interface: Upload a valid image.
> The file you uploaded was either not an image or a corrupted image.
> Does anyone have a suggestion as to why? I was told it could be a PIL
> issue not compiled with jpeg support but I do remember spending some
> time compiling PIL to get things working and jpeg support works. I
> also have django-filebrowser successfully uploading images to another
> project... Anyone have another suggestion as to why I am receiving
> this error?
>
> Here is a simple test through console.
>
> Python 2.5.4 (r254:67916, Sep 27 2009, 20:37:29)
> [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from PIL import Image
> >>> image = Image.open("/var/django/projects/hockey/media/images/goal.jpg")
> >>> image.format
> 'JPEG'
> >>>
>
> Here is my model:
>
> class Roster(models.Model):
>name = models.CharField(max_length=100)
>position = models.CharField(max_length=100)
>image = models.ImageField(upload_to='roster_uploads')
>
> >
>

--~--~-~--~~~---~--~~
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: Django Developer Position in New York City, Urgent Stuff

2009-10-11 Thread Angel Cruz
I wholeheartedly agree.
The Django community has a good reputation.
Don't screw it up with your foul verbal attacks.

On Sun, Oct 11, 2009 at 8:41 AM, Russell Keith-Magee  wrote:

>
> On Sun, Oct 11, 2009 at 11:33 PM, Chhouk Voeun 
> wrote:
> > mother fucker so many sending mail i' m bored don't send
>
> That kind of language is *completely* uncalled for.
>
> Please refrain from posting messages with this tone to the Django mailing
> lists.
>
> Yours,
> Russ Magee %-)
>
> > On Sat, Oct 10, 2009 at 3:04 AM, Shaun Hinklein (Sysmind L.L.C)
> >  wrote:
> >>
> >> Hey :)
> >> I'm messaging all of you in regards to a Django Developer position
> >> located in New York City. The position is extremely urgent and the
> >> candidate would start probably next week. If you, or one of your
> >> colleagues, is interested in this position, please contact me with
> >> your resume at 609-897-9670 x104 or at my email at sh...@sysmind.com
> >> Thanks for your time!
> >> Sincerely,
> >> Shaun
> >>
> >> The stuff you care about:
> >> There is no rate cap.
> >> The rate is good.
> >>
> >>
> >
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Embedding multiple images in html email

2009-10-15 Thread Angel Cruz
Can't you include the link and source within the html code of the email?

for example, as a snippet:
.
.
.
html = """\

  
  blah blah blah
   
http://blah-blah-blah.com";>http://blah-blah-blah.com/media/img/blah-blah-whatver-image.png";
width=100%>

Blah-whatever-your-message-here




"""

# Record the MIME types of both parts - text/plain and text/html.
part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')

# Attach parts into message container.
# According to RFC 2046, the last part of a multipart message, in this
case
# the HTML message, is best and preferred.
msg.attach(part1)
msg.attach(part2)

s = smtplib.SMTP(blah-blah-whatever-MY_SMTP_SERVER)
# sendmail function takes 3 arguments: sender's address, recipient's
address
# and message to send - here it is sent as one string.
s.sendmail(me, myRecipient, msg.as_string())
s.quit()
.
.
.

Since it is html, you can embed as many images as you want?

On Thu, Oct 15, 2009 at 5:30 AM, Muhammed Abad wrote:

>
> As the topic says, can I embed multiple images in an html email
> template so the recipient does not have to download them?
>
> I know this might be a silly request, but a client has asked me to do
> this for him and Im absolutely stumped.
>
> The closest to a solution I have come to is this :
> http://www.djangosnippets.org/snippets/1507/
>
> If someone else can get this to work, please let me know.
>
> Any other solution are welcome.
>
> Thanks in advance.
>
> M.
>
> >
>

--~--~-~--~~~---~--~~
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: windows localhost send email

2009-10-16 Thread Angel Cruz
In your settings.py, make sure you set EMAIL_HOST correctly.

1. test if you are able to email with a simple python program:
If you have comcast cable in your home, this should work:

---
import smtplib

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

def email_me(myRecipient):
me = "whatevermyem...@gmail.com"
EMAIL_HOST='smtp.comcast.net'

# Create message container - the correct MIME type is
multipart/alternative.
msg = MIMEMultipart('alternative')
msg['Subject'] = "Test email"
msg['From'] = me
msg['To'] = myRecipient

# Create the body of the message (a plain-text and an HTML version).
text = """
this is just a test
"""

html = """\



 This is just a test



"""

part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')

msg.attach(part1)
msg.attach(part2)

# Send the message via local SMTP server.
s = smtplib.SMTP(EMAIL_HOST)
# sendmail function takes 3 arguments: sender's address, recipient's
address
# and message to send - here it is sent as one string.
s.sendmail(me, myRecipient, msg.as_string())
s.quit()

# --- MAIN --- #

email_me("mywhatver_em...@gmail.com")
--

2.
Once above test email code works, you can set the EMAIL_HOST in your
settings.py to the same.




On Fri, Oct 16, 2009 at 12:28 AM, grimmus  wrote:

>
> Hi,
>
> I am setting up the password reset function in my app.
>
> When i click 'Reset my password' i get the error
>
> (10061, 'No connection could be made because the target machine
> actively refused it')
>
> I am guessing it's because there is trouble sending the email. How can
> i setup my machine to be able to send emails ?
>
> My app is running on localhost:
>
> Thanks for any info.
> >
>

--~--~-~--~~~---~--~~
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: wsgi config

2009-11-10 Thread Angel Cruz
Maybe the backslash is a problem.

Here is how my media alias looks like:

Alias /media/ "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/django/media/"

Order allow,deny
Allow from all



On Sun, Nov 8, 2009 at 11:37 PM, knight  wrote:

>
> Hi. I have a problem with configuring my django site with mod_wsgi.
> My httpd.conf is:
>
>
> LoadModule wsgi_module modules/mod-wsgi.so
> WSGIScriptAlias /peergw C:/mxhw/mx30/django.wsgi
>
> 
>Order deny,allow
>allow from all
> 
>
> Alias /media/ "C:\Program Files\Apache Software Foundation
> \Apache2.2\htdocs\media"
> Alias /peergw/site_media/ "C:\Program Files\Apache Software Foundation
> \Apache2.2\htdocs\site_media"
>
>  \Apache2.2\htdocs">
> Order deny,allow
> Allow from all
> 
>
>
> I want my site to run on /peergw since I have many instances on the
> server and each one running with the different prefix.
> Everything works fine except all the images - I can't see static media
> files both in admin and my site.
> When I go to "/site_media//image" and not "/peergw/site_media//
> image", I do see the image.
> What am I doing wrong?
> By the way, I'm running on Vista, but I have the same problem on XP.
>
> Thanks, Arshavski Alexander.
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: wsgi config

2009-11-12 Thread Angel Cruz
Does it look like this now?  This should work:

Alias /media/ "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/media/"


Order allow,deny
Allow from all



Alias /peergw/site_media/ "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/site_media/"


Order allow,deny
Allow from all




Order deny,allow
Allow from all



On Wed, Nov 11, 2009 at 12:32 AM, knight  wrote:

>
> Hi,
>
> Thanks for the reply.It helps for the admin media.
> But my site_media (static files) still don't work.
> Do you have another idea what my problem is?
>
> Thanks, Arshavski Alexander.
>
> On Nov 11, 12:31 am, Angel Cruz  wrote:
> > Maybe the backslash is a problem.
> >
> > Here is how my media alias looks like:
> >
> > Alias /media/ "C:/Program Files/Apache Software
> > Foundation/Apache2.2/htdocs/django/media/"
> >  > Foundation/Apache2.2/htdocs/django/media/">
> > Order allow,deny
> > Allow from all
> > 
> >
> >
> >
> > On Sun, Nov 8, 2009 at 11:37 PM, knight  wrote:
> >
> > > Hi. I have a problem with configuring my django site with mod_wsgi.
> > > My httpd.conf is:
> >
> > > LoadModule wsgi_module modules/mod-wsgi.so
> > > WSGIScriptAlias /peergw C:/mxhw/mx30/django.wsgi
> >
> > > 
> > >Order deny,allow
> > >allow from all
> > > 
> >
> > > Alias /media/ "C:\Program Files\Apache Software Foundation
> > > \Apache2.2\htdocs\media"
> > > Alias /peergw/site_media/ "C:\Program Files\Apache Software Foundation
> > > \Apache2.2\htdocs\site_media"
> >
> > >  > > \Apache2.2\htdocs">
> > > Order deny,allow
> > > Allow from all
> > > 
> >
> > > I want my site to run on /peergw since I have many instances on the
> > > server and each one running with the different prefix.
> > > Everything works fine except all the images - I can't see static media
> > > files both in admin and my site.
> > > When I go to "/site_media//image" and not "/peergw/site_media//
> > > image", I do see the image.
> > > What am I doing wrong?
> > > By the way, I'm running on Vista, but I have the same problem on XP.
> >
> > > Thanks, Arshavski Alexander.
> --~--~-~--~~~---~--~~
> 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
> -~--~~~~--~~--~--~---
>
>

--

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=.




Re: wsgi config

2009-11-12 Thread Angel Cruz
BTW,
Aliases are usually one word and so I would have aliased your site media as:

Alias /site_media/ "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/
site_media/"


On Thu, Nov 12, 2009 at 8:49 AM, Angel Cruz  wrote:

> Does it look like this now?  This should work:
>
> Alias /media/ "C:/Program Files/Apache Software
> Foundation/Apache2.2/htdocs/media/"
>
>  Foundation/Apache2.2/htdocs/media/">
>
> Order allow,deny
> Allow from all
> 
>
>
> Alias /peergw/site_media/ "C:/Program Files/Apache Software
> Foundation/Apache2.2/htdocs/site_media/"
>
>  Foundation/Apache2.2/htdocs/site_media/">
>
> Order allow,deny
> Allow from all
> 
>
>
> 
> Order deny,allow
> Allow from all
> 
>
>
> On Wed, Nov 11, 2009 at 12:32 AM, knight  wrote:
>
>>
>> Hi,
>>
>> Thanks for the reply.It helps for the admin media.
>> But my site_media (static files) still don't work.
>> Do you have another idea what my problem is?
>>
>> Thanks, Arshavski Alexander.
>>
>> On Nov 11, 12:31 am, Angel Cruz  wrote:
>> > Maybe the backslash is a problem.
>> >
>> > Here is how my media alias looks like:
>> >
>> > Alias /media/ "C:/Program Files/Apache Software
>> > Foundation/Apache2.2/htdocs/django/media/"
>> > > > Foundation/Apache2.2/htdocs/django/media/">
>> > Order allow,deny
>> > Allow from all
>> > 
>> >
>> >
>> >
>> > On Sun, Nov 8, 2009 at 11:37 PM, knight  wrote:
>> >
>> > > Hi. I have a problem with configuring my django site with mod_wsgi.
>> > > My httpd.conf is:
>> >
>> > > LoadModule wsgi_module modules/mod-wsgi.so
>> > > WSGIScriptAlias /peergw C:/mxhw/mx30/django.wsgi
>> >
>> > > 
>> > >Order deny,allow
>> > >allow from all
>> > > 
>> >
>> > > Alias /media/ "C:\Program Files\Apache Software Foundation
>> > > \Apache2.2\htdocs\media"
>> > > Alias /peergw/site_media/ "C:\Program Files\Apache Software Foundation
>> > > \Apache2.2\htdocs\site_media"
>> >
>> > > > > > \Apache2.2\htdocs">
>> > > Order deny,allow
>> > > Allow from all
>> > > 
>> >
>> > > I want my site to run on /peergw since I have many instances on the
>> > > server and each one running with the different prefix.
>> > > Everything works fine except all the images - I can't see static media
>> > > files both in admin and my site.
>> > > When I go to "/site_media//image" and not
>> "/peergw/site_media//
>> > > image", I do see the image.
>> > > What am I doing wrong?
>> > > By the way, I'm running on Vista, but I have the same problem on XP.
>> >
>> > > Thanks, Arshavski Alexander.
>> --~--~-~--~~~---~--~~
>> 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
>> -~--~~~~--~~--~--~---
>>
>>
>

--

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=.




Re: Making the case for Django (vs. Drupal)

2009-11-17 Thread Angel Cruz
If a piece of software (or any engineering product) is designed properly and
flexible enough to easily fix with attacks, then actually, product and
attacker form a symbiotic relationship where the attacker actually helps the
product head to impermeability.

This is true of most things that get hacked (remember when DirectTV had
pirated boxes all over the place where one can purchase on craigslist or
where a weekend intermittent hacker can easily get instructions on a
website?  DirectTV got more ingenious playing the cat and mouse game with
hackers with the result of DirectTV now having a more secure system.  The
same with Game Console discs being copied.  Try and see how easy it is to
copy and have a playable Playstation 3 Game (where designers responded to
pirating by now embedding chips on the BluRay disc)).

The key to the whole situation is if the product is designed well to
respond.  Having seen to much php spaghetti mess in my career, I think
Django and Python are well designed for such things.

On Mon, Nov 16, 2009 at 11:39 PM, andreas schmid wrote:

> hi mike,
>
> sry i dont want to be unkind but could you please turn the mail delivery
> confirmation off when you write to a list?!
>
> thx
>
> Mike Ramirez wrote:
> > On Monday 16 November 2009 20:12:57 Kenneth Gonsalves wrote:
> >
> >> anyway, in pitching for django (in particular), python and postgresql in
> >> general, I put safe code as number one in the list. And I personally am
> >> confident (after seeing the work done in the last 5 years in django,
> python
> >>  and postgresql) that this will remain. Holes will appear - but I have a
> >>  feeling they will be few and far between and patched fast too. This is
> >>  what I tell people.
> >>
> >>
> >
> > Agreed all the way across.
> >
> > One of the reasons I use django is because it's hard to shoot yourself in
> the
> > foot and by making sure the lower level apis is where most of the
> important
> > security features we all want live, and makes customizing our own special
> ones
> > easy.  Python, well it's the love of the language, postgresql cause of
> the
> > features it has, has had them a lot longer than mysql and a nicer memory
> > footprint.
> >
> > And the latter part of your statement is exactly why we all think that
> open
> > source software is more secure than propietary software and swear by it.
> >
> > Mike
> >
>
> --
>
> 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=.
>
>
>

--

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=.




Re: Use Subversion to Download the Latest Django Version

2009-11-17 Thread Angel Cruz
Add to the PATH variable the location of your svn.exe

On Tue, Nov 17, 2009 at 8:58 AM, Mikey3D  wrote:

> I just got new computer Win7 64-bit and I downloaded:
>
> 64 Bit TortoiseSVN-1.6.6.17493-x64-svn-1.6.6.msi
>
> After finished download >Restart >Start >Run >cmd
>
> --
> C:\Users\Mike>svn co http://code.djangoproject.com/svn/django/trunk/
> 'svn' is not recognized as an internal or external command, operable
> program or batch file.
>
> C:\Users\Mike>
> --
>
> What should I do?
>
> Thanks, Mikey3D
>
> --
>
> 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=.
>
>
>

--

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=.




Re: Use Subversion to Download the Latest Django Version

2009-11-17 Thread Angel Cruz
http://www.computerhope.com/issues/ch000549.htm


On Tue, Nov 17, 2009 at 9:11 AM, Mikey3D  wrote:

> I can't find svn.exe.
>
> Can you tell me howto? Steps...
>
> Thanks, Mikey3D
>
> On Nov 17, 12:00 pm, Angel Cruz  wrote:
> > Add to the PATH variable the location of your svn.exe
> >
> > On Tue, Nov 17, 2009 at 8:58 AM, Mikey3D  wrote:
> > > I just got new computer Win7 64-bit and I downloaded:
> >
> > > 64 Bit TortoiseSVN-1.6.6.17493-x64-svn-1.6.6.msi
> >
> > > After finished download >Restart >Start >Run >cmd
> >
> > > --
> > > C:\Users\Mike>svn cohttp://code.djangoproject.com/svn/django/trunk/
> > > 'svn' is not recognized as an internal or external command, operable
> > > program or batch file.
> >
> > > C:\Users\Mike>
> > > --
> >
> > > What should I do?
> >
> > > Thanks, Mikey3D
> >
> > > --
> >
> > > 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=.
>
> --
>
> 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=.
>
>
>

--

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=.




Re: Use Subversion to Download the Latest Django Version

2009-11-17 Thread Angel Cruz
Your svn.exe is where you installed it.

If you can find it, do a search on the c: drive.



On Tue, Nov 17, 2009 at 9:16 AM, Angel Cruz  wrote:

> http://www.computerhope.com/issues/ch000549.htm
>
>
>
> On Tue, Nov 17, 2009 at 9:11 AM, Mikey3D  wrote:
>
>> I can't find svn.exe.
>>
>> Can you tell me howto? Steps...
>>
>> Thanks, Mikey3D
>>
>> On Nov 17, 12:00 pm, Angel Cruz  wrote:
>> > Add to the PATH variable the location of your svn.exe
>> >
>> > On Tue, Nov 17, 2009 at 8:58 AM, Mikey3D  wrote:
>> > > I just got new computer Win7 64-bit and I downloaded:
>> >
>> > > 64 Bit TortoiseSVN-1.6.6.17493-x64-svn-1.6.6.msi
>> >
>> > > After finished download >Restart >Start >Run >cmd
>> >
>> > > --
>> > > C:\Users\Mike>svn cohttp://code.djangoproject.com/svn/django/trunk/
>> > > 'svn' is not recognized as an internal or external command, operable
>> > > program or batch file.
>> >
>> > > C:\Users\Mike>
>> > > --
>> >
>> > > What should I do?
>> >
>> > > Thanks, Mikey3D
>> >
>> > > --
>> >
>> > > 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=.
>>
>> --
>>
>> 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=.
>>
>>
>>
>

--

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=.




Re: Use Subversion to Download the Latest Django Version

2009-11-17 Thread Angel Cruz
So it seems TortoiseSVN does not include svn.exe?

You need to install Subversion packaging then:

http://subversion.tigris.org/getting.html#windows
(I have use VisualSVN in the past, but it seems like they don't have a
64-bit version yet)

Or you can use cygwin (which comes with svn.exe) for your shell.

On Tue, Nov 17, 2009 at 9:48 AM, Tony Czeh  wrote:

> TortoiseSVN is a graphical SVN client.  If you right-click you should
> see an option for Tortoise that, when expanded, contains a check out
> option.  From there, just follow the wizard.
>
> Mikey3D wrote:
> > I just got new computer Win7 64-bit and I downloaded:
> >
> > 64 Bit TortoiseSVN-1.6.6.17493-x64-svn-1.6.6.msi
> >
> > After finished download >Restart >Start >Run >cmd
> >
> > --
> > C:\Users\Mike>svn co http://code.djangoproject.com/svn/django/trunk/
> > 'svn' is not recognized as an internal or external command, operable
> > program or batch file.
> >
> > C:\Users\Mike>
> > --
> >
> > What should I do?
> >
> > Thanks, Mikey3D
> >
> > --
> >
> > 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=.
> >
> >
>
> --
>
> 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=.
>
>
>

--

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=.




Re: Use Subversion to Download the Latest Django Version

2009-11-17 Thread Angel Cruz
Looks like you finally got the download!  You can just use Tortoise from
this point onward.

You don't need to get cygwin unless you are doing some shell scripting to
interact with subversion or you just like doing things via the command line.

On Tue, Nov 17, 2009 at 10:33 AM, Mikey3D  wrote:

> Tony, I right-clicked on desktop wallpaper and see SVN Checkout >URL
> of repository >http://code.djangoproject.com/svn/django/trunk/ >OK
>
> It download 10,83M Bytes Django of 13 files in 2 minutes and 19
> seconds.
>
> Angel, I installed 64-bit Subversion from http://tortoisesvn.net/downloads
>
> Is that wrong Subversion but Tony explained that works. Do I still
> need cygwin?
>
> Thanks for your helps, Angel and Tony
>
> Mikey3D
>
> On Nov 17, 1:05 pm, Angel Cruz  wrote:
> > So it seems TortoiseSVN does not include svn.exe?
> >
> > You need to install Subversion packaging then:
> >
> > http://subversion.tigris.org/getting.html#windows
> > (I have use VisualSVN in the past, but it seems like they don't have a
> > 64-bit version yet)
> >
> > Or you can use cygwin (which comes with svn.exe) for your shell.
> >
> > On Tue, Nov 17, 2009 at 9:48 AM, Tony Czeh  wrote:
> > > TortoiseSVN is a graphical SVN client.  If you right-click you should
> > > see an option for Tortoise that, when expanded, contains a check out
> > > option.  From there, just follow the wizard.
> >
> > > Mikey3D wrote:
> > > > I just got new computer Win7 64-bit and I downloaded:
> >
> > > > 64 Bit TortoiseSVN-1.6.6.17493-x64-svn-1.6.6.msi
> >
> > > > After finished download >Restart >Start >Run >cmd
> >
> > > > --
> > > > C:\Users\Mike>svn cohttp://code.djangoproject.com/svn/django/trunk/
> > > > 'svn' is not recognized as an internal or external command, operable
> > > > program or batch file.
> >
> > > > C:\Users\Mike>
> > > > --
> >
> > > > What should I do?
> >
> > > > Thanks, Mikey3D
> >
> > > > --
> >
> > > > 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=.
> >
> > > --
> >
> > > 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=.
>
> --
>
> 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=.
>
>
>

--

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=.




Re: django and mod_wsgi

2010-01-05 Thread Angel Cruz
I am not sure about your wsgi Script alias ending in a '.py'.  I also don't
see the directory of the wsgi script being set with the apache directive



Here is mine:

NameVirtualHost *:80


ServerName www.my-website-domain.com
DocumentRoot  "/usr/local/www/apache22/data"

WSGIDaemonProcess www.my-website-domain.com threads=15 display-name=%{GROUP}

WSGIProcessGroup www.my-website-domain.com

WSGIApplicationGroup %{GLOBAL}


WSGIScriptAlias / "/usr/local/django/mod_wsgi/django.wsgi"

Order deny,allow
Allow from all


Alias /media/ "/usr/local/django/media/"



Order allow,deny
Options -Indexes
Allow from all





On Tue, Jan 5, 2010 at 8:39 AM, dcorbe  wrote:

> Hi,
>
> I've tried the (relatively straight-forward-looking) steps to get
> django and mod_wsgi working together with little success thus far.
> I'm trying to run a simple django application from my Apache web
> server.  The documentation doesn't make it clear whether user= and
> group= needs to be set to the webserver's uid/gid (which it currently
> is) or whether it needs to be set to the uid/gid that own the
> application (which I tried with no success).  Beyond that I'm not sure
> how to proceed.
>
> When I attempt to hit the site (http://blog.corbe.net) it simply times
> out.
>
> It appears as if mod_wsgi is configured and installed properly:
>
> [Tue Jan 05 08:24:29 2010] [notice] Apache/2.2.13 (Unix) mod_ssl/
> 2.2.13 OpenSSL/0.9.8e DAV/2 mod_wsgi/3.1 Python/2.5.4 PHP/5.2.10 SVN/
> 1.6.5 configured -- resuming normal operations
>
> I'm configuring the system like so:
>
> 
>ServerName blog.corbe.net
>DocumentRoot /usr/local/apache2/htdocs
>
>Alias   /media/ /usr/home/dcorbe/corbenet/www/media/
>Alias   /download/  /usr/home/dcorbe/corbenet/www/
> download/
>Alias   /static//usr/home/dcorbe/corbenet/byteflow/
> static/
>
>WSGIDaemonProcess   site-corbenet user=daemon group=daemon
> threads=10
>WSGIProcessGroupsite-corbenet
>WSGIScriptAlias /   /usr/home/dcorbe/corbenet/
> byteflow-wsgi.py
>
>ErrorLoglogs/blog-error_og
>CustomLog   logs/blog-access_log combined
> 
>
> Django is installed globally on this system (it appears in site-
> python) and the byteflow-wsgi.py contains the following:
>
> #!/usr/local/bin/python
>
> import os, sys
>
> sys.path.append('/usr/home/dcorbe/corbenet/byteflow')
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> Any help is appreciated.  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.
>
>
>
>
-- 

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: CI for Django projects

2010-02-19 Thread Angel Cruz
I have used a Continous Integration framework form TeamCity to auto build
and test our Delphi based product.  Though it is not building and testing
Django, the TeamCity executable eventually calls python, which controls
every thing from that point on.

With python, I am sure you can auto build and test your django apps.  Django
is just python, right?

I am using the tool on a Windows server, but I see that they have a MacOSX
version as well.

On Fri, Feb 19, 2010 at 10:01 AM, HB  wrote:

> Hey,
> Do you know a Continuous Integration tool that supports Django
> projects?
> 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.
>
>

-- 
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.