Re: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Kenneth Gonsalves
On Sat, 2011-06-04 at 01:29 -0400, AJ wrote:
> I think I will go for VPS. I do agree that managing seems a little
> work but
> I guess eventually it will prove to be good.
> 
> I have one more question: Is it easy to have the mail server setup on
> a VPS?
> My application does require emailing users and members of the website.
> This
> is mostly system mail and users will not email amongst themselves.
> 
> 

apt-get (or yum) install postfix, or for the whole works:
http://workaround.org/ispmail/lenny
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread AJ
I think I will go for VPS. I do agree that managing seems a little work but
I guess eventually it will prove to be good.

I have one more question: Is it easy to have the mail server setup on a VPS?
My application does require emailing users and members of the website. This
is mostly system mail and users will not email amongst themselves.


On Sat, Jun 4, 2011 at 12:21 AM, Kenneth Gonsalves
wrote:

> On Fri, 2011-06-03 at 14:12 -0400, AJ wrote:
> > To change the question or ask a new one too: what name do you suggest
> > as a
> > good, reliable yet economical hosting provider - Both for personal
> > static
> > website hosting and little Django web projects?
>
> webfaction
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> 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.
>
>


-- 
AJ

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



ORM Doubts

2011-06-03 Thread sushanth Reddy
 

Hi,

below is model

class Employee(models.Model):
  name = models.CharField(max_length=50, primary_key=True)
  dep = models.CharField(max_length=10)
  class Meta(object):
db_table = u'employee'

class EmpSal(models.Model):
  emp_name = models.ForeignKey(Employee, db_column='emp_name')
  emp_sal = models.FloatField()
  class Meta(object):
db_table = u'empsal'

class EmpWork(models.Model):
  emp_wrk = models.ForeignKey(Employee, db_column='emp_wrk')
  emp_doj = models.DateField()
  class Meta(object):
db_table = u'empwork'

here i can make join from EMployee and EmpWork

 EmpWork.object.filter(emp_wrk__dep)

here i can make join from EMployee and EmpSal

   EmpSal.object.filter(emp_name__dep)

My Questions:

   - 
   
   how to make a relation between EmpWork and EMPSal 
   - 
   
   how to join all three once Employee,EMPWork,EMPSal
   - if i want to make a relation 

Employee.objects.filter(empsal__emp_sal=1).values('name') ?

this return empty list ?

   - how to get all the employee sal who's doj is example '2010-10-15' ? 

If possible can you please give example with making relation with ORM

-- 
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/-/R0xscklQV0NOUXdK.
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Kenneth Gonsalves
On Fri, 2011-06-03 at 14:12 -0400, AJ wrote:
> To change the question or ask a new one too: what name do you suggest
> as a
> good, reliable yet economical hosting provider - Both for personal
> static
> website hosting and little Django web projects? 

webfaction
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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



Opinion on static files and approaching hardcoding in a Django-like manner

2011-06-03 Thread xiao_haozi
Sorry if this might have been addressed before in a similar manner,
but I was curious as to what some others' thoughts were or what their
practices might be in this situation.

I have some bookmarklets and other javascript files in a /static/
directory. This are then linked in a view so that a user could drag
and drop into their toolbar.

Now, in other scenarios where I might be generating links, I simply
pipe in the domain (if needed) via Sites. However, in a static JS file
I obviously do not use a templating setup and thus cannot pipe in a
domain.

For now, in testing and personal use, I've just hardcoded in my domain
for these types of scenarios. However, what are some options for doing
this when I am pushing this code out for others to use.

[Example: bookmarklet use for a Django URL shortener - 
https://github.com/mutaku/Stumpy
]

Thanks in advance for any comments/suggestions.  I had some ideas in
mind, but thought it might be interesting to see what other people
were doing for these types of situations.

-- 
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: Why self-defined session_key got changed when save in DB?

2011-06-03 Thread Jimmy
I'm new to Django and not quite understand your explanation.

How can I create a specific session_key, and access to the session by
that key? Any risk that I have if I expose the session_key to the
outside?

Thank you.

Best regards,
Li Jiaming

On May 31, 7:47 pm, Tom Evans  wrote:
> On Sat, May 28, 2011 at 4:00 AM, Jimmy  wrote:
> > Hi,
>
> > I have following code to set self-definedsession_key:
>
>  from django.contrib.sessions.backends.db import SessionStore
>  from django.contrib.sessions.models import Session
>  a = SessionStore(session_key="fwefwejfo3j20jf02jnfweojfeo")
>  a.save()
>  a.session_key
> > 'a6e020a64789b5644e923c85b80a1d0b'
>
> > Why thesession_keygot changed after saved in DB? Where is my defined
> >session_key?
>
> This is not a bug, it is by design. The session app is protecting you
> from session fixation attacks.
>
> If you try to use a session with a specified key, and no session with
> that key exists, django will cycle the session key to avoid a user
> being caught by a session fixation attack, where a malicious user
> attempts to get a valid user to log in using a known session key, and
> then accesses their session.
>
> 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-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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Dave Sayer
On 3 June 2011 19:48, Javier Guerra Giraldez  wrote:
> small VPSs tend to be the best answer if you don't mind adminstering
> your own box.  both webfaction and linode have solid reputation and
> support teams.
>
+1 for VPS. I had always used Dreamhost for hosting PHP & static sites
for both personal and clients. When i started messing with Django, I
decided to take the plunge and get a small VPS from Bytemark in the
UK. Despite being daunted initially by the admin side, I haven't
looked back. The admin side of things took a little bit of getting
used to but Slicehost have some fantastic articles on getting up and
running. It's not as cheap as shared hosting but with complete control
over the VPS, email and phone support and great performance, I feel
the extra money is well worth it. I pay £15 (about $22 USD) per month
for each VPS - i run two; one for me and small clients and the other
is dedicated to one clients site. I just use my USD$10 per month DH
account for svn and backing up my vps' via rsync.

