Re: point url with folder to s3

2011-11-13 Thread Justin Steward
On Mon, Nov 14, 2011 at 8:47 AM, ydjango wrote: > I have all my static being served from https://www.example.com/media/ > > in my code I have all images pointing to /media all over the code. > for example: > > Is there a way I can point it to use S3 and cloudfront to serve

Re: Namespace Security

2010-01-12 Thread Justin Steward
I had a similar requirement for a current project. Users in the admin needed to be able to see ONLY the objects that they had created. My solution was: 1) http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser 2) Add foreign key to model to track which user created the object. 3) Use the

Re: why does if statement fail with

2010-01-08 Thread Justin Steward
On Fri, Jan 8, 2010 at 1:25 PM, Biju Varghese wrote: > if statement in template language checks only whether the variable is > empty or not... > comparison can be done with other variants of if such as ifequals > ifnotequal etc... > OP is using django 1.2.

Re: Django Tutorial 1.1: Viewing SQLite3 tables

2010-01-07 Thread Justin Steward
On Fri, Jan 8, 2010 at 10:50 AM, wormser17 wrote: >        mlooby$ sqlite3 >        SQLite version 3.6.12 >        Enter ".help" for instructions >        Enter SQL statements terminated with a ";" >        sqlite> .schema >        sqlite> .schema; >        unknown command

Re: Custom Django-Admin commands

2009-12-22 Thread Justin Steward
On Tue, Dec 22, 2009 at 3:24 PM, Bill Freeman wrote: > If you are calling this from, for example, crontab note that each line > in crontab is executed in its own subshell, so you have the choice of > setting PYTHONPATH, or (my personal favorite because it works with so > many

Re: Custom Django-Admin commands

2009-12-22 Thread Justin Steward
I'm at a loss as to understand why, but I've worked out what I need to add to pythonpath. PYTHONPATH=/home/user i.e. The pythonpath needs to include NOT the project's root, but the directory one level ABOVE that for custom commands to work properly... Thanks for the help guys. ~Justin -- You

Re: Custom Django-Admin commands

2009-12-21 Thread Justin Steward
On Tue, Dec 22, 2009 at 3:51 PM, Alex_Gaynor wrote: > > Do you have __init__.py files in each of those directories? Of course - Else it woud not work from the project's root directory either. ~Justin -- You received this message because you are subscribed to the Google

Re: Custom Django-Admin commands

2009-12-21 Thread Justin Steward
On Tue, Dec 22, 2009 at 12:16 PM, Doug Blank wrote: > > You probably just need to set your PYTHONPATH: > > cd /home/user > PYTHONPATH=proj python proj/manage.py custom > That was my initial thought too, however setting the PYTHONPATH does not affect the behaviour in this

Custom Django-Admin commands

2009-12-21 Thread Justin Steward
Hi all, I've written a custom command to use with manage.py, and from the root of the project directory, it works great. But the problem is, this command is almost never going to be called from within the project directory. (hoping the spacing doesn't get too mangled when I send this) /home/

Re: Initial snag with the "Django Book"

2009-12-16 Thread Justin Steward
On Thu, Dec 17, 2009 at 12:26 PM, nodxof wrote: > I've just started learning django using "The Definitive Guide to > django" second edition. > > Going by the initial  example in Chapter 3 I get this. > > Page not found (404) > Request Method: GET > Request URL:    

Re: FK to an Abstract class? Alternative?

2009-12-16 Thread Justin Steward
On Wed, Dec 16, 2009 at 5:21 AM, Victor Hooi wrote: >    class ExaminationRecord(models.Model): >        assessment = models.OneToOneField(AssessmentTask) I don't particularly understand the point of this class? ~Justin -- You received this message because you are

Re: can any on help me how to create a sample model project.

2009-12-16 Thread Justin Steward
On Wed, Dec 16, 2009 at 5:53 AM, chiranjeevi muttoju wrote: > hi as i said that i had installed the mysql in other machine. when i > installing the python-mysql connector using the command > python setup.py build > At a wild guess, not knowing what you've got installed

Custom User Model, Django Admin, and the password field

2009-12-02 Thread Justin Steward
Hi, I've created a custom user model in my application by subclassing django.contrib.auth.models.User. This user model is working, but there are a couple of problems I have with it. 1) The change password link in the admin site doesn't work? 2) The default password box on the add/edit page for