time problem in django, maybe related to daylight savings time adjustment

2013-10-04 Thread Zhou Heng
Please look at the image below:


The time in django is one hour later than the actual time (18:43 vs 19.43). 
I guess it may be because django forgot to hangle daylight savings time 
adjustment. How to fix this problem (so that django can adjust DST 
automatically, not manually after a few months when DST is not in effect in 
EDT time zone)? 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/af458ec6-22b8-4c0f-8adb-61e729bc0766%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


time problem in django, maybe related to daylight savings time adjustment

2013-10-04 Thread Zhou Heng
Please look at the image below:


The time in django is one hour later than the actual time (18:43 vs 19.43). 
I guess it may be because django forgot to hangle daylight savings time 
adjustment. How to fix this problem (so that django can adjust DST 
automatically, not manually after a few months when DST is not in effect in 
EDT time zone)? 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/250f6c5c-94db-4a3a-b0d0-0d44f008a3cd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


What is the right location for my django translation files?

2013-10-04 Thread Mario Osorio


Hi,

I'm giving my first steps with python/django/mezzanine so please bear with 
me.

I modified a translation file of the mezzanine's blog application and 
compiled it OK. Mind you: I literally only modified a couple of words and 
left the rest intact.

The only place I found out I could place them in order to test was at the 
blog app's locale folder 
(~/MY_VIRTUAL_ENV/lib/python2.7/site-packages/mezzanine/blog/locale/es/LC_MESSAGES).

It worked fine, but my guts tell me there has to be a better way so I can 
have this file(s) in some other location WITHIN my own mezzanine 
application so:

   1. I can easily maintain them and
   2. I don't have to keep my whole virtual environment in my SCM's 
   repository.in order to keep track of this single file with just a couple or 
   words modified and that will hardly ever get modified again.

I understand I shouldn't keep my environment in the SCM, but that was the 
only (arguable) way I could keep my translation files in sync.

I also tried placing them at MY_PROJECT/blog/locale/es/LC_MESSAGES and 
MY_PROJECT/locale/es/LC_MESSAGES and none worked.

I just found out about LOCALE_PATHS and have not had a chance to test this 
but my concern with this solution however, is whether or not I'll have to 
translate everything (django, mezzanine and all apps) when I'm just 
literally changing a couple of words found in one application.

Any and all comments are very welcome.

Thanks a lot in advanced

-- 
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/2db52e61-6b52-4326-bf49-0876f6a3c52a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


on-site search pages: soft 404's and duplicate title / meta tags

2013-10-04 Thread info rekal
We are running Django 1.5.1 with haystack 1.2.7 / xapian 1.2.15

#1.) 

>From google webmaster tools, it looks like we've been having a steady 
increase in soft 404 errors; 
We utilize xapian and haystack for the on-site search feature.

The soft 404's seem to all be url's for search queries that return 0 
results.
How can we alter how google sees the 0 result pages so that it does not 
interpret them as a soft 404's.

Here are some examples of a few 0 result pages we are getting soft 404 
error for:

http://goo.gl/rq48Lj
http://goo.gl/wccPY3
http://goo.gl/c01dvL

#2.) 

We are also getting duplicate title and meta descriptions for on-site 
search pages
that just differ by page # or search parameters. For example, the following 
2 pages are getting alerts for having duplicate title tags:

http://goo.gl/U1j46N
http://goo.gl/bSwFzg

Notice the URLs only differ by the following argument being passed 
?price=900-1200 on the 2nd url.

How do properly output these search page results so that duplicate titles 
and duplicate meta descriptions are no longer
an issue?

Thanks in advance

-- 
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/85dd0a56-5816-4ac5-a16c-6e7f38f69941%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is there an equivalent to JPA @embedded in django modeling

2013-10-04 Thread Khanh Tran
Thank you, jondbaker. That works!

On Wednesday, October 2, 2013 3:55:11 PM UTC-7, Khanh Tran wrote:
>
> Lets say both Customer and Business have an Address. In JPA, we can store 
> address attributes(street,city,state,zip) directly inside Customer and 
> Business using @Embedded annotation.Is there an equivalent to @embedded in 
> python without using ForeignKey field. 
>

-- 
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/db08f17e-0c1c-422e-9418-75ac9c2838c2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django formwizard NoFileStorageConfigured

2013-10-04 Thread Adonis Nafeh
I ran into the same error. Using files in formwizard requires configuring 
File Storage, according to docs 
https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#handling-files

initializing file_storage fixed it for me.  

from django.core.files.storage import FileSystemStorage
>
> class AppWizard(SessionWizardView):
>* file_storage = 
> FileSystemStorage(location=os.path.join(settings.MEDIA_ROOT))*


