Re: django-ssl-auth

2013-09-29 Thread Liam Thompson
Hi Frank

Thanks for the direction, my search terms need some work, that mailing list 
never came up in my searches.

Liam

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Creating multiple objects at once

2013-09-29 Thread Lachlan Musicman
Hola,

I have a inventory system with Parts and Part types. Part Types are
Archetypes, parts are instances of Part Types with details (unit cost,
serial number, date of purchase, etc).

A big issue is that not all Parts have serial numbers (box of 1000
screws for instance). But when we get a large quantity of parts that I
would like to apply serial numbers to, data entry staff don't want to
enter the otherwise identical data again and again.

Since most serialised products we are storing come with numbers that
are "in serial", I want to replace the creation process with a form
that also asks for "first serial number" and "number of parts" -
giving a nice list of easily incremented serial numbers. Then we can
create the requisite objects at the same time, and save them with just
the diff serial.

What is the best way to do this?

I've seen three solutions so far:

1. bulk_create 
https://docs.djangoproject.com/en/1.4/ref/models/querysets/#bulk-create
problem: doesn't call model save method (in my case, where the slug is
populated from the id).

2. transaction.commit_manually
https://docs.djangoproject.com/en/dev/topics/db/transactions/#django.db.transaction.commit_manually

3. Signals 
https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save
(and now that I think about it, probably transaction.commit_manually
coupled with it).

What does the list recommend as a method?

Also, as I discovered in the IRC the other day, there really is a time
when CBVs aren't appropriate. Should this process be a CBV - it seems
a lot more suited to a FBV.

Cheers
L.


-- 
Maya Otos (@maya_otos) tweeted at 9:27 PM on Tue, Jul 30, 2013:
When you used to be punk, and now you are still punk but not as punk,
are you post-punk or decaying punk or ex-punk or just not punk anymore

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

2013-09-29 Thread Russell Keith-Magee
On Mon, Sep 30, 2013 at 7:27 AM, Serge G. Spaolonzi wrote:

> Hi,
>
> I am failing to override the AUTH_USER_MODEL settings for a unittest, it
> throws:
>
> "Manager isn't available; User has been swapped for 'None'"
>
> Is it possible to override AUTH_USER_MODEL in the unittest?
> My goal is to use the default user model provided by django for the test
> only.
>

Yes, it is possible. That's why the approach is documented:

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-testing-fixtures

If you're getting an error, It sounds like something else is going wrong in
your test suite -- my guess would be that you haven't got the auth app in
INSTALLED_APPS. However, it's impossible to say for sure without seeing
more code.

Yours,
Russ Magee %-)

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: new django template

2013-09-29 Thread Frédéric Bouin
an also what is telling the browser to load the information from 
contact.html in name.html, my name.html file is completely empty and its 
still loading the contact information.

On Sunday, September 29, 2013 7:46:54 PM UTC-4, Frédéric Bouin wrote:
>
> ok, this seems to load the contact template now, but why does it try to 
> find name.html rather than contact.html? Where does this name.html file 
> come from? no other page seems to depend on it to open. 
>
> Thanks for the help
>
>
>
>
> On Saturday, September 28, 2013 4:10:54 PM UTC-4, +Emmanuel wrote:
>>
>> From the error message, there should be a template named 'name.html' 
>> under the folder '/en/contact' which should be under the templates folder. 
>> Create a folder 'en' within the templates folder. Then create another 
>> folder 'contact' within the 'en' folder. Put your 'name.html' file in the 
>> 'contact' folder. That should work.
>>
>> On Friday, September 27, 2013 6:03:40 PM UTC+3, Frédéric Bouin wrote:
>>>
>>> I am trying to edit some things in django and am running into a few 
>>> problems as I am quite new to it.
>>>
>>> I am working off an existing django configuration with templates that 
>>> currently work, but I don't really understand how to create new templates. 
>>> If I create a new .html file in my templates folder in "myprojects" and 
>>> then declare the new template under cms_templates = (...) in settings.py 
>>> nothing happens. Am I missing a step to get the template to upload and 
>>> appear in my cms?
>>>
>>> I also had a problem with an existing template, when I try to go to the 
>>> contact page I am told that the template does not exist: 
>>> http://paul.evansoderberg.com/en/contact/
>>> The template is declared under "cms_templates", the file exists in the 
>>> templates folder, and the page is created in django cms, yet I get this 
>>> error message.
>>>
>>> Help would be greatly appreciated, 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: new django template

2013-09-29 Thread Frédéric Bouin
ok, this seems to load the contact template now, but why does it try to 
find name.html rather than contact.html? Where does this name.html file 
come from? no other page seems to depend on it to open. 

Thanks for the help




On Saturday, September 28, 2013 4:10:54 PM UTC-4, +Emmanuel wrote:
>
> From the error message, there should be a template named 'name.html' under 
> the folder '/en/contact' which should be under the templates folder. Create 
> a folder 'en' within the templates folder. Then create another folder 
> 'contact' within the 'en' folder. Put your 'name.html' file in the 
> 'contact' folder. That should work.
>
> On Friday, September 27, 2013 6:03:40 PM UTC+3, Frédéric Bouin wrote:
>>
>> I am trying to edit some things in django and am running into a few 
>> problems as I am quite new to it.
>>
>> I am working off an existing django configuration with templates that 
>> currently work, but I don't really understand how to create new templates. 
>> If I create a new .html file in my templates folder in "myprojects" and 
>> then declare the new template under cms_templates = (...) in settings.py 
>> nothing happens. Am I missing a step to get the template to upload and 
>> appear in my cms?
>>
>> I also had a problem with an existing template, when I try to go to the 
>> contact page I am told that the template does not exist: 
>> http://paul.evansoderberg.com/en/contact/
>> The template is declared under "cms_templates", the file exists in the 
>> templates folder, and the page is created in django cms, yet I get this 
>> error message.
>>
>> Help would be greatly appreciated, 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.
For more options, visit https://groups.google.com/groups/opt_out.


Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

2013-09-29 Thread Serge G. Spaolonzi
Hi,

I am failing to override the AUTH_USER_MODEL settings for a unittest, it throws:

"Manager isn't available; User has been swapped for 'None'"

Is it possible to override AUTH_USER_MODEL in the unittest?
My goal is to use the default user model provided by django for the test only.

Thanks

-- 
Serge G. Spaolonzi
Cobalys Systems
http://www.cobalys.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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django-ssl-auth

2013-09-29 Thread Frank Bieniek

Please check this post
http://www.mail-archive.com/modwsgi@googlegroups.com/msg04658.html

Thanks
Frank


Am 29.09.13 21:52, schrieb Liam Thompson:

Hi everyone

I am running Django 1.5.2, using Apache 2.2.22, (WSGI) on Linux Ubuntu 
12.10. I am a Django newbie and am trying to get my head around the 
following problem.


I am trying to utilise x509 user certificates for user login. Apache 
handles the request for the user certificate and validates against the 
CA certificate (I see this occurring in the Apache logs). The details 
within the certificate (name and email) will then need to be validated 
against the user details present in the pre-populated db (this is to 
implement).


My problem, is that I cannot seem to access the certificate 
details/information that are exchanged. I received feedback from 
Florian (Apollo13), who suggested looking in the "REMOTE_USER" of the 
request.META. I do not see this value within the META. I have also 
attempted to use the django-ssl-client-auth code provided by Kimmo 
(Kimvais). The code looks for "HTTP_X_SSL_USER_DN" within the META but 
I don't see this either (list of META values - 
https://dpaste.de/D9UW). None of the values I see, seems to contain 
anything about the certificate details that I see exchanged in the 
Apache log. Is the Apache exchange even available to Django/WSGI (I 
think it surely would be ) ?


There is some mention of using environmental variables, but this 
generally involves mod_python, which I'm not using.


I would be most appreciative of pointers or directions to help clear 
up my misunderstanding / lack of knowledge.


Liam



--
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.
For more options, visit https://groups.google.com/groups/opt_out.


--
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.
For more options, visit https://groups.google.com/groups/opt_out.


Textarea and initial value

2013-09-29 Thread Marcin Szamotulski
Dear Django users,

The short question is: How to use Textarea widget with initial value?
The long version: I have a form with a simple Textarea widget

class Form(forms.Form):

f = forms.CharField(widget=forms.Textarea())

in a view I set an initial value:

form = Form(initial={'f': 'initial value})

and it renders on a page as
intial value


Then let say I modify the initial value to 'new value'

Then when I POST the form (i.e. send a POST request).  The 
request.POST.getlist('f')
returns
['new value', 'intial value']
and since the 'initial value' is after the 'new value' when I intialise
the form
form = Form(request.POST)
it has form.cleaned_data['f'] == 'initial value'. 

What is the correct way to make initial value in a textarea so that it
is not submitted with the form.

Playing with this I tried to remove the 'initial value' using javascript
($('textarea[name="f"]).html('')), but the submitted date (request.POST)
was not affected.

Thanks for help,
Marcin

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Looking for projects that make Django accessible to novice programmers

2013-09-29 Thread Jesús Lucas Flores
I am interested in your proyect. Maybe can i post the new when you relase
it in my company's blog: OpenWebinars.net ( sorry is only in Spanish) but
almost 8000 unique visitors in last 3 weeks.

Let me know when you release it at colab...@openwebinars.net



*Jesús Lucas Flores* | *Sysadmin, Web Developer and IT Startups Lover*

 es.linkedin.com/in/jesuslucas



 github.com/jelukas 
 @jelukas89
 Skype: jelukas89




2013/9/29 R. Eastbourne 

> I'm developing an open-source toolset for Django that makes it easier to
> develop a particular type of website.
>
> I would like for it to be accessible to people who have some understanding
> of web development but don't necessarily have the capability or time to
> develop a complex site from scratch.
>
> So, I am working at simplifying everything I possibly can for this domain,
> e.g. by providing:
>
> - Models to inherit from
> - Class-based views to inherit from
> - Form classes to inherit from
> - HTML templates to inherit from
> - Custom project & app templates
> - Autogenerated urls.py
> - etc
>
> Does anyone know of other projects that do something like this for a
> particular category of website? It would be nice to compare and I might get
> some ideas.
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


django-ssl-auth

2013-09-29 Thread Liam Thompson
Hi everyone

I am running Django 1.5.2, using Apache 2.2.22, (WSGI) on Linux Ubuntu 
12.10. I am a Django newbie and am trying to get my head around the 
following problem.

I am trying to utilise x509 user certificates for user login. Apache 
handles the request for the user certificate and validates against the CA 
certificate (I see this occurring in the Apache logs). The details within 
the certificate (name and email) will then need to be validated against the 
user details present in the pre-populated db (this is to implement).

My problem, is that I cannot seem to access the certificate 
details/information that are exchanged. I received feedback from Florian 
(Apollo13), who suggested looking in the "REMOTE_USER" of the request.META. 
I do not see this value within the META. I have also attempted to use the 
django-ssl-client-auth code provided by Kimmo (Kimvais). The code looks for 
"HTTP_X_SSL_USER_DN" within the META but I don't see this either (list of 
META values - https://dpaste.de/D9UW). None of the values I see, seems to 
contain anything about the certificate details that I see exchanged in the 
Apache log. Is the Apache exchange even available to Django/WSGI (I think 
it surely would be ) ?

There is some mention of using environmental variables, but this generally 
involves mod_python, which I'm not using.

I would be most appreciative of pointers or directions to help clear up my 
misunderstanding / lack of knowledge.

Liam



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Looking for projects that make Django accessible to novice programmers

2013-09-29 Thread R. Eastbourne
I'm developing an open-source toolset for Django that makes it easier to 
develop a particular type of website. 

I would like for it to be accessible to people who have some understanding 
of web development but don't necessarily have the capability or time to 
develop a complex site from scratch.

So, I am working at simplifying everything I possibly can for this domain, 
e.g. by providing:

- Models to inherit from
- Class-based views to inherit from
- Form classes to inherit from
- HTML templates to inherit from
- Custom project & app templates
- Autogenerated urls.py
- etc

Does anyone know of other projects that do something like this for a 
particular category of website? It would be nice to compare and I might get 
some ideas.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


RE: Responsive design

2013-09-29 Thread Babatunde Akinyanmi
ican.mumu.com.ng

Sent from my Windows Phone
From: Jasvir Singh
Sent: 9/29/2013 6:43 AM
To: django-users@googlegroups.com
Subject: Re: Responsive design
On Thu, Sep 26, 2013 at 1:48 PM, Jasvir Singh  wrote:
> Could anyone please tell me, how to make responsive design
> in django?
Thanks everyone.
Please give me links of some responsive website made in django.

-- 

Jasvir Singh Grewal
Blog:http://jasvirsinghgrewal91.wordpress.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.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.