I can add another +1 for Nginx too.

Cheers,

Dave


-- 
---
Dave Sayer | Bath Design
Web design & development with standards
---
mobile: +44 (0)7702787436
email: d...@bathdesign.co.uk
web: http://bathdesign.co.uk
photography: http://davesayer.com
twitter: http://twitter.com/sweet_grass
---

-- 
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Oscar Carballal
I recently discovered AlienLayer, a VPS provider in las vegas, they hace a
$19/year plan that is quite good for personal stuff. Take a look to it :)

Enviado desde mi HTC
El 03/06/2011 20:48, "Javier Guerra Giraldez"  escribió:
> On Fri, Jun 3, 2011 at 1:12 PM, AJ  wrote:
>> To change the question or ask a new one too: what name do you suggest as
a
>> good, reliable yet economical hosting provider - Both for personal static
>> website hosting and little Django web projects?
>
> small VPSs tend to be the best answer if you don't mind adminstering
> your own box. both webfaction and linode have solid reputation and
> support teams.
>
>
> --
> Javier
>
> --
> 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-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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Cal Leeming [Simplicity Media Ltd]
Oh also, if you want to run off dev.* / staging.* urls, but your code (for
whatever reason) won't support those new urls, you can use middleware to
trick the code into thinking the dev.*/staging.* hostnames are actually the
prod hostnames, whilst still applying the correct environmental settings:


# Do some clever stripping of dev.*
if host[:4] == "dev.":
host = host[4:]
#request.META["HTTP_HOST"] = host
#request.META['SERVER_NAME'] = host
if request.META.has_key('HTTP_REFERER'):
request.META['HTTP_REFERER'] =
request.META.get('HTTP_REFERER').replace("//dev.", "//")

if request.META.has_key('SCRIPT_URI'):
request.META['SCRIPT_URI'] =
request.META.get('SCRIPT_URI').replace("//dev.", "//")

etc..

On Fri, Jun 3, 2011 at 9:54 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Oh, sorry I thought you were asking how to stop people accessing your dev
> environment.
>
> There are multiple ways to handle dev/staging/prod separation, and they all
> depend on how mission critical your prod is.
>
> Personally, I have different sub domains for each one, place prod under git
> only release control, and have dev/staging locked down.
>
> In the settings.py, I then separate the environments out by using
> environmental variables. For example:
>
> DJANGO_ENVIRONMENT=prod ./manage.py shell
> DJANGO_ENVIRONMENT=dev ./manage.py shell
>
> You can also do auto env detection, based on the current path, by using the
> following:
>
>
> CURRENT_DIR = os.path.dirname(__file__)
>
> if not os.environ.has_key('DJANGO_ENVIRONMENT'):
> if CURRENT_DIR.count("/ddcms/dev"):
> os.environ['DJANGO_ENVIRONMENT'] = 'dev'
>
> elif CURRENT_DIR.count("/ddcms/prod"):
> os.environ['DJANGO_ENVIRONMENT'] = 'prod'
>
> else:
> assert os.environ.has_key('DJANGO_ENVIRONMENT'), "Auto environment
> resolve failed, you must specify which DJANGO_ENVIRONMENT to use (dev/prod)"
>
> To resolve relative include problems, you can also use this to grab the
> current root dir of your project:
>
> # Hard code the root folder for production, due to symlinking resolve
> problems.
> if os.environ.get('DJANGO_ENVIRONMENT') == 'prod':
> PROJECT_PATH = "/ddcms/prod/webapp"
> else:
> PROJECT_PATH =
> os.path.abspath(os.path.dirname(__file__)+"/").replace('\\',"/")
>
> If you need your dev/prod to use the same database source, you can also use
> middleware and db routers to control how much damage dev can cause etc.
>
> Cal
>
> On Fri, Jun 3, 2011 at 9:50 PM, AJ  wrote:
>
>> Well even if I do my Python stuff in virtualenv for development on a
>> linode box, I'd like to know how to separate development/test environment to
>> live/production.
>>
>> Is the only solution "*...**IP whitelisting to block only those who you
>> want to have access...*"?
>>
>> Also, can I run multiple instances of same Django website on
>> dev.website.com, test.website.com and www.website.com?
>>
>>
>>
>>
>> On Fri, Jun 3, 2011 at 4:28 PM, Shawn Milochik wrote:
>>
>>> On 06/03/2011 04:16 PM, Amanjeev Sethi wrote:
>>>
 Linode looks nice plus it will teach me some administration side too.

 If I try using linode, what is the best setup (Linux Distro, web server
 support, modules like mod_wsgi? etc ) for Django websites on linode?



>>> Use whatever distro you like and do all your Python stuff in virtualenv.
>>>
>>> For deployment I use and recommend nginx + gunicorn.
>>>
>>> Use supervisord to run gunicorn.
>>>
>>> Shawn
>>>
>>>
>>>
>>> --
>>> 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.
>>>
>>>
>>
>>
>> --
>> AJ
>>
>> --
>> 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-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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Cal Leeming [Simplicity Media Ltd]
Oh, sorry I thought you were asking how to stop people accessing your dev
environment.

There are multiple ways to handle dev/staging/prod separation, and they all
depend on how mission critical your prod is.

Personally, I have different sub domains for each one, place prod under git
only release control, and have dev/staging locked down.

In the settings.py, I then separate the environments out by using
environmental variables. For example:

DJANGO_ENVIRONMENT=prod ./manage.py shell
DJANGO_ENVIRONMENT=dev ./manage.py shell

You can also do auto env detection, based on the current path, by using the
following:


CURRENT_DIR = os.path.dirname(__file__)

if not os.environ.has_key('DJANGO_ENVIRONMENT'):
if CURRENT_DIR.count("/ddcms/dev"):
os.environ['DJANGO_ENVIRONMENT'] = 'dev'

elif CURRENT_DIR.count("/ddcms/prod"):
os.environ['DJANGO_ENVIRONMENT'] = 'prod'

else:
assert os.environ.has_key('DJANGO_ENVIRONMENT'), "Auto environment
resolve failed, you must specify which DJANGO_ENVIRONMENT to use (dev/prod)"

To resolve relative include problems, you can also use this to grab the
current root dir of your project:

# Hard code the root folder for production, due to symlinking resolve
problems.
if os.environ.get('DJANGO_ENVIRONMENT') == 'prod':
PROJECT_PATH = "/ddcms/prod/webapp"
else:
PROJECT_PATH =
os.path.abspath(os.path.dirname(__file__)+"/").replace('\\',"/")

If you need your dev/prod to use the same database source, you can also use
middleware and db routers to control how much damage dev can cause etc.

Cal

On Fri, Jun 3, 2011 at 9:50 PM, AJ  wrote:

> Well even if I do my Python stuff in virtualenv for development on a linode
> box, I'd like to know how to separate development/test environment to
> live/production.
>
> Is the only solution "*...**IP whitelisting to block only those who you
> want to have access...*"?
>
> Also, can I run multiple instances of same Django website on
> dev.website.com, test.website.com and www.website.com?
>
>
>
>
> On Fri, Jun 3, 2011 at 4:28 PM, Shawn Milochik  wrote:
>
>> On 06/03/2011 04:16 PM, Amanjeev Sethi wrote:
>>
>>> Linode looks nice plus it will teach me some administration side too.
>>>
>>> If I try using linode, what is the best setup (Linux Distro, web server
>>> support, modules like mod_wsgi? etc ) for Django websites on linode?
>>>
>>>
>>>
>> Use whatever distro you like and do all your Python stuff in virtualenv.
>>
>> For deployment I use and recommend nginx + gunicorn.
>>
>> Use supervisord to run gunicorn.
>>
>> Shawn
>>
>>
>>
>> --
>> 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.
>>
>>
>
>
> --
> AJ
>
> --
> 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-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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Shawn Milochik

On 06/03/2011 04:50 PM, AJ wrote:
Well even if I do my Python stuff in virtualenv for development on a 
linode box, I'd like to know how to separate development/test 
environment to live/production.


Is the only solution "/...//IP whitelisting to block only those who 
you want to have access.../"?


Also, can I run multiple instances of same Django website on 
dev.website.com , test.website.com 
 and www.website.com ?




Yes, you can run a bunch of instances. To do this I use multiple user 
accounts. It's very easy to configure in nginx even if you only have one 
IP address.


As for the first question, it sounds like IP filtering may be the way, 
because the box is publicly accessible from the Internet. You could do 
something with the INTERNAL_IPS setting in settings.py.


--
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread AJ
Well even if I do my Python stuff in virtualenv for development on a linode
box, I'd like to know how to separate development/test environment to
live/production.

Is the only solution "*...**IP whitelisting to block only those who you want
to have access...*"?

Also, can I run multiple instances of same Django website on dev.website.com,
test.website.com and www.website.com?




On Fri, Jun 3, 2011 at 4:28 PM, Shawn Milochik  wrote:

> On 06/03/2011 04:16 PM, Amanjeev Sethi wrote:
>
>> Linode looks nice plus it will teach me some administration side too.
>>
>> If I try using linode, what is the best setup (Linux Distro, web server
>> support, modules like mod_wsgi? etc ) for Django websites on linode?
>>
>>
>>
> Use whatever distro you like and do all your Python stuff in virtualenv.
>
> For deployment I use and recommend nginx + gunicorn.
>
> Use supervisord to run gunicorn.
>
> Shawn
>
>
>
> --
> 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.
>
>


-- 
AJ

-- 
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Shawn Milochik

On 06/03/2011 04:16 PM, Amanjeev Sethi wrote:

Linode looks nice plus it will teach me some administration side too.

If I try using linode, what is the best setup (Linux Distro, web 
server support, modules like mod_wsgi? etc ) for Django websites on 
linode?





Use whatever distro you like and do all your Python stuff in virtualenv.

For deployment I use and recommend nginx + gunicorn.

Use supervisord to run gunicorn.

Shawn



--
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Amanjeev Sethi
Linode looks nice plus it will teach me some administration side too.

If I try using linode, what is the best setup (Linux Distro, web server
support, modules like mod_wsgi? etc ) for Django websites on linode?




On Fri, Jun 3, 2011 at 2:48 PM, Javier Guerra Giraldez
wrote:

> On Fri, Jun 3, 2011 at 1:12 PM, AJ  wrote:
> > To change the question or ask a new one too: what name do you suggest as
> a
> > good, reliable yet economical hosting provider - Both for personal static
> > website hosting and little Django web projects?
>
> small VPSs tend to be the best answer if you don't mind adminstering
> your own box.  both webfaction and linode have solid reputation and
> support teams.
>
>
> --
> Javier
>
> --
> 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.
>
>


-- 
AJ

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Anton de Winter
If you use something like Firebug you can remove the blur layer and have a
look around (it's the actual site behind the blur).  In Chrome it detected
my location just fine and showed relevant content.  It didn't appear to need
any info from Facebook to function properly.

On Fri, Jun 3, 2011 at 3:50 PM, Doug Ballance  wrote:

> I actually authorized, but got a little creeped out by being asked for
> three cities in which I'd lived before being able to continue.  I
> entered one, but it still wouldn't let me pass without another two.  I
> couldn't conceived of ANY legitimate reason to need anything more than
> my current location aside from data mining, so I cancelled/logged out
> and removed authorization from facebook. Behind the blur it looked
> interesting, but you'll have to convince me you need all that info
> before I'd ever register. I haven't even -lived- in three different
> cities.
>
> --
> 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-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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Doug Ballance
I actually authorized, but got a little creeped out by being asked for
three cities in which I'd lived before being able to continue.  I
entered one, but it still wouldn't let me pass without another two.  I
couldn't conceived of ANY legitimate reason to need anything more than
my current location aside from data mining, so I cancelled/logged out
and removed authorization from facebook. Behind the blur it looked
interesting, but you'll have to convince me you need all that info
before I'd ever register. I haven't even -lived- in three different
cities.

-- 
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Javier Guerra Giraldez
On Fri, Jun 3, 2011 at 1:12 PM, AJ  wrote:
> To change the question or ask a new one too: what name do you suggest as a
> good, reliable yet economical hosting provider - Both for personal static
> website hosting and little Django web projects?

small VPSs tend to be the best answer if you don't mind adminstering
your own box.  both webfaction and linode have solid reputation and
support teams.


-- 
Javier

-- 
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: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread AJ
Thanks Cal.

I have felt that myself. I have about half a dozen websites/domains (mostly
personal and family) hosted with them. I have started Django as my main
stack for web development and have realized that it is not extremely great
as a Django hosting. Also, they do not have phone tech. support.

Currently, I have the plan with Dreamhost which is about $120 per month with
unlimited bandwidth and disk space.

To change the question or ask a new one too: what name do you suggest as a
good, reliable yet economical hosting provider - Both for personal static
website hosting and little Django web projects?

Best,
AJ


On Fri, Jun 3, 2011 at 2:05 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi AJ,
>
> Just a heads up, I have had a few clients in the past who used Dreamhost
> (and I had to set it up for them). They are not exactly the worlds best
> provider, and you certainly wouldn't want to use them for any production
> (live) sites.
>
> But, to answer your original question, you can use IP whitelisting to block
> only those who you want to have access, by adding a rejection rule directly
> into the virtual host config.
>
> Cal
>
> -- Forwarded message --
> From: AJ 
> Date: Fri, Jun 3, 2011 at 7:01 PM
> Subject: Setting up dev/test/production environments on the server
> (dreamhost)
> To: django-users@googlegroups.com
>
>
> Happy Friday to All:
>
> I have a project under way. All this time I have been developing on my
> personal Macbook with Django's dev server. I'd like to push this to the
> hosting service I have from Dreamhost and test, develop, fix it there.
>
> I'd like to know how can I avoid it being visible only to me while I hammer
> things out. It will be nice if I can have a dev instance visible only to me
> and a test/staging where I can showcase it to a few folks and then release
> it to the production. I do not know how to do this.
>
> First I was thinking of creating a subdomain system like dev/test/ etc. but
> Dreamhost uses passenger and I am not sure how to install multiple instances
> of a Django app per domain on Dreamhost either.
>
> What are you suggestions? Please feel free to point me to earlier
> discussions or articles or tools that I can use to achieve this.
>
> Thanks a lot.
> AJ
>
> --
> 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.
>
>


-- 
AJ

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



Fwd: Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread Cal Leeming [Simplicity Media Ltd]
Hi AJ,

Just a heads up, I have had a few clients in the past who used Dreamhost
(and I had to set it up for them). They are not exactly the worlds best
provider, and you certainly wouldn't want to use them for any production
(live) sites.

But, to answer your original question, you can use IP whitelisting to block
only those who you want to have access, by adding a rejection rule directly
into the virtual host config.

Cal

-- Forwarded message --
From: AJ 
Date: Fri, Jun 3, 2011 at 7:01 PM
Subject: Setting up dev/test/production environments on the server
(dreamhost)
To: django-users@googlegroups.com


Happy Friday to All:

I have a project under way. All this time I have been developing on my
personal Macbook with Django's dev server. I'd like to push this to the
hosting service I have from Dreamhost and test, develop, fix it there.

I'd like to know how can I avoid it being visible only to me while I hammer
things out. It will be nice if I can have a dev instance visible only to me
and a test/staging where I can showcase it to a few folks and then release
it to the production. I do not know how to do this.

First I was thinking of creating a subdomain system like dev/test/ etc. but
Dreamhost uses passenger and I am not sure how to install multiple instances
of a Django app per domain on Dreamhost either.

What are you suggestions? Please feel free to point me to earlier
discussions or articles or tools that I can use to achieve this.

Thanks a lot.
AJ

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



Setting up dev/test/production environments on the server (dreamhost)

2011-06-03 Thread AJ
Happy Friday to All:

I have a project under way. All this time I have been developing on my
personal Macbook with Django's dev server. I'd like to push this to the
hosting service I have from Dreamhost and test, develop, fix it there.

I'd like to know how can I avoid it being visible only to me while I hammer
things out. It will be nice if I can have a dev instance visible only to me
and a test/staging where I can showcase it to a few folks and then release
it to the production. I do not know how to do this.

First I was thinking of creating a subdomain system like dev/test/ etc. but
Dreamhost uses passenger and I am not sure how to install multiple instances
of a Django app per domain on Dreamhost either.

What are you suggestions? Please feel free to point me to earlier
discussions or articles or tools that I can use to achieve this.

Thanks a lot.
AJ

-- 
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: Circular import on every backend except sqlite

2011-06-03 Thread Gloria W
I found it. Someone else on the machine had replaced mod_wsgi with a
2.6 variant they compiled. I am using one I compiled for 2.7.1.
Nasty things happen when the mod_wsgi module doesn't match the python
version one's running.
What a P.I.T.A. to find.

Gloria

On Jun 2, 9:11 am, Tom Evans  wrote:
> On Thu, Jun 2, 2011 at 12:44 PM, Gloria W  wrote:
> > I am experiencing this:
> >https://code.djangoproject.com/ticket/16136
> > and the only way I can prevent it is by using sqlite.
> > Does anyone have a patch for this, or more info?
> > Thank you in advance,
> > Gloria
>
> WFM, + everyone else. Reinstall django, I don't believe (looking at
> that ticket) that it is installed properly.
>
> 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-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: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Rob
Well that worked but I'm not happy about it.  I have the following:

from logging.handlers import SysLogHandler

...

'syslog':{
'level':'DEBUG',
'class': 'logging.handlers.SysLogHandler',
'formatter': 'verbose',
'facility': SysLogHandler.LOG_LOCAL2,
},

If I specify 'class' as SysLogHandler instead of
'logging.handlers.SysLogHandler' I get an error:

ValueError: Unable to configure handler 'syslog': class SysLogHandler
has no attribute 'split'

If I just import logging and use
logging.handlers.SysLogHandler.LOG_LOCAL2 I get another error:

AttributeError: 'module' object has no attribute 'handlers'

Very bizarre behaviour all around but I'm up and running.  Thanks for
everybody's help!

On Jun 3, 11:14 am, Piotr Zalewa  wrote:
> In Add-ons Builder I've got something like this in log_settings.py
>
> https://github.com/mozilla/FlightDeck/blob/master/log_settings.py
>
>      'handlers': {
>          'syslog': {
>              '()': logging.handlers.SysLogHandler,
>              'facility': logging.handlers.SysLogHandler.LOG_LOCAL7,
>              'formatter': 'prod',
>          },
>      }
>
> It depends on the commonware, but I guess it's nothing there regarding
> logging to the SysLoghttps://github.com/jsocol/commonware/
>
> Good luck
> zalun
>
> On 06/03/11 16:02, Rob wrote:
>
>
>
> > Thanks, but this doesn't help at all.  I have no problem getting the
> > RotatingFileHandler working, it is documented albeit poorly, but the
> > SysLogHandler isn't documented at all and doesn't work the same way.
>
> > The SysLogHandler actually has to connect to syslogd and log to a
> > syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
> > those
> > options?
>
> > Rob.
>
> > On Jun 1, 12:41 pm, Shawn Milochik  wrote:
> >> This should help out. It's for a file, not SysLogHandler, but the idea
> >> is the same.
>
> >> Just take any arguments you would normally pass to the handler if you
> >> were creating it programmatically and add them as keys to the dictionary:
>
> >>           'log_file': {
> >>               'level': 'DEBUG',
> >>               'class': 'logging.handlers.RotatingFileHandler',
> >>               'filename': '/tmp/myfilename.log',
> >>               'formatter': 'verbose',
> >>               'backupCount': 50,
> >>               'maxBytes': 2 ** 20,
> >>           },
>
> >> As demonstrated here, filename, backupCount, and maxBytes (used by the
> >> RotatingFileHandler but not in Django's default logging dict) were just
> >> added and given values. Do the same for SysLogHandler parameters and it
> >> should work.
>
> >> I had the same difficulty you were having in figuring this out; we
> >> should update the documentation to mention this. I'll open a ticket.
>
> >> Shawn

-- 
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: save out a test database?

2011-06-03 Thread Steve Bywater
What I've done to do this is insert a pdb.set_trace() right before the
place your test fails, then in pdb do Ctrl+C to break out of the test.
This leaves your test database intact at that state. Then you can
change your settings to point to the test database instead of your
regular one. Then you can runserver or dumpdata etc..

Good luck!
- Steve Bywater

-- 
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: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Piotr Zalewa

In Add-ons Builder I've got something like this in log_settings.py

https://github.com/mozilla/FlightDeck/blob/master/log_settings.py

'handlers': {
'syslog': {
'()': logging.handlers.SysLogHandler,
'facility': logging.handlers.SysLogHandler.LOG_LOCAL7,
'formatter': 'prod',
},
}

It depends on the commonware, but I guess it's nothing there regarding 
logging to the SysLog

https://github.com/jsocol/commonware/

Good luck
zalun

On 06/03/11 16:02, Rob wrote:

Thanks, but this doesn't help at all.  I have no problem getting the
RotatingFileHandler working, it is documented albeit poorly, but the
SysLogHandler isn't documented at all and doesn't work the same way.

The SysLogHandler actually has to connect to syslogd and log to a
syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
those
options?

Rob.

On Jun 1, 12:41 pm, Shawn Milochik  wrote:

This should help out. It's for a file, not SysLogHandler, but the idea
is the same.

Just take any arguments you would normally pass to the handler if you
were creating it programmatically and add them as keys to the dictionary:

  'log_file': {
  'level': 'DEBUG',
  'class': 'logging.handlers.RotatingFileHandler',
  'filename': '/tmp/myfilename.log',
  'formatter': 'verbose',
  'backupCount': 50,
  'maxBytes': 2 ** 20,
  },

As demonstrated here, filename, backupCount, and maxBytes (used by the
RotatingFileHandler but not in Django's default logging dict) were just
added and given values. Do the same for SysLogHandler parameters and it
should work.

I had the same difficulty you were having in figuring this out; we
should update the documentation to mention this. I'll open a ticket.

Shawn




--
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: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Rob
Thanks, but this doesn't help at all.  I have no problem getting the
RotatingFileHandler working, it is documented albeit poorly, but the
SysLogHandler isn't documented at all and doesn't work the same way.

The SysLogHandler actually has to connect to syslogd and log to a
syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
those
options?

Rob.

On Jun 1, 12:41 pm, Shawn Milochik  wrote:
> This should help out. It's for a file, not SysLogHandler, but the idea
> is the same.
>
> Just take any arguments you would normally pass to the handler if you
> were creating it programmatically and add them as keys to the dictionary:
>
>          'log_file': {
>              'level': 'DEBUG',
>              'class': 'logging.handlers.RotatingFileHandler',
>              'filename': '/tmp/myfilename.log',
>              'formatter': 'verbose',
>              'backupCount': 50,
>              'maxBytes': 2 ** 20,
>          },
>
> As demonstrated here, filename, backupCount, and maxBytes (used by the
> RotatingFileHandler but not in Django's default logging dict) were just
> added and given values. Do the same for SysLogHandler parameters and it
> should work.
>
> I had the same difficulty you were having in figuring this out; we
> should update the documentation to mention this. I'll open a ticket.
>
> Shawn

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Piotr Zalewa

+1k - just wanted to write the same message

On 06/03/11 14:39, Rob wrote:

I spent a few seconds looking for the X to close the sign up panel
before
seeing this:

"LOCQL is a social Q service, so we need you to sign in instead of
browse anonymously."

But I *always* browse anonymously first to see if a site is something
I want to use and/or trust with any info about me; if I like it I
will sign up.

I'd like to provide feedback but the first thing you want me to do,
before even looking at the site, is give you my facebook info?
Ummm ... no.  So the only feedback I have is get rid of that "*we're*
social so *you* have to share" attitude.

Rob.

On Jun 2, 3:02 am, maverick  wrote:

We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
and run on GAE has just went live!

I would say development with Django is purely enjoyable experience,
however the Google Apps Engine does bring us some headache esp. we are
a location based service, the geo-location related search is a
challenge for us.

I would like everyone who use Django to give us a try and feedback are
warmly welcome!




--
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: Pre-deployment steps for Django apps?

2011-06-03 Thread i...@webbricks.co.uk
add the sitemap app in.
add robots.txt line.

then hook it up to google webmasters tools...

would love to hear what others do...

On Jun 3, 1:28 am, shantp  wrote:
> Hi all,
>
> I am almost ready to make my app live. I am curious what steps you all take
> while getting your app ready to deploy.
>
> Other than setting DEBUG=False, what steps do you take with your app? Any
> reusable apps you add? Are there extra things I need to do for security?
>
> I'm not asking for deployment instructions because I know that has been
> talked to death, I'm more interested in things to do before deploying.

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread MAST3R
+1

On Jun 3, 12:06 am, CareerDhaba tech  wrote:
> Cool looking site, but it would be useful to allow people to browse the site
> a bit before having to register.
>
>
>
>
>
>
>
> On Fri, Jun 3, 2011 at 9:45 AM, Gath  wrote:
> > Great stuff!! Thumbs up.
>
> > I like the concept!
>
> > Please share you knowledge on how you did the Django/GAE integration.
>
> > Gath
>
> > On Jun 2, 10:02 am, maverick  wrote:
> > > We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> > > and run on GAE has just went live!
>
> > > I would say development with Django is purely enjoyable experience,
> > > however the Google Apps Engine does bring us some headache esp. we are
> > > a location based service, the geo-location related search is a
> > > challenge for us.
>
> > > I would like everyone who use Django to give us a try and feedback are
> > > warmly welcome!
>
> > --
> > 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-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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Rob
I spent a few seconds looking for the X to close the sign up panel
before
seeing this:

"LOCQL is a social Q service, so we need you to sign in instead of
browse anonymously."

But I *always* browse anonymously first to see if a site is something
I want to use and/or trust with any info about me; if I like it I
will sign up.

I'd like to provide feedback but the first thing you want me to do,
before even looking at the site, is give you my facebook info?
Ummm ... no.  So the only feedback I have is get rid of that "*we're*
social so *you* have to share" attitude.

Rob.

On Jun 2, 3:02 am, maverick  wrote:
> We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> and run on GAE has just went live!
>
> I would say development with Django is purely enjoyable experience,
> however the Google Apps Engine does bring us some headache esp. we are
> a location based service, the geo-location related search is a
> challenge for us.
>
> I would like everyone who use Django to give us a try and feedback are
> warmly welcome!

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

2011-06-03 Thread Kann
Thanks, it works now. :D

On Jun 3, 2:14 pm, Kenneth Gonsalves  wrote:
> On Fri, 2011-06-03 at 05:07 -0700, Kann wrote:
> > > you have a file called mirnaweb.py - your path should contain only
> > the
> > > parent directory to your mirnaweb directory. Python is now looking
> > for
> > > settings inside mirnaweb.py
>
> > OK, now I changed the setting file into mirna_settings.py to avoid the
> > confusion with the directory name. I also include the new setting file
> > to django.wsgi file and telling the sys.path to append the new
> > PYTHONPATH. I wonder why Python still could not see the modules inside
> > my django project.
>
> > Also, I tried running the "python manage.py shell" again and it's
> > still looking for the "settings.py". Why is that?
>
> rename your mirnaweb.py file and change your settings file back to
> settings.py
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread mad_casual
On Jun 2, 4:05 am, Tom Evans  wrote:

> options for people who don't want to share their life with Zuckerberg.

Or for people who care about a location for the location's sake rather
than their friends' opinions of it. Unless I'm travelling with or to
friends or people I know their input is pretty hit or miss anyway.

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

2011-06-03 Thread Kenneth Gonsalves
On Fri, 2011-06-03 at 05:07 -0700, Kann wrote:
> > you have a file called mirnaweb.py - your path should contain only
> the
> > parent directory to your mirnaweb directory. Python is now looking
> for
> > settings inside mirnaweb.py
> 
> OK, now I changed the setting file into mirna_settings.py to avoid the
> confusion with the directory name. I also include the new setting file
> to django.wsgi file and telling the sys.path to append the new
> PYTHONPATH. I wonder why Python still could not see the modules inside
> my django project.
> 
> Also, I tried running the "python manage.py shell" again and it's
> still looking for the "settings.py". Why is that? 

rename your mirnaweb.py file and change your settings file back to
settings.py
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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

2011-06-03 Thread Kann
> you have a file called mirnaweb.py - your path should contain only the
> parent directory to your mirnaweb directory. Python is now looking for
> settings inside mirnaweb.py

OK, now I changed the setting file into mirna_settings.py to avoid the
confusion with the directory name. I also include the new setting file
to django.wsgi file and telling the sys.path to append the new
PYTHONPATH. I wonder why Python still could not see the modules inside
my django project.

Also, I tried running the "python manage.py shell" again and it's
still looking for the "settings.py". Why is that?

Kann

On Jun 3, 1:56 pm, Kenneth Gonsalves  wrote:
> On Fri, 2011-06-03 at 04:44 -0700, Kann wrote:
> > Below is what I just did. Does this mean that I still have problem
> > with my pythonpath?
>
> yes
>
>
>
> > [xxx@lagrange mirnaweb]$ python manage.py
> > Error: Can't find the file 'settings.py' in the directory containing
> > 'manage.py'. It appears you've customized things.
> > You'll have to run django-admin.py, passing it your settings module.
> > (If the file settings.py does indeed exist, it's causing an
> > ImportError somehow.)
>
> you have a file called mirnaweb.py - your path should contain only the
> parent directory to your mirnaweb directory. Python is now looking for
> settings inside mirnaweb.py
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

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

2011-06-03 Thread Kenneth Gonsalves
On Fri, 2011-06-03 at 04:44 -0700, Kann wrote:
> Below is what I just did. Does this mean that I still have problem
> with my pythonpath?

yes
> 
> [xxx@lagrange mirnaweb]$ python manage.py
> Error: Can't find the file 'settings.py' in the directory containing
> 'manage.py'. It appears you've customized things.
> You'll have to run django-admin.py, passing it your settings module.
> (If the file settings.py does indeed exist, it's causing an
> ImportError somehow.)

you have a file called mirnaweb.py - your path should contain only the
parent directory to your mirnaweb directory. Python is now looking for
settings inside mirnaweb.py
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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

2011-06-03 Thread Kann
Hi Kenneth,

Below is what I just did. Does this mean that I still have problem
with my pythonpath?

[xxx@lagrange mirnaweb]$ python manage.py
Error: Can't find the file 'settings.py' in the directory containing
'manage.py'. It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an
ImportError somehow.)


[xxx@lagrange mirnaweb]$ django-admin.py shell
Error: Could not import settings 'mirnaweb' (Is it on sys.path? Does
it have syntax errors?): No module named mirnaweb


[xxx@lagrange mirnaweb]$ django-admin.py shell --settings='mirnaweb' --
pythonpath='/srv/mirnaweb'
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import urls
>>>


Kann



On Jun 3, 1:16 pm, Kenneth Gonsalves  wrote:
> On Fri, 2011-06-03 at 04:11 -0700, Kann wrote:
> > [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No
> > module named urls
>
> no module named urls can also mean that urls.py has errors. From the
> shell try to import urls
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

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

2011-06-03 Thread Kenneth Gonsalves
On Fri, 2011-06-03 at 04:11 -0700, Kann wrote:
> [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No
> module named urls 

no module named urls can also mean that urls.py has errors. From the
shell try to import urls
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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



ImportError: No module named urls

2011-06-03 Thread Kann
Dear all,

Thanks so much for help me with the $DJANGO_SETTINGS_MODULE issue. Now
I just installed the wsgi module and try to use apache 2.2.17 to host
the django project. However, the page always throws error. I checked
the log file and it says there's no module named urls. Seems like
python could not find the 'urls.py' inside my django project
directory. Does this mean that I still haven't got my
$DJANGO_SETTINGS_MODULE set up properly. Below is the error and how I
set the django.wsgi file.


>>
[Fri Jun 03 13:04:28 2011] [notice] SIGHUP received.  Attempting to
restart
[Fri Jun 03 13:04:28 2011] [notice] Digest: generating secret for
digest authentication ...
[Fri Jun 03 13:04:28 2011] [notice] Digest: done
[Fri Jun 03 13:04:28 2011] [notice] Apache/2.2.17 (Unix) DAV/2 PHP/
5.3.6 mod_wsgi/3.2 Python/2.7 mod_perl/2.0.4 Perl/v5.12.3 configured
-- resuming normal operations
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] mod_wsgi
(pid=14389): Exception occurred processing WSGI script '/srv/mirnaweb/
apache/django.wsgi'.
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/handlers/wsgi.py", line 248, in
__call__
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] response =
self.get_response(request)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/handlers/base.py", line 141, in
get_response
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] return
self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/handlers/base.py", line 176, in
handle_uncaught_exception
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] if
resolver.urlconf_module is None:
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/urlresolvers.py", line 239, in
_get_urlconf_module
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]
self._urlconf_module = import_module(self.urlconf_name)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/utils/importlib.py", line 35, in
import_module
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]
__import__(name)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No
module named urls




import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'mirnaweb'

import django.core.handlers.wsgi

path = '/srv/mirnaweb'
if path not in sys.path:
sys.path.append(path)

application = django.core.handlers.wsgi.WSGIHandler()

>>
the content of my django project is as below:
>>>
[@yy mirnaweb]$ ls
apache   __init__.pyc  mediamirnaweb.pycscripts
tmp  urls.pyc
__init__.py  manage.py mirnaweb.py  mirnaworkbench  template
test.txt  urls.py

-- 
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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-03 Thread Kann
Thanks all, that cleared up a lot of my confusions and gave me a
really good lesson. Now I am facing a new problem and will post a new
topic then.

Kann

On Jun 2, 2:41 pm, Kenneth Gonsalves  wrote:
> On Thu, 2011-06-02 at 05:29 -0700, Kann wrote:
> > Thanks Oscar, I read the page already, but am still not totally
> > understood. The page said the value of DJANGO_SETTINGS_MODULE should
> > be "Python path syntax", e.g.  mysite.settings. What exactly is
> > "Python path syntax"? Would it be ok if I just provide the value as a
> > file name? Perhaps, "new_setting.py"?
>
> assume that you have a directory called 'mysite'. In this directory you
> will have to have an empty file called __init__.py. Then any file in
> that directory with a 'py' extension can be imported leaving out the
> extension. For example, foo.py can be imported as mysite.foo instead of
> mysite/foo. For this to work, 'mysite' should be on the python path.
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: Reasons to use managers

2011-06-03 Thread Marc Aymerich
On Fri, Jun 3, 2011 at 11:29 AM, Marc Aymerich  wrote:
> On Fri, Jun 3, 2011 at 8:30 AM, Amit Sethi  wrote:
>>> functionality to your models. (For "row-level" functionality -- i.e.,
>>> functions that act on a single instance of a model object -- use Model
>>> methods, not custom Manager methods.)
>>>
>>
>> But what is the benefit of model methods compared to adding an extra
>> field and getting almost the same thing done
>>
>
> Maybe the result value depends on some parameters, If you use the DB
> field approach, and you want to keep up to date these values, you need
> to execute some expensive "regenerator" method each time that one of
> these parameters change, with Managers you don't need to do anything.
>
> If you use DB approach you need to populate these extra fields every
> time that a new object is saved, and maybe never uses it.

Realise that you need to update the field every time that an object is
updated. So at the end, if you compare all the time needed to keep
updated this field and all the time used by the Manager to generate
it, most of the time will be the manager who uses less time.




-- 
Marc

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



Announcing django-modeltranslation-0.3

2011-06-03 Thread Dirk Eschler
Hello,

i'm pleased to announce the 0.3 release of django-modeltranslation, a Django 
app used to translate dynamic content of existing models to an arbitrary 
number of languages without having to change the original model classes.

It uses a registration approach (comparable to Django’s admin app) to be able 
to add translations to existing or new projects and is fully integrated into 
the Django admin backend.

Alongside bugfixes and some refactoring, this release adds new features like 
support for multi-table inheritance and tabbed translation fields in the admin 
using jquery-ui. This is really a community release, thanks for all the help, 
bug reports and patches.

Source download:
http://django-modeltranslation.googlecode.com/files/django-
modeltranslation-0.3.tar.gz

For a full changelog, downloads and docs, please visit the project page:
http://code.google.com/p/django-modeltranslation/

Best Regards,
Dirk Eschler

-- 
Dirk Eschler 

-- 
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: Reasons to use managers

2011-06-03 Thread Marc Aymerich
On Fri, Jun 3, 2011 at 8:30 AM, Amit Sethi  wrote:
>> functionality to your models. (For "row-level" functionality -- i.e.,
>> functions that act on a single instance of a model object -- use Model
>> methods, not custom Manager methods.)
>>
>
> But what is the benefit of model methods compared to adding an extra
> field and getting almost the same thing done
>

Maybe the result value depends on some parameters, If you use the DB
field approach, and you want to keep up to date these values, you need
to execute some expensive "regenerator" method each time that one of
these parameters change, with Managers you don't need to do anything.

If you use DB approach you need to populate these extra fields every
time that a new object is saved, and maybe never uses it.

if in the future you want to change the logic of your app and then you
don't want this value anymore, you may have a problem if it is a db
field..

-- 
Marc

-- 
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: Reasons to use managers

2011-06-03 Thread Mike
My take is that you can have record-centric logic that can either be
put in one place (tucked away in the appropriate model) ... or spread
out across the codebase.  Sounds analogous to standard OOP concepts.

-- 
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: Reasons to use managers

2011-06-03 Thread Amit Sethi
> functionality to your models. (For "row-level" functionality -- i.e.,
> functions that act on a single instance of a model object -- use Model
> methods, not custom Manager methods.)
>

But what is the benefit of model methods compared to adding an extra
field and getting almost the same thing done

-- 
A-M-I-T S|S

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