On Sunday, March 11, 2012 7:27:33 AM UTC-5, danoro wrote:
>
> [ACTION] 
>
> Subclass NamedUrlSessionWizardView and instantiate it with a set of 
> forms one of them containing a FileField 
>
> class CommonWizardView(NamedUrlSessionWizardView): 
> pass 
>
> class FamilyWizardView(CommonWizardView): 
> pass 
>
> [RESULT] 
>
> File "/accounts/urls.py", line 66, in  
>
> family_wizard = FamilyWizardView.as_view(named_family_forms, 
> url_name='family_step', done_step_name='family_wizard') 
>
> File "python2.7/site-packages/django_formwizard-1.0-py2.7.egg/ 
> formwizard/views.py", line 109, in as_view 
>
> initkwargs = cls.get_initkwargs(*args, **kwargs) 
>
> File "python2.7/site-packages/django_formwizard-1.0-py2.7.egg/ 
> formwizard/views.py", line 583, in get_initkwargs 
>
> initkwargs = super(NamedUrlWizardView, cls).get_initkwargs(*args, 
> **kwargs) 
>
> File "python2.7/site-packages/django_formwizard-1.0-py2.7.egg/ 
> formwizard/views.py", line 166, in get_initkwargs 
>
> raise NoFileStorageConfigured 
>
>
> TemplateSyntaxError: Caught NoFileStorageConfigured while rendering 
>
> [CAUSE] 
>
> class WizardView(TemplateView): 
> @classmethod 
> def get_initkwargs(cls, form_list, initial_dict=None, 
> instance_dict=None, condition_dict=None, *args, **kwargs): 
> """ 
> Creates a dict with all needed parameters for the form wizard 
> instances. 
> """ 
>  
> # check if any form contains a FileField, if yes, we need 
> a 
> # file_storage added to the wizardview (by subclassing). 
> for field in form.base_fields.itervalues(): 
> if (isinstance(field, forms.FileField) and 
> not hasattr(cls, 'file_storage')): 
> raise NoFileStorageConfigured 
>
> [RESOLUTION] 
>
> subclassing is not enough.  I inherited from both 
> NamedUrlSessionWizardView and FileSystemStorage, as shown below, but I 
> keep getting this error. 
>
> class FamilyWizardView(CommonWizardView, FileSystemStorage): 
> pass 
>
> I noticed an instance variable in formwizard called storage_name but 
> it is used for child clasess Session and Cookie WizardViews. Si it's 
> no relevant 
>
> please, could you shed some light  ?

-- 
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/94746ca1-af64-4849-962b-410638f8d57d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: PyCons in Africa

2013-10-04 Thread Alioune Dia
We are a community (http://blog.dakarlug.org/) based in Senegal since
2008 and we operate in Free Software (OS and Software) and Python is
one of our favorite programming languages within our community. And we
organize occasional sessions programing Python / Django. This would be
a great privilege a PyCon in Africa. Opportunity to rub shoulders with
the core Python programmers.

Thank
-Ad

2013/10/4 Daniele Procida :
> First of all, apologies if you have to read this more than once because of 
> the cross-posting.
>
> I've had an idea brewing recently.
>
> I went to meet Professor Judith Hall this afternoon to talk about it. She's 
> involved with http://medicine.cardiff.ac.uk/mothers-africa/ (amongst other 
> things) and is working on a Cardiff University project which itself is part 
> of http://wales.gov.uk/topics/health/improvement/index/grants/?lang=en
>
> Following that meeting, I bashed out: 
> https://github.com/evildmp/pycons-in-africa/ - please take a look, and even 
> better, let me know what you think, or make your own contribution to the 
> document. I'll continue working on it myself.
>
> Thanks,
>
> Daniele
>
> --
> 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/20131004161344.532752077%40smtpauth.cf.ac.uk.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADbZ2qCbVh%3D7vwP%3DrnR9dZPSPJu4%2BiftSyArD%2B8hAek1H3Cw8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: PyCons in Africa

2013-10-04 Thread Nigel Legg
I have lived in both Zambia and Kenya, and have family in Zambia.  Bongo
Hive in Lusaka may be a good place to start (they are on twitter). I
haven't been there for more than five years, but would be interested in
getting involved in some way, time and work permitting.

Cheers, Nigel
07914 740972



On 4 October 2013 17:13, Daniele Procida  wrote:

> First of all, apologies if you have to read this more than once because of
> the cross-posting.
>
> I've had an idea brewing recently.
>
> I went to meet Professor Judith Hall this afternoon to talk about it.
> She's involved with http://medicine.cardiff.ac.uk/mothers-africa/(amongst 
> other things) and is working on a Cardiff University project which
> itself is part of
> http://wales.gov.uk/topics/health/improvement/index/grants/?lang=en
>
> Following that meeting, I bashed out:
> https://github.com/evildmp/pycons-in-africa/ - please take a look, and
> even better, let me know what you think, or make your own contribution to
> the document. I'll continue working on it myself.
>
> Thanks,
>
> Daniele
>
> --
> 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/20131004161344.532752077%40smtpauth.cf.ac.uk
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vxnd6B_5%2BNzzXXwuubrs1%3D7K5g6d3uUu0%2ByJkQtUCemvg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Looking for a job as a junior django developer or internship (remote)

2013-10-04 Thread Mariusz Dev
Hello!

Looking for a job or internship opportunities as django developer (remote).
I have experience with Django, CSS3, HTML5, JavaScript.
My email: mariusz.developm...@gmail.com

Cheers!

-- 
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/76de116d-6a76-4c2f-b619-e0ac2a8f858f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Copy all the data from an existing database when create the testing database.

2013-10-04 Thread Tianyi Wang
Yes, it'd be nice to have all the data from the existing database.
I am aware the loading fixtures way, but I will need to do that every time 
I know the existing database has changed a lot. 
So just copy the data when creating the test database seems more 
convenient. 

Tianyi

On Friday, 4 October 2013 17:08:02 UTC+1, C. Kirby wrote:
>
> Do you always want all of the data from the existing database, or is this 
> just a quick way to have "real data" for testing.
> If it is the latter I would use manage.py dumpdata to generate test 
> fixtures. You can load the fixtures in you tests as needed.
>
> Chaim
>
> On Friday, October 4, 2013 8:48:45 AM UTC-5, Tianyi Wang wrote:
>>
>> Hi,
>>
>> When I run my tests, I'd like it to copy an existing database with all 
>> the data when create the testing database.
>>
>> I never thought about this till one of my colleague uses POSTGIS_TEMPLATE 
>> = DATABASES['default']['NAME'] for his tests. 
>> Because we use GeoDjango for our project, so POSTGIS_TEMPLATE exists for 
>> letting the test runner know which postgis database template to use.
>> And when he define it as mentioned above, it actually creates the test 
>> database with all the data as well. It's kinda handy for us, so we don't 
>> need to create the fixture files.
>> But if we can not do the same with the projects which do not use 
>> GeoDjango. 
>>
>> So I have two questions here:
>>
>>1. Is it good idea to use the data already exists in the project 
>>database? (For some tests, I may need to delete all the data first for a 
>>certain table, but in many cases, we test against non empty data set.)
>>2. If it's not a bad idea, for the project which does not use 
>>GeoDjango, is there anyway I can set it to copy the data from the 
>> existing 
>>database?
>>
>> Thanks
>>
>> Tianyi
>>
>

-- 
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/1fa6f2fb-cc01-4b46-9c78-02d3e5347032%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Beginner to Django

2013-10-04 Thread Ovnicraft
On Thu, Oct 3, 2013 at 5:20 AM, Manimaran R wrote:

> hai everyone!!
>
> im a beginner to django,dont have prior knownledge about django!!
>
> Help me step by step,rit frm installation!
>
> for ur ref im using windows 7! dont have any open source,so help me with
> windows process
>


Hi and welcome !,

You need python at first, install python 2.7 from official site
ww.python.org

i recommend you start in documentation site and how to install [1], django
has a great tutorial [2].
Please read be careful installation guide.

Best regards,


[1] https://docs.djangoproject.com/en/1.6/topics/install/
[2] https://docs.djangoproject.com/en/1.6/intro/tutorial01/

>
>
>
>  --
> 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/7172a783-667d-4dfc-b96f-e819fe5d60ff%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Cristian Salamea
@ovnicraft

-- 
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%2B16coPoMVyJtVE%3DCLz%2BOWDb9s%2BdP1hgjg1PHNdtZxMsDBSJzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


PyCons in Africa

2013-10-04 Thread Daniele Procida
First of all, apologies if you have to read this more than once because of the 
cross-posting.

I've had an idea brewing recently.

I went to meet Professor Judith Hall this afternoon to talk about it. She's 
involved with http://medicine.cardiff.ac.uk/mothers-africa/ (amongst other 
things) and is working on a Cardiff University project which itself is part of 
http://wales.gov.uk/topics/health/improvement/index/grants/?lang=en

Following that meeting, I bashed out: 
https://github.com/evildmp/pycons-in-africa/ - please take a look, and even 
better, let me know what you think, or make your own contribution to the 
document. I'll continue working on it myself.

Thanks,

Daniele

-- 
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/20131004161344.532752077%40smtpauth.cf.ac.uk.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Copy all the data from an existing database when create the testing database.

2013-10-04 Thread C. Kirby
Do you always want all of the data from the existing database, or is this 
just a quick way to have "real data" for testing.
If it is the latter I would use manage.py dumpdata to generate test 
fixtures. You can load the fixtures in you tests as needed.

Chaim

On Friday, October 4, 2013 8:48:45 AM UTC-5, Tianyi Wang wrote:
>
> Hi,
>
> When I run my tests, I'd like it to copy an existing database with all the 
> data when create the testing database.
>
> I never thought about this till one of my colleague uses POSTGIS_TEMPLATE 
> = DATABASES['default']['NAME'] for his tests. 
> Because we use GeoDjango for our project, so POSTGIS_TEMPLATE exists for 
> letting the test runner know which postgis database template to use.
> And when he define it as mentioned above, it actually creates the test 
> database with all the data as well. It's kinda handy for us, so we don't 
> need to create the fixture files.
> But if we can not do the same with the projects which do not use 
> GeoDjango. 
>
> So I have two questions here:
>
>1. Is it good idea to use the data already exists in the project 
>database? (For some tests, I may need to delete all the data first for a 
>certain table, but in many cases, we test against non empty data set.)
>2. If it's not a bad idea, for the project which does not use 
>GeoDjango, is there anyway I can set it to copy the data from the existing 
>database?
>
> Thanks
>
> Tianyi
>

-- 
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/eceab6d5-5a2a-4def-bbc5-0fd19be34705%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Copy all the data from an existing database when create the testing database.

2013-10-04 Thread Tianyi Wang
Hi,

When I run my tests, I'd like it to copy an existing database with all the 
data when create the testing database.

I never thought about this till one of my colleague uses POSTGIS_TEMPLATE = 
DATABASES['default']['NAME'] for his tests. 
Because we use GeoDjango for our project, so POSTGIS_TEMPLATE exists for 
letting the test runner know which postgis database template to use.
And when he define it as mentioned above, it actually creates the test 
database with all the data as well. It's kinda handy for us, so we don't 
need to create the fixture files.
But if we can not do the same with the projects which do not use GeoDjango. 

So I have two questions here:

   1. Is it good idea to use the data already exists in the project 
   database? (For some tests, I may need to delete all the data first for a 
   certain table, but in many cases, we test against non empty data set.)
   2. If it's not a bad idea, for the project which does not use GeoDjango, 
   is there anyway I can set it to copy the data from the existing database?

Thanks

Tianyi

-- 
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/15a62df8-ba16-4b73-8e7e-58912a66aee4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


django-metrics-dashboard question.

2013-10-04 Thread Nigel Legg
I am looking for a solution..  I want to allow all users of my app to
create their own dashboards for each project, and for their clients to be
able to see only the dashboards they have permission to see.  I have looked
at django-metrics-dashboard (
https://github.com/bitmazk/django-metrics-dashboard), it appars that this
will only produce one dashboard per website, which is not what I am after,
and there does not seem to be another dashboard app for django.
So am I correct about the metrics dashboard, and is there another solution
available?

Many thanks, Cheers, Nigel

-- 
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/CADeX7vz52opk-FwFkuP9L1KPuF1uL%3Diy8DWiHnvtvhq5hcjJnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: New version of django-permissionsx

2013-10-04 Thread thinkingpotato
A short update: I just pushed a new package with some bug fixes and new 
functionality. Docs were also updated.

On Friday, October 4, 2013 5:33:41 AM UTC+2, thinkin...@gmail.com wrote:
>
> Hi,
>
> I would be absolutely grateful if you could please check it out and give 
> me some feedback. What I'm interested in particular is how it works with 
> different Django/Python/apps configurations and if the syntax/API is easy 
> to follow. I would be even more happy if you found it useful in your 
> projects ;)
>
> Docs:
> https://github.com/thinkingpotato/django-permissionsx
>
> PyPi:
> https://pypi.python.org/pypi/django-permissionsx/
>
> Cheers,
> Robert
>

-- 
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/082ea6e9-e484-44b0-b2a3-7aacfde1b93f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Disabling object persistence ?

2013-10-04 Thread Javier Guerra Giraldez
On Fri, Oct 4, 2013 at 1:45 AM, Marc'h  wrote:
> Thus, I'd like to know if there is any means to by-pass the automatic
> persistence mechanism when using collection attributes which are foreign-key
> based.


the ORM is a mapping to an SQL database, by definition that means
persistent storage.  while you can create a model object and not
save() it, relationships are based on the record's primary key, which
is assigned (by the RDBMS) only when save()d.

so, no; there's no "direct" way to avoid persistence and use
relationships.  in fact, any kind of query works only via the
database.

memory-only SQL tables would do the trick, but most implementations
use them only for connection-private tables.  after a cursory re-read
of SQLite docs, I don't see any way to create a shared memory table,
the "file::memory:?cache=shared" URI only means that it is shared
between different connections on the same process

a not-so-nice option could be to specify a RAM disk (or tmpfs)
location for your database.  it would sitll be file-based, and
persistant over different invocations, but faster and less durable
than a real disk file.

if not, then i think you should avoid the ORM and use a shared memory
storage; either memcached, Redis, uWSGI cache, or something similar.
it's not relational, but you should be able to create the needed
queries without too much trouble.

-- 
Javier

-- 
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/CAFkDaoRAnqrqbPNN7YH3eejdaKAVxRk_HE1EA5FQfp-FpfrW3A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Disabling object persistence ?

2013-10-04 Thread Daniel Roseman
On Friday, 4 October 2013 07:45:40 UTC+1, Marc'h wrote:

> Hello,
>
> I'm battling with Django in order to try avoiding object persistence when 
> initialising foreign key model attributes. The app I'm using Django for 
> implements a facade for an already existing database. It's main purpose is 
> to be used as a (read-only) ReST server returning objects built by 
> aggregating attributes from the already existing database. The Django app 
> itself has model classes (and associations) like any other Django app. 
> Renderers and Serializers based on those supplied by the rest_framework 
> modules have been written and tested. We started by configuring the Django 
> app to use a SQLite file, as we're don't really care about object 
> persistence. However, when building model instances (by 
> extracting/aggregating data from the original non-Django managed database), 
> we hit a severe perfomance bottleneck. Each time we initialize a model 
> attribute which is a collection of related instances, all these are 
> apparently persisted to the Django database.
>
> For example, with a classical Order/Items association, we'd have :
>
> 01: orderattributes={...extract attributes from external database using 
>> SQL...}
>> 02: order=Order(**orderattributes)
>> 03: orderitems=[]
>> 04: for item in ...items belonging to order...
>> 05:itemattributes={...extract attributes from external database using 
>> SQL...}
>> 06:item=Item(**itemattributes)
>> 07:orderitems.append(item)
>> 08: order.items_set=orderitems
>
>
> When reaching line 8, it seems that every Item instance of the orderitems 
> collection is persisted in the Django database, which considerably slows 
> down the application.
> I tried to use an in-memory SQLite database, but couldn't make it work, as 
> the syntax for declaring a shared in-memory database (file::memory:...) is 
> not handled correctly, yielding a file-based database instead.
>
> Thus, I'd like to know if there is any means to by-pass the automatic 
> persistence mechanism when using collection attributes which are 
> foreign-key based.
>
> Thanks for any pointers !
>
>
> Marc'h
>
>
You have some fairly severe misunderstandings here. Django does not have 
any "automatic persistence mechanism". The *only* time a model instance is 
persisted to the database is when you call `save()` on it. I don't know 
what `order.items_set` is, but even assuming that it's a reverse foreign 
key manager, Django has no functionality that will automatically save those 
items - especially as the parent Order has not been saved, so therefore has 
no primary key for those FKs to link to. 

Part of the trouble here is that the code you've posted here (apart from 
being on a grey background, which makes it very hard to read) isn't your 
actual real code. You should post the actual code, and indicate where you 
think this "automatic persistence" is happening, then we can help you work 
out what really is going on.
--
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/83eef91d-0158-4610-bc8e-c7e7f18918b5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Inconsistency in model field with file storage on Amazon S3

2013-10-04 Thread Vivek Prakash
Hi all,

I am running a fairly good scale production system in Django, where we 
receive requests in order of 100 to 1000 per second. We are using s3boto 
backend for file storage. All the files are saved in a single bucket on S3. 
When the request for number of files to be saved increases, database 
inconsistencies start coming up which are hard to explain. The file is 
saved in S3, but not saved in the model's FileField. 

This is the related configuration in my settings file:

*DEFAULT_FILE_STORAGE = 'lib.s3utils.MediaRootS3BotoStorage'*

# cat lib/s3utils.py
*from storages.backends.s3boto import S3BotoStorage*
*MediaRootS3BotoStorage  = lambda: S3BotoStorage(location='media')*

Let's take an example Model.

*class FileModel(models.Model):*
*s3_file = models.FileField(upload_to=get_file_path, max_length=512)*


The s3_file is being saved in a way as following:

fileModel_instance.s3_file.save(filename, ContentFile(source), save=True)

Now, this is directly from the django documentation:
FieldFile.save(*name*, *content*, 
*save=True*)

This method takes a filename and file contents and passes them to the 
storage class for the field, then associates the stored file with the model 
field.

But with fairly good number of requests, it happens sometimes that the 
stored file is not associated with the model field. The file is saved in S3 
bucket, but the model field remains null. I suspect one the reason could be 
that s3boto has built-in connection pooling which defers the file save on 
underlying storage and hence the model field remains null. But again that 
should not happen.

Has anyone faced similar issue? Or I am doing something fundamentally 
wrong? Any suggestion and help is highly appreciated.


Thanks,

Vivek 

-- 
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/1712519f-3ac1-435f-a661-24c208cf9931%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Inconsistency in model field with file storage on Amazon S3

2013-10-04 Thread Vivek Prakash
Hi all,

I am running a fairly good scale production system in Django, where we
receive requests in order of 100 to 1000 per second. We are using s3boto
backend for file storage. All the files are saved in a single bucket on S3.
When the request for number of files to be saved increases, database
inconsistencies start coming up which are hard to explain. The file is
saved in S3, but not saved in the model's FileField.

This is the related configuration in my settings file:

*DEFAULT_FILE_STORAGE = 'lib.s3utils.MediaRootS3BotoStorage'*

# cat lib/s3utils.py
*from storages.backends.s3boto import S3BotoStorage*
*MediaRootS3BotoStorage  = lambda: S3BotoStorage(location='media')*

Let's take an example Model.

*class FileModel(models.Model):*
*s3_file = models.FileField(upload_to=get_file_path, max_length=512)*


The s3_file is being saved in a way as following:

fileModel_instance.s3_file.save(filename, ContentFile(source), save=True)

Now, this is directly from the django documentation:
FieldFile.save(*name*, *content*,
*save=True*)

This method takes a filename and file contents and passes them to the
storage class for the field, then associates the stored file with the model
field.

But with fairly good number of requests, it happens sometimes that the
stored file is not associated with the model field. The file is saved in S3
bucket, but the model field remains null. I suspect one the reason could be
that s3boto has built-in connection pooling which defers the file save on
underlying storage and hence the model field remains null. But again that
should not happen.

Has anyone faced similar issue? Or I am doing something fundamentally
wrong? Any suggestion and help is highly appreciated.


Thanks,

Vivek

Vivek Prakash | HackerEarth  | Co-Founder  |
vi...@hackerearth.com | Follow us on twitter:
@HackerEarth
 | http://engineering.hackerearth.com | http://blog.hackerearth.com
'Like us': http://www.facebook.com/HackerEarth

-- 
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/CAENtUgqwVTL-vOeYst6ZY1tXB94ks2KuQUrOs8eHpeTnwUxKTg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Not able to build the satchmo store

2013-10-04 Thread roopasingh250
I installed python 2.6 and django 1.3.7 in my Linux machine.I followed the 
instruction in [this documentation][1] to install sachmo 0.9.2.I am able to 
import the sachmo in python prompt and able to check the version also.I am 
getting the error at this line "Build Your Store With clonesatchmo"

I am issueing this line to build the sachmo-store python 
/usr/local/lib/python2.6/site-packages/Satchmo-0.9.2-py2.6.egg/EGG-INFO/scripts/clonesatchmo.py

It shows as below and stopped building

Creating the Satchmo Application
Invalid skeleton directory. Path should be 
/path/to/satchmo/projects/skeleton

Need help to solve this.

Thanks


  [1]: http://www.satchmoproject.com/docs/dev/new_installation.html

-- 
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/346de442-c47b-4dfe-b6ae-f047b8979111%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


New version of django-permissionsx

2013-10-04 Thread thinkingpotato
Hi,

I would be absolutely grateful if you could please check it out and give me 
some feedback. What I'm interested in particular is how it works with 
different Django/Python/apps configurations and if the syntax/API is easy 
to follow. I would be even more happy if you found it useful in your 
projects ;)

Docs:
https://github.com/thinkingpotato/django-permissionsx

PyPi:
https://pypi.python.org/pypi/django-permissionsx/

Cheers,
Robert

-- 
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/d3e5abdd-7dd7-497f-b950-da1747e6e79f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best practice for server-generated downloads?

2013-10-04 Thread DJ-Tom
Thanks - that's what I was looking for.

But how do I send the browser back to a specific page after serving the 
download?

Am Donnerstag, 3. Oktober 2013 10:54:51 UTC+2 schrieb John McNamara:
>
> Hi,
>
> Here is an example of using XlsxWriter from SimpleHTTPServer or Django. It 
> probably doesn't do 100% of what you are looking for but it may help anyway.
>
> https://xlsxwriter.readthedocs.org/en/latest/example_http_server.html
>
> John
>
>

-- 
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/38a03396-bc70-4e57-8fae-8a98194be2bf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Custom Filter: Filter output based on a Python list

2013-10-04 Thread Leonardo Giordani
Emmanuel,

for examperiod I'd simply write

[...]
for period in ['DECEMBER 2011', 'MAY 2011', 'DECEMBER 2010']:
context['periods'][period] = Results.objects.all().filter(\
   reg_number = 'DBA/20020/82/DU').filter(examperiod=period)
[...]

Just be careful when dealing with such comparisons since values must be
exactly the same; to state it clearly: this works always if the period
strings ("DECEMBER 2011", ...) are machine-generated and do not come from a
form (user input).

However, check this
pagewhich
contains a very detailed analysis of Django query system.

Speaking about the templates: first of all do not take my code as the
source of the truth, things can be done in several ways.
Given that, I try to give you a bigger picture that hopefully helps you
understanding how to step further.

When introducing Django I always stress the separation between views and
templates, which is the base concept of the whole framework (MVT -
Model/View/Template).
Views are Python functions. Their purpose is to produce data and to return
data, just like any function in this world =)
Jokes apart, views are MOST OF THE TIME used to fetch data from the DB
through models and to return templates rendered in HTTP responses, so that
a browser can show them.

So, putting it simply: views extract data, templates show them (this is
somehow simplistic, but is a good starting point).

Templates are text files that are joined with a dictionary through the
Django template language. Most notably you can insert in the template
elements of the dictionary just inserting "{{ key }}" where "key" is the
dictionary key you want to fetch. If the value you get from the dictionary
is an object or another dictionary, you can use the dotted notation to
access its attributes or keys. So if you write in a template {{ obj }} the
template expects you to pass a dictionary which contains the key 'obj' and
some value that can be printed. If you write {{ obj.name }} the template
expects you to pass a dictionary that contains the key 'obj', which in turn
is something that can be accessed through the 'name' attribute lookup; for
example, a Python object with a 'name' attribute.

Context is the dictionary that the view passes to the template when calling
render_to_response().

So my advice was to select what you pass in the context, since passing
locals() is overkill; you pass the template every variable you have, and
this can result in passing a very big dictionary! Moreover, it is not clear
to another programmer (that is you in a month) what the template really
needs. If you template is made to represent a set of objects in table just
extract the set of objects and pass them to the view. To give you an
example:

*MODEL*
class Exam(models.Model):
label = models.CharField(max_length=30)

*VIEW*
def someview(request):
my_list_of_objects = Exam.objects.filter(label='somelabel')
context = {'objects':my_list_of_objects}
return render_to_response('results.html', context, context_instance =
RequestContext(request))

*TEMPLATE*
[...]

{% for obj in objects %}
{{obj.label}}
{% endfor %}

[...]

This can also be written (and is perfectly correct):

*VIEW*
def someview(request):
my_list_of_objects = *[exam.label for exam
in*Exam.objects.filter(label='somelabel')
*]*
context = {'object':my_list_of_object}
return render_to_response('results.html', context, context_instance =
RequestContext(request))

*TEMPLATE*
[...]

{% for obj in objects %}
{{obj}}
{% endfor %}

[...]

(Please note that in the second example I left the previous nomenclature
for clarity's sake - in a real case I'd call the values 'labels' and not
'objects')

Hope this helps you. Regards,

Leo

Leonardo Giordani
Author of The Digital Cat 
My profile on About.me  - My GitHub
page- My Coderwall
profile 


2013/10/3 +Emmanuel 

> Thanks for the update and the code. Been trying to make sense of the code
> and trying to get it to work. This is my first project so I still have some
> challenges:
>
>
>- My model contains a field examperiod = models.CharField(max_length =
>100) which I need to use to filter. How exactly do I apply that in
>. I can't seem to get it to work.
>- The code you provided to be used in the template is a little
>difficult for me to comprehend. Previously, I could use query.coursecode,
>query.examcode, etc to populate the specific cells in the table. I
>can't seem to figure out how to do that with the new piece of code.
>
> Thanks for the help :)
>
> On Wednesday, October 2, 2013 4:32:22 PM UTC+3, Leo wrote:
>
>> Ok, now I get the point. I STRONGLY suggest to avoid performing big
>> computations while rendering templates, so I think it is better for you to
>> try something like
>>
>> def 

Re: is it possible to make the |safe template filter conditional on content

2013-10-04 Thread Mike Dewhirst

On 4/10/2013 9:44am, Mike Dewhirst wrote:

On 4/10/2013 12:21am, Bill Freeman wrote:

You can certainly write a custom filter.  And if you do that, you can
divvy up your value into footnote links and other, and escape the other
parts yourself, returning the result as a safe string.


So you mean I detect any non-footnote html in the custom filter myself
and convert it to Klingon but add my own html for footnotes and flag all
such fields as safe?

Hadn't thought of that. Might investigate calling the Django safe filter
from within the custom filter ...

Great idea, thanks


And Django is fantastic too :)

All I need to do is ...

from django.utils.safestring import mark_safe

and return mark_safe(value_with_footnote_href) within my custom filter.

... which means I don't have to use the |safe filter and which makes me 
much happier.


Cheers

Mike






Mike




On Thu, Oct 3, 2013 at 2:55 AM, Mike Dewhirst > wrote:

I made a custom template filter (ref_href) which converts numbered
references (like [1], [2] etc) into footnote hyperlinks. It works
but requires the |safe filter which is dangerous.

To be actually safe I want to *only* use the |safe filter when the
data contains a numbered reference. Which I cannot do if it is
permanently in the template. In other words, I want to remove the
|safe filter from the template and incorporate it into my custom
filter which checks that we have an integer between the square
brackets before doing its work.

Just thinking about it now, I suppose I could put a conditional in
the template ...

{% if "[" in value %}
   {{ value | ref_href | safe }}
{% else %}
   {{ value }}
{% endif %}

... but that's a lot of typing over dozens of templates. And it
isn't good enough.

Thanks for any secrets

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/524D14D9.__5090605%40dewhirst.com.au


.

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAB%2BAj0uMUVFmHGY%3DYckq_e03ve1WhKG29ruCUWRU2zaVuFsN2Q%40mail.gmail.com.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/524E66AD.3070104%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.


Disabling object persistence ?

2013-10-04 Thread Marc'h
Hello,

I'm battling with Django in order to try avoiding object persistence when 
initialising foreign key model attributes. The app I'm using Django for 
implements a facade for an already existing database. It's main purpose is 
to be used as a (read-only) ReST server returning objects built by 
aggregating attributes from the already existing database. The Django app 
itself has model classes (and associations) like any other Django app. 
Renderers and Serializers based on those supplied by the rest_framework 
modules have been written and tested. We started by configuring the Django 
app to use a SQLite file, as we're don't really care about object 
persistence. However, when building model instances (by 
extracting/aggregating data from the original non-Django managed database), 
we hit a severe perfomance bottleneck. Each time we initialize a model 
attribute which is a collection of related instances, all these are 
apparently persisted to the Django database.

For example, with a classical Order/Items association, we'd have :

01: orderattributes={...extract attributes from external database using 
> SQL...}
> 02: order=Order(**orderattributes)
> 03: orderitems=[]
> 04: for item in ...items belonging to order...
> 05:itemattributes={...extract attributes from external database using 
> SQL...}
> 06:item=Item(**itemattributes)
> 07:orderitems.append(item)
> 08: order.items_set=orderitems


When reaching line 8, it seems that every Item instance of the orderitems 
collection is persisted in the Django database, which considerably slows 
down the application.
I tried to use an in-memory SQLite database, but couldn't make it work, as 
the syntax for declaring a shared in-memory database (file::memory:...) is 
not handled correctly, yielding a file-based database instead.

Thus, I'd like to know if there is any means to by-pass the automatic 
persistence mechanism when using collection attributes which are 
foreign-key based.

Thanks for any pointers !


Marc'h







-- 
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/ba9a4637-26ac-4f59-923c-ff43d24be02a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-04 Thread Darren Spruell
On Thu, Oct 3, 2013 at 6:15 AM, graeme  wrote:
> I disagree that breaking the back button is always bad. For example suppose
> you have a series of forms (i.e. a "wizard"):
>
> Page 1) fill in form. On POST creates a new Model() and saves it to the
> database
> 2) do stuff to the object (e.g. add inlines, whatever).
> 3) whatever comes next
>
> At stop two, user clicks back. They then post the form again, and get
> another object. On the other hand the page in step 2 can provide a back
> button on the page that takes the user back to edit what they entered on
> page 1. Which is more useful? I would say the latter - and users may not
> then understand that the browser back button and page back button do
> different things.

Django supports this form wizard behavior in a sane way through Form Wizards:

https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/

In the case of form wizards, each step through the series of forms in
the wizard occurs from the same URL, and the API provides users a way
to traverse individual forms (steps) in the wizard in a controlled
way. If the client uses the browser back button, it drops them back
from the URL the form wizard is served from, not to a previous step in
the form.

DS




> On Tuesday, October 1, 2013 8:33:41 PM UTC+5:30, antialiasis wrote:
>>
>> You should still be able to use the back button; it just shouldn't try to
>> post the data again if you do so. Are you getting a prompt about resending
>> post data, or are you just talking about being able to use the back button
>> at all? If the latter, that's exactly what should happen. Breaking the
>> user's back button is bad.
>>
>> On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote:
>>>
>>> The Django  docs (and a lot else) recommend redirecting after
>>> successfully processing a post request (if it changes data). i.e. post, the
>>> save stuff to the database, then redirect.
>>>
>>> Current browsers seem to allow this. I have tried Chromium 28 and 24 on
>>> Linux, I user return redirect(...) after the post, and I can still use the
>>> back button.
>>>
>>> Is it my configuration, or is it usual? What is the best practice if this
>>> is broken?
>>>
>>> In some cases I think tracking where the user is (in the session, or
>>> using the state of a particular object such as an order model), and
>>> redirecting any request for an earlier page in a sequence may be the way to
>>> go. Or is this a solved problem that I am too far behind the curve to know
>>> about?
>
> --
> 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/cf0dd1f1-b004-4595-800f-1190ca9f4171%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Darren Spruell
phatbuck...@gmail.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/CAKVSOJXf58hvD1H6pu%2BMfo5fUMxKm-VDbncr7hSX7Xm14arP7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.