Re: two django sites at different revisions with apache

2015-02-03 Thread James Schneider
I don't see why not. For Apache, you would just place the
relevant WSGIScriptAlias and WSGIPythonPath inside of your VirtualHost
elements. You would need to be cautious about running a single WSGI process
though, since the first site settings read will apply to all of your Django
sites (which is probably not what you want), as explained at the end of the
section in the Django docs here:

https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#basic-configuration

Django recommends running Apache WSGI in daemon mode though, so you
shouldn't need to worry about the settings files clashing:
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#daemon-mode

Haven't toyed enough with the others to know whether or not it is possible,
but I'm sure all of the major servers have similar separation strategies
for exactly this scenario.

A quick Google shows that Nginx/uWSGI can support multiple sites through
the use of Emperor Mode and separate vassal configuration for each site,
which sounds very similar to Apache/mod_wsgi daemon mode.

-James


On Mon, Feb 2, 2015 at 11:44 PM, Mike Dewhirst 
wrote:

> Is it possible to run two virtual hosts on the same machine for Django
> sites where one is 1.7 and the other 1.6?
>
> Thanks
>
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/54D07C57.4010108%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVBLqhUt5f7xiFxnnRJ%3DAV%3DzPQdCD9oK2dQcUKP_RhdKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: upload_to for ImageField changes name of file being uploaded

2015-02-03 Thread Tom Evans
On Tue, Feb 3, 2015 at 7:22 AM, bradford li  wrote:
> There is bounty on this stackoverflow question is anyone is interested
>

It looks like it has already been answered multiple times - you cannot
upload a file in to a subdirectory of MEDIA_ROOT and have its name
attribute be the base file name. The name attribute of a FileField is
the path to the file relative to MEDIA_ROOT*. If you want to store
files in subfolders of MEDIA_ROOT, then obviously, the name attribute
will not consist of just the file name of the uploaded file.

If you want to know or use the name of the file, use
os.path.basename() on the name attribute.

Cheers

Tom

* This isn't actually true, but is close enough to the truth as makes
no difference. It is in fact relative to whatever "storage engine"
that FileField uses; the default storage engine behaves as I have
described.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1KuXPScTGkZtPynf7cgNM_CNAHJ8DPrn1tooT-83PgamA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Pillow on QPython3

2015-02-03 Thread ADEWALE ADISA
Hi guys, am try to setup django tutorial with QPython3 on android device.
But the problem is am unable to install Pillow on the Qpython3. Its just
giving me various error. I try Qpython forum but with no avail.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMGzuy8-9uFqB%3D2otM2pbZ25iVSn4k6MeU7T5S9EBRNx7zLwXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create User method for Custom Manager Django

2015-02-03 Thread Daniel Roseman

On Tuesday, 3 February 2015 06:19:47 UTC, Max Nathaniel Ho wrote:
>
> Hi all,
>
> I am following this tutorial (
> http://musings.tinbrain.net/blog/2014/sep/21/registration-django-easy-way/) 
> to create a user registration model in Django.
>
> I understand that the class UserManager is overwriting the default User 
> model. However, I do not understand this particular part.
>
> The official Django Documentation doesn't explain what this means - It 
> merely shows the full code.
>
> https://docs.djangoproject.com/en/1.7/topics/auth/customizing/
>
> Need some clarification as to what's going on here. What is self.model in 
> this example and what does it do?
>
> def create_user(self, email, password, **kwargs):
> user = self.model(email=self.normalize_email(email), 
> is_active=True, **kwargs)
> user.set_password(password)
> user.save(using=self._db)
> return user
>
>

It is not doing any such thing as "overwriting the default User model". 
That is a Manager: your first port of call should have been the 
documentation for model managers, which is here:
https://docs.djangoproject.com/en/1.7/topics/db/managers/

If there's anything you don't understand after having read that, please 
come back and ask a more specific question.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f21deab2-776f-4532-ae6d-ee4fada9bf6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: secretar...@atoutpass.fr

2015-02-03 Thread Edgar Gabaldi
Sorry, i don't speak french.

can i help you?

Merci :)

On Tue, Feb 3, 2015 at 12:12 PM, Alain Abraham  wrote:

>  Bonjour,
> c’est Alain.
>
> Juste une pièce jointe à montrer à Jean-Pierre.
>
> Merci
>
> Alain
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/F2A4DCFC-E229-4FC3-B500-B1C9ACD34AC1%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGjPPHmpwZVm-uG2feoYSMO1piU7pH%2B7AbUDwRNY%2BEY3b49sZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: secretar...@atoutpass.fr

2015-02-03 Thread Edgar Gabaldi
Sorry, i think that was a private message.

On Tue, Feb 3, 2015 at 1:27 PM, Edgar Gabaldi  wrote:

> Sorry, i don't speak french.
>
> can i help you?
>
> Merci :)
>
> On Tue, Feb 3, 2015 at 12:12 PM, Alain Abraham  wrote:
>
>>  Bonjour,
>> c’est Alain.
>>
>> Juste une pièce jointe à montrer à Jean-Pierre.
>>
>> Merci
>>
>> Alain
>>
>>   --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/F2A4DCFC-E229-4FC3-B500-B1C9ACD34AC1%40gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGjPPHkEPqVTTdR4V55esuDhfeJq7fjsryWjgCoASk-itp2s5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrating to initial migration: "ORA-00955: name is already used by an existing object"

2015-02-03 Thread Carsten Fuchs

Hi all,

Am 02.02.2015 um 22:50 schrieb Carsten Fuchs:

It seems that creating the initial migrations with `makemigrations`
works well, but the first run of `migrate` aborts with error
"django.db.utils.DatabaseError: ORA-00955: name is already used by an
existing object". Please see the full output below.


A quick update:

Running `migrate` with very verbose output (`-v 3`) does not provide any 
relevant extra information, just:



[...]
Running migrations:
  Applying Lori.0001_initial...Traceback (most recent call last):
[... same as before]



Also, I re-tried with `managed = False` added to each model's Meta 
class, but to no avail: the error is exactly the same as reported in my 
previous post. (With `managed = False`, `makemigrations` lists all the 
models, but not the previously indicated constraints or the fields. The 
exception with `migrate` about ORA-00955 remains the same, though.)



Any help or hints would very much be appreciated!

Many thanks and best regards,
Carsten

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54D0F56C.6040808%40cafu.de.
For more options, visit https://groups.google.com/d/optout.


Problem with uwsgi

2015-02-03 Thread Andreas Kuhne
Hi all,

We are running our website with nginx and uwsgi at the moment. It is a
django 1.7.4 application and it has been running perfectly for a couple of
months. Now however we are getting some errors that I can't really explain.

The errors always appear after uwsgi has done a respawn of a process. Then
we can get 4-5 errors with very strange behavior. Things like "dict has no
method 'startswith'". They aren't errors in the code because the code will
run perfectly before and after these errors. We also used to get these when
we deployed a new version of the website and then restarted uwsgi (by
sending a kill signal to the main process).

Has anyone had the same problems and if so, does anyone know how to remedy
it? We are getting a lot of false error mails and it's starting to get
annoying. Also I don't know how our customers are affected when this
happens, but it's probably not good.

Regards,

Andréas

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUb%3D1gWoZfT3dm-i2J4St_%3DMW0t4%3D0j%3DmcKoZKj1%2B-O8Y%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with uwsgi

2015-02-03 Thread Roberto De Ioris

> Hi all,
>
> We are running our website with nginx and uwsgi at the moment. It is a
> django 1.7.4 application and it has been running perfectly for a couple of
> months. Now however we are getting some errors that I can't really
> explain.
>
> The errors always appear after uwsgi has done a respawn of a process. Then
> we can get 4-5 errors with very strange behavior. Things like "dict has no
> method 'startswith'". They aren't errors in the code because the code will
> run perfectly before and after these errors. We also used to get these
> when
> we deployed a new version of the website and then restarted uwsgi (by
> sending a kill signal to the main process).
>
> Has anyone had the same problems and if so, does anyone know how to remedy
> it? We are getting a lot of false error mails and it's starting to get
> annoying. Also I don't know how our customers are affected when this
> happens, but it's probably not good.
>
> Regards,
>
> Andréas
>


Hi, ensure you are running a stable uWSGI version 1.4.x or 2.x, older
versions have serious bugs. Eventually paste your uWSGI configuration


-- 
Roberto De Ioris
http://unbit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/acdaac41963c810109952aaf8e18e3c3.squirrel%40manage.unbit.it.
For more options, visit https://groups.google.com/d/optout.


Re: Django: How to customize the admin form for specific model

2015-02-03 Thread carlos
Hi, in addition Collin answer you need use sorl-thumbnail in show picture
in admin
http://sorl-thumbnail.readthedocs.org/en/latest/examples.html#admin-examples

Cheers

On Tue, Jan 27, 2015 at 2:11 PM, Collin Anderson 
wrote:

> Hi,
>
> You could have the images be inline:
>
> class CommentImageInline(models.TabularInline):
> model = CommentImage
> extra = 0
>
> class CommentAdmin(models.ModelAdmin):
> inlines = [CommentImageInline]
>
> Though, you may need to use a custom widget to get the actual images to
> show up.
>
> Collin
>
> On Saturday, January 24, 2015 at 2:31:02 PM UTC-5, Shoaib Ijaz wrote:
>>
>> First of all I apologize the question title can be unrelated to my query.
>> I am also confused what I want to do because I am less familiar with django.
>>
>> I want to create simple comment system. The requirement is clear that
>> user can post comment with multiple images.Every comment should have reply.
>> so I created following models.
>>
>> #comment table class Comments(models.Model):
>> parent = models.ForeignKey('self',null=True) // for comment reply
>> description = models.TextField(max_length=1000, blank=False, null=False)
>>
>> class Meta:
>> db_table = u'comments'
>>
>> #images tableclass CommentImages(models.Model):
>> comment = models.ForeignKey(Comments)
>> image = models.CharField(max_length=250, blank=False, null=False)
>>
>> class Meta:
>> db_table = u'comments_images'
>>
>> I have query about admin side how can i manage these things?
>>
>> I want to show images list when admin view the specific comment.
>>
>> Admin can view replies of specific comment.
>>
>> Here i draw the example. [image: enter image description here]
>>
>> So I dont want to ask about coding. I want to know what techniques will
>> be used to change the admin view. I am using admin panel for others models
>> too so I want to change the specific model view.
>>
>> How can I get these things? Thank you
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c399d663-c514-439d-b7e4-bab765fc6ea4%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO3RDECey%2B5dqOeRkioevgC%3DRexnyY9BOnNjhKefk5CrYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with uwsgi

2015-02-03 Thread Andreas Kuhne
Thanks Roberto,

We are running uwsgi version 2.0.7 so I hope that's ok?

Our config is as follows:

[uwsgi]
logger=syslog:suitopia
chdir=/var/canvas/site/src
home=/home/ubuntu/.virtualenvs/canvas
module=suitopia.wsgi:application
master=True
pidfile=/tmp/canvas.pid
vacuum=True
max-requests=5000
daemonize=/var/canvas/site/logs/uwsgi/uwsgi.log
env DJANGO_SETTINGS_MODEL=suitopia.settings
socket=127.0.0.1:3001
processes=5
uid = ubuntu
gid = ubuntu
ini = /home/ubuntu/.aws.ini
ini = :aws_credentials

The aws.ini file only contains our aws credentials.

Regards,

Andréas

2015-02-03 17:44 GMT+01:00 Roberto De Ioris :

>
> > Hi all,
> >
> > We are running our website with nginx and uwsgi at the moment. It is a
> > django 1.7.4 application and it has been running perfectly for a couple
> of
> > months. Now however we are getting some errors that I can't really
> > explain.
> >
> > The errors always appear after uwsgi has done a respawn of a process.
> Then
> > we can get 4-5 errors with very strange behavior. Things like "dict has
> no
> > method 'startswith'". They aren't errors in the code because the code
> will
> > run perfectly before and after these errors. We also used to get these
> > when
> > we deployed a new version of the website and then restarted uwsgi (by
> > sending a kill signal to the main process).
> >
> > Has anyone had the same problems and if so, does anyone know how to
> remedy
> > it? We are getting a lot of false error mails and it's starting to get
> > annoying. Also I don't know how our customers are affected when this
> > happens, but it's probably not good.
> >
> > Regards,
> >
> > Andréas
> >
>
>
> Hi, ensure you are running a stable uWSGI version 1.4.x or 2.x, older
> versions have serious bugs. Eventually paste your uWSGI configuration
>
>
> --
> Roberto De Ioris
> http://unbit.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/acdaac41963c810109952aaf8e18e3c3.squirrel%40manage.unbit.it
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbmNabgSQ4xN4%3DRwKntu837Yo%2B1Ru%2BDP3io%3DCAqRhVZJ0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pillow on QPython3

2015-02-03 Thread Erik Cederstrand

> Den 03/02/2015 kl. 14.36 skrev ADEWALE ADISA :
> 
> Hi guys, am try to setup django tutorial with QPython3 on android device. But 
> the problem is am unable to install Pillow on the Qpython3. Its just giving 
> me various error. I try Qpython forum but with no avail.

Picking a random post here. When asking questions, please:

* Describe what you're trying to achieve, and what you have already tried
* Post the relevant code, if you have code that's not working
* Post the error messages, if you get error messages

These are really simple things that raise the chance you'll get helpful answers 
from this list.


Thanks,
Erik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D9115517-C421-49D2-B3A7-181064542DF0%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Django Wysiwyg and images (Summernote or Froala)

2015-02-03 Thread David Mutton
Hi,
I've been trying to integrate a WYSIWYG editor into my Django project. I 
first started with Summernote and I had no issue integrating the it into 
admin or a form. I followed the instructions on their github and everything 
works great except image uploading and inserting. The file is uploading (I 
can see it in the filesystem) but it does not show up in the editor or in 
the resulting html.

I thought it was just Summernote and so I switched to Froala but I'm 
getting the exact same behavior. Is there something I'm missing with image 
upload inside a wysiwyg?


Dave 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1d068498-100f-4c7c-8588-42159197a3b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: two django sites at different revisions with apache

2015-02-03 Thread Mike Dewhirst

Thanks James. I'll work through it.

Cheers

Mike

On 3/02/2015 7:00 PM, James Schneider wrote:

I don't see why not. For Apache, you would just place the
relevant WSGIScriptAlias and WSGIPythonPath inside of your VirtualHost
elements. You would need to be cautious about running a single WSGI
process though, since the first site settings read will apply to all of
your Django sites (which is probably not what you want), as explained at
the end of the section in the Django docs here:

https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#basic-configuration

Django recommends running Apache WSGI in daemon mode though, so you
shouldn't need to worry about the settings files clashing:
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#daemon-mode

Haven't toyed enough with the others to know whether or not it is
possible, but I'm sure all of the major servers have similar separation
strategies for exactly this scenario.

A quick Google shows that Nginx/uWSGI can support multiple sites through
the use of Emperor Mode and separate vassal configuration for each site,
which sounds very similar to Apache/mod_wsgi daemon mode.

-James


On Mon, Feb 2, 2015 at 11:44 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote:

Is it possible to run two virtual hosts on the same machine for
Django sites where one is 1.7 and the other 1.6?

Thanks

Mike

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscribe@__googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/__group/django-users
.
To view this discussion on the web visit

https://groups.google.com/d/__msgid/django-users/54D07C57.__4010108%40dewhirst.com.au

.
For more options, visit https://groups.google.com/d/__optout
.


--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVBLqhUt5f7xiFxnnRJ%3DAV%3DzPQdCD9oK2dQcUKP_RhdKw%40mail.gmail.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54D15931.2020405%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Pillow on QPython3

2015-02-03 Thread Russell Keith-Magee
Hi Adewale,

Installing Pillow is always a bit of a struggle, because it involves native
code - the pieces of pillow that do the actual image processing rely on
system libraries for handling JGEG, PNG etc. If the makers of QPython
haven't included Pillow (or PIL) in their build, you're going to be
fighting an uphill battle to get it working. If you're not comfortable
dealing with Autoconf files and C compilers, you're probably not going to
get it working.

That said - Django should run without installing Pillow, as long as you
don't try to use an ImageField. Skip over whatever step is telling you to
install Pillow, and see what happens when you work through the tutorial.

Yours
Russ Magee %-)



On Tue, Feb 3, 2015 at 9:36 PM, ADEWALE ADISA 
wrote:

> Hi guys, am try to setup django tutorial with QPython3 on android device.
> But the problem is am unable to install Pillow on the Qpython3. Its just
> giving me various error. I try Qpython forum but with no avail.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMGzuy8-9uFqB%3D2otM2pbZ25iVSn4k6MeU7T5S9EBRNx7zLwXA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84-YtsTEkyoph-r5o5L9tEBFVAXrMQnRc%3DY5nHqR7uLLqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tests and temp tables

2015-02-03 Thread Larry Martell
I have a django app that uses a temp table. In the real world this is
no issue, as each invocation of the app runs in its own MySQL session
so there cannot be any conflict with the temp tables. But in my tests
there are multiple requests sent, and apparently they are all in the
same session, as on the second request I get an error because the temp
table already exists. I tried logging out between requests, and I
tried creating a new Client instance for each request, but I still got
the error. Then I tried deleting the Client object, but I got Client
object has no attribute __del__.

What I can do so that each request in a test has its own MySQL session?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY7Nz1bmoSSq0FFZf4Paz93iDeGdb_WTsyj%2B0LC81ZP4Sw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Context processors, am I doing them right?

2015-02-03 Thread Dean De Leo
Hi,
I am new to Django and I am still going through the tutorial. I've tried
to set up a context processor for the following scenario, and I would
like to obtain some confirmation if this is a proper solution or I am
doing some mess..
In my base template with a header there is a navigation bar. A single
button should be highlighted among the others depending in the current
section / page in the website:


Blog
Projects
...


What I thought so far was to register a universal context processor:

def navbar_selected_menu( request ):
items = {"blog": "", "about": ""}
target = request.META["PATH_INFO"]

def select( key ):
" Select the given key in the dictionary item "
nonlocal items;
items[key] = ' class="selected"';

if re.match( "(^/$)|(^/blog$)|(^/blog/)", target):
select("blog")
if re.match(  "^/about\.s?html", target): # about
select("about")


return {"navbar": {"selected": items}};

and add to all links a variable such as Blog.

Is this solution appropriate or does it exist something clearer?

Moreover, is there the chance to pass explicitly a variable from the url 
mapping to the context processor ?

Kind regards,
Dean


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54D1543C.6050104%40gmx.com.
For more options, visit https://groups.google.com/d/optout.