Hi Simon,
Simon Lee schrieb:
> Thank you for being patient in helping me out.
>
> I checked it /etc/passwd and found this line which I think is the
> reference for UID 70
>
> _www:*:70:70:World Wide Web Server:/Library/WebServer:/usr/bin/false
>
> I did "su - _www" (I hope I did this right).
You might have alook at the saas kit which is availble on github,
which does subscription billing, subdomain handling and multi user
accounts. You could then write a decorator to wrap any db request to
perform a test to check that only rows that are linked to that
requesting user are returned or s
I missed a step - I did go ahead and chown it over to www-data, but I
needed to chmod x to u.
sudo chmod u+x uploads/
I thought 777 would be a little insecure, you really don't need to
give full permissions to group / others. I know it's probably not a
huge deal, but I figure it's best practices
On Sunday 23 August 2009 06:48:33 pm The Danny Bos wrote:
> Hey, so I've got this code to quickly create thumbnail files, below.
> When I give it a value, it squishes the image to those dimensions, I'm
> hoping to keep the correct proportions of a book instead of cropping
> to a square or squashing
Hey, so I've got this code to quickly create thumbnail files, below.
When I give it a value, it squishes the image to those dimensions, I'm
hoping to keep the correct proportions of a book instead of cropping
to a square or squashing.
Mainly as books can be portrait, landscape or square. So keep
Much nicer.
Thanks so much Mike ...
d
On Aug 24, 12:17 pm, Mike Ramirez wrote:
> On Sunday 23 August 2009 05:36:13 pm The Danny Bos wrote:
>
>
>
>
>
> > Hey there, I've got the below code.
> > Can someone help me fill in the gaps to rename the image to the
> > 'SLUG'?
>
> > In the end I'm ho
On Sunday 23 August 2009 05:36:13 pm The Danny Bos wrote:
> Hey there, I've got the below code.
> Can someone help me fill in the gaps to rename the image to the
> 'SLUG'?
>
> In the end I'm hoping for images like so:
>
> ...com/books/book-title.jpg
> ...com/books/thumbs/book-title.jpg
>
> Here's
And what about doing the same way the Comment application (bundled
with Django) works?
I think that looking the way Comment app works could inspire you
On Aug 24, 12:39 am, Richard Marko wrote:
> Simple approach for this is to use try catch block to create proper
> field like this:
>
> from dja
Worked this one out.
For anyone interested ...
def save(self):
super(Book, self).save()
file_ext = os.path.splitext(str(self.cover.name))[1]
new_filename = '%s%s' % (self.slug, file_ext)
new_filepath = os.path.join(settings.MEDIA_ROOT, new_filename)
old_f
Hey there, I've got the below code.
Can someone help me fill in the gaps to rename the image to the
'SLUG'?
In the end I'm hoping for images like so:
...com/books/book-title.jpg
...com/books/thumbs/book-title.jpg
Here's my save() definition from models.py:
def save(self):
super(Book,
Simple approach for this is to use try catch block to create proper
field like this:
from django.db import models
try:
from photos.models import Photo
photo_field = models.ManyToManyField(Photo)
except ImportError:
photo_field = None
class Standalone(models.Model):
Hi all,
I have a very strange behaviour. I have an upload form like this:
var upform = document.createElement('form');
upform.setAttribute('action','/engine/users/avatar/');
upform.setAttribute('enctype','multipart/form-data');
upform.setAttribute('method','post');
created dynamically with JS.
W
Hi:
Yet again, I've run into a behavior change which seems to be linked to
svn revision 10190. I've figured out a workaround for my code, but
I'm wondering if someone could provide some feedback if the change is
just a definition of previously undefined behavior, or a bug.
I've pasted some demo
Is there a Django app that helps with handling multitenancy, that is,
having a single website and a single database serving multiple
organizations in a software-as-a-service fashion while avoiding one
tenant to interact with another's data?
I'm talking about the "Shared database, shared schema" s
You need to remove the references on one side or the other. You need to make
a choice. will events manage photos, or will photos manage events, and so
on. Then if events manage photos, you need to remove all references to
events from the photos app.
It sounds like it will take some reworking of you
Seems to be working now.
Thanks.
On 23 Aug, 18:28, When ideas fail wrote:
> I changed it to post_img.url but i assume thats a different way of
> doing the same thing.
>
> 1.The html source gives the image location as "http://www.mysite.net/
> content/imgs/newMessage.jpg"
>
> 2. I am using a Req
> The raw SQL is something along the lines of "INSERT INTO backup SELECT
> * FROM today; DELETE FROM today;".
>
> Is there a Django way of doing this? I would required something
> similiar to this:
> todays_records = Today.objects.all()
> for record in todays_records:
> Backup.objects.create(
I did find a nice sidewide middleware login system which takes care of one
aspect of my 'problem'. http://www.djangosnippets.org/snippets/1158/
Not completely to my taste, because it (me?) requires some css file in
PUBLIC_URLS. Figured I'd start on the manual @login_required for now to get
som
Hi, thanks for the reply.
ImageWithThumbsField is custom field which extends ImageField. It
creates a thumbnail. I am using it in my model definition, nothing to
do with a form. syncdb is ignoring this field when it creates the
table completely.
On 23 Aug, 18:39, Daniel Roseman wrote:
> On Aug
On Thu, Aug 20, 2009 at 2:19 PM, ringemup wrote:
>
> I'm running the test listed below, and the test client is submitting a
> request to /test2/ despite the follow=False parameter in
> self.client.get() -- am I doing something stupid?
>
>def test_child_redirect(self):
>re
Hi, thanks for the reply.
ImageWithThumbsField is custom field which extends ImageField. It
creates a thumbnail. I am using it in my model definition, nothing to
do with a form. syncdb is ignoring this field when it creates the
table completely.
On 23 Aug, 18:39, Daniel Roseman wrote:
> On Aug
Hello,
I have a MySQL table that gets cleared in the morning, populated
during the day, appended onto a backup table and the contents then
deleted.
The raw SQL is something along the lines of "INSERT INTO backup SELECT
* FROM today; DELETE FROM today;".
Is there a Django way of doing this? I wo
On Aug 23, 3:44 pm, Hanpan wrote:
> Hi,
>
> I have created a custom field type, which I am using like so:
>
> image_thumb = ImageWithThumbsField(_('preview image'),
> upload_to='uploads/projects')
>
> But for some reason, when I run syncdb this custom field is being
> completely ignored. I tried
I changed it to post_img.url but i assume thats a different way of
doing the same thing.
1.The html source gives the image location as "http://www.mysite.net/
content/imgs/newMessage.jpg"
2. I am using a RequestContext.
Its an apache server and these are the related directives:
SetHandler No
I changed it to post_img.url but i assume thats a different way of
doing the same thing.
1.The html source gives the image location as "http://www.mysite.net/
content/imgs/newMessage.jpg"
2. I am using a RequestContext.
Its an apache server and these are the related directives:
SetHandler No
On Sun, 2009-08-23 at 06:54 -0700, When ideas fail wrote:
> Hello, i'm having a problem getting images to display so I was
> wondering if someone would be kind enough to help?
>
> I have my settings.py set up as follows (content is the folder where
> my static images are stored):
>
> MEDIA_ROOT
or another words can I use a Q object in a model manager?
On Aug 23, 12:05 am, CrabbyPete wrote:
> I have the following code in model manager
>
> class SpotMessageManager(models.Manager):
>
> def for_user(self, user, start = 0, end = None, friends ):
> messages = self.filter(us
Hi,
I have created a custom field type, which I am using like so:
image_thumb = ImageWithThumbsField(_('preview image'),
upload_to='uploads/projects')
But for some reason, when I run syncdb this custom field is being
completely ignored. I tried using the 'widget' argument, but that
caused an er
On Sun, Aug 23, 2009 at 3:54 PM, When ideas
fail wrote:
>
> Hello, i'm having a problem getting images to display so I was
> wondering if someone would be kind enough to help?
>
> I have my settings.py set up as follows (content is the folder where
> my static images are stored):
>
> MEDIA_ROOT =
Hello, i'm having a problem getting images to display so I was
wondering if someone would be kind enough to help?
I have my settings.py set up as follows (content is the folder where
my static images are stored):
MEDIA_ROOT = '/home/mysite/content/'
MEDIA_URL = 'http://www.mysites.net/content/'
On Sat, Aug 22, 2009 at 12:24 PM, ringemup wrote:
>
> Has anyone here ever written an application that needed to be able to
> take a date field where the month or day was sometimes but not always
> known? How would you handle this? Using separate day/month/year
> fields instead of a DateField s
Daniel is right on. And for future reference, it says "3 arguments"
which may seem misleading, but keep in mind that the cursor object
itself is the first argument.
On Aug 22, 4:14 pm, kevin wrote:
> cursor.execute("SELECT a,b,c FROM Table_Name WHERE a = %s AND b = %s ",
> [string1],[string2])
chowning www-data will work. Make sure the directory has chown -R and chmod
-R,
suppose you are uploading to media/images
chown -R www-data media/images
chmod -R 777 media/images
On Sun, Aug 23, 2009 at 11:17 AM, Anogar wrote:
>
> I'm trying to implement a simple image upload inside my blog,
I'm trying to implement a simple image upload inside my blog, and I
had it working on my local machine, but when I deployed it threw this
error:
OSError at /path/
(13, 'Permission denied')
So, it's clearly a permissions issue - but I can't quite figure out
how to fix it. Just to confirm my
I'm intrested in the answer too
On Aug 23, 1:36 am, "Chris H." wrote:
> So I'm trying to get my head around making my small, tightly focused
> apps reusable. I've done this, but right now still have
> "dependencies" between one another, that I'd like to remove. For
> simplicity sake, I have an
On Aug 22, 9:14 pm, kevin wrote:
> cursor.execute("SELECT a,b,c FROM Table_Name WHERE a = %s AND b = %s ",
> [string1],[string2])
>
> gives me the following error:
>
> TypeError: execute() takes at most 3 arguments (4 given)
>
> Where did i go wrong?
You have got string1 and string2 in separate
On Sun, Aug 23, 2009 at 11:23 AM, Victor Hooi wrote:
>
> heya,
>
> I've got a small project involving an ordering system web application.
> One of the requirements is offline functionality (i.e. it will
> function without a direct internet connection, at least on a limited
> scale - e.g. they can
37 matches
Mail list logo