Re: What does this code do? Also, testing decorator via terminal?

2012-09-01 Thread Micky Hulse
Hi Kurtis! Many thanks for your reply, I really appreciate the help! :)

On Fri, Aug 31, 2012 at 11:38 PM, Kurtis Mullins
 wrote:
> All that is doing is checking to see if the object named "objects" is an
> HttpResponse object.

Ah, ok! I think you've kicked me in the right direction here.

> that the objects.status_code *should* work, although I'm not sure if it
> returns a number or a string. I'm not sure why this isn't working for you,
> though.

I think it's not working for me because, in my view, I'm not returning:

return HTTPResponse(json.dumps(d), content_type='application/json')

... instead, I'm returning:

return {'this will be': 'JSON'}

Based on your reply, I think I now understand why the original author is using:

if isinstance(objects, HttpResponse):

... meaning, "don't do anything with `objects` if the view is already
passing an HTTPResponse". Essentially, that logic is just trying to
make sure that the view passes the right type of object to the
decorator... Correct? If so, then that's lesson learned for me: Never
try to combine two decorators before fully understanding how the code
works! :D

I thought I was being cool by trying to combine the two... But now I'd
rather spend my time learning how to convert this decorator so that it
works on CBVs.

Thanks again for the help Kurtis, I really appreciate it

Cheers,
Micky

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2012-09-01 Thread nav
Dear All,

hank you for all your replies the reason why a localhost was prepending a 
www in front was because of the PREPEND_WWW=True setting which was not 
present before. Once this setting is commented out everything works as it 
should.

Hope this saves someone some time in the future.

Thanks,
nav

On Friday, August 31, 2012 10:22:41 PM UTC+5:30, nav wrote:
>
> Chris, 
>
> Thank you for your email. I had cleared my cache quite a number of times 
> before. 
>
> What is interesting is that if I start a new Django 1.4.1 the browser 
> finds the server running at 127.0.0.1:8000 and says it worked. 
>
> The application I am working on however still redirects to 
> www.127.0.0.1:8000 and yes it does do a 301 redirect. The application is 
> running on Django 1.2.5 but I doubt the version is at fault. I will need 
> to investigate further. 
>
> Cheers, 
> nav 
>
> On Friday 31 August 2012 09:27 PM, Chris Lawlor wrote: 
> > Oops that should have been addressed to nav, sorry 
> > 
> > On Friday, 31 August 2012 11:57:03 UTC-4, Chris Lawlor wrote: 
> > 
> > Jirka, 
> > 
> > Is your app possibly doing a 301 (Permanent) redirect to www.* ? Or 
> > possibly some other app you were working on recently? Browsers will 
> > cache 301 redirects and automatically do the redirect WITHOUT making 
> > the initial request to 127.0.0.1, so if some project you were 
> > working on issued that redirect at any point, it will keep doing it, 
> > even if your current project doesn't issue a redirect. Try clearing 
> > your browser's cache. 
> > 
> > Chris 
> > 
> > On Tuesday, 28 August 2012 01:26:20 UTC-4, nav wrote: 
> > 
> > Hi Jirka, 
> > 
> > That does not seem to be the case. I set rhe proxy server 
> > settings to no 
> > proxy and it still prepends a www in front of the IP address. I 
> > could 
> > investigate this further but I am little pressed for time at 
> > present. 
> > 
> > Thanks, 
> > nav 
> > 
> > On Tuesday 28 August 2012 10:39 AM, jirka.v...@gmail.com wrote: 
> >  > Hi nav, 
> >  > 
> >  >A long shot - do you happen to have a proxy defined in 
> > your browser? It is possible to define a proxy for *all* request 
> > (including localhost) - this would have the same effect. 
> >  > 
> >  >HTH 
> >  > 
> >  >  Jirka 
> >  > -Original Message- 
> >  > From: nav  
> >  > Sender: django...@googlegroups.com 
> >  > Date: Mon, 27 Aug 2012 21:00:12 
> >  > To: Django users 
> >  > Reply-To: django...@googlegroups.com 
> >  > Subject: Re: Django development running on 127.0.0.1:8000 
> >  not accessible from 
> >  >   same machine 
> >  > 
> >  > Hi Anton, 
> >  > 
> >  > Thank you for your email. 
> >  > 
> >  > I have tried all of the methods you had suggested but to no 
> > avail. 
> >  > 
> >  > In all my years of Django development the localhost address 
> > has worked 
> >  > flawlessly. I have also tried with multiple Django projects 
> > and other 
> >  > Linux installations and the problem persists. This makes me 
> > think this 
> >  > is a DNS issue that may be due to a network related problem. 
> > In which 
> >  > case I will have to investigate. I will post once I find a 
> > work around 
> >  > or solution. 
> >  > 
> >  > Cheers, 
> >  > nav 
> >  > 
> >  > On Aug 27, 5:36 pm, Anton Baklanov  
> > wrote: 
> >  >> oh, i misunderstood your question. 
> >  >> 
> >  >> try to type url with schema into browser's address bar. i 
> > mean, use 'http://localhost:8000/'instead 
> >  of 'localhost:8000'. 
> >  >> also it's possible that some browser extension does this, 
> > try disabling 
> >  >> them all. 
> >  >> 
> >  >> 
> >  >> 
> >  >> 
> >  >> 
> >  >> 
> >  >> 
> >  >> 
> >  >> 
> >  >> On Mon, Aug 27, 2012 at 10:53 AM, nav 
> >  wrote: 
> >  >>> Dear Folks, 
> >  >> 
> >  >>> I am running my django development server on 127.0.0.1:8000 
> >  and accessing 
> >  >>> this address from my web browser on the same machine. In 
> > the past few days 
> >  >>> I have found thet the web browsers keep prepending the 
> > address with "www." 
> >  >>> when using the above address. 127.0.0.1 without the prot 
> > number works fine 
> >  >>> but the django development server requires a port number. 
> >  >> 
> >  >

Re: Using different ports in views?

2012-09-01 Thread Serge G. Spaolonzi
Django's internal webserver is worth for development proposes only. In
production environments you should use apache/wsgi or another server.
Facing a similar situation i would create different projects for each
port that share the same database. From the development server you can
run each project in different ports, from apache/wsgi you can create a
different virtualhost from each port.

Regards

On Fri, Aug 31, 2012 at 8:49 PM, Robert Steckroth
 wrote:
> Hello gang, I would like to have some of my django views send the
> response to a different ports.
> Is it possible to specify which port to use in the views?
> --
> Bust0ut, Surgemcgee: Systems Engineer ---
> surgemcgee.com
> BudTVNetwork.com
> RadioWeedShow.com
> "Bringing entertainment to Unix"
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>



-- 
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 post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



setting up Django Compressor

2012-09-01 Thread Joni Bekenstein
The generated css file seems to be in your media directory. If you copy that 
URL, can you see the css file? Are you using Django's dev server (runserver)? 
If so, did you add to your urls.py a view to serve the media files? (and that 
view should only exist when DEBUG is true since in production you're probably 
going to serve static files and media files directly with your webserver)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jHs112LcrVAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Provide a single text field (editable through admin panel) w/o using a whole model

2012-09-01 Thread Joni Bekenstein
How about https://github.com/comoga/django-constance ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ECCuEvzTJbIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Provide editable single text field (through admin) w/o using a whole model

2012-09-01 Thread Joni Bekenstein
There are 2 answers to your question here: 
https://groups.google.com/forum/m/?fromgroups#!topic/django-users/0uU1zYH_yOw

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/rElDeRwtiCAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Any good Open Source Django-Based CRM's ?

2012-09-01 Thread pajju
HI

I'm looking for Django Powered Open Sourced CRM's which is ready for 
Production use.
I did not find much help google'ing for the same. :)

And In other Technologies, Open Sourced based CRM's which one is better - 
vTiger or SugarCRM or anything better which is fully Open Sourced ? 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-VtPeadpBvUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Any good Open Source Django-Based CRM's ?

2012-09-01 Thread Thomas Orozco
Django crm is pretty good and open source!
On Sep 1, 2012 4:53 PM, "pajju"  wrote:

> HI
>
> I'm looking for Django Powered Open Sourced CRM's which is ready for
> Production use.
> I did not find much help google'ing for the same. :)
>
> And In other Technologies, Open Sourced based CRM's which one is better -
> vTiger or SugarCRM or anything better which is fully Open Sourced ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-VtPeadpBvUJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Any good Open Source Django-Based CRM's ?

2012-09-01 Thread Thomas Orozco
Dismiss what I said, I misread (and miswrote) CRM for CMS -_-

2012/9/1 Thomas Orozco 

> Django crm is pretty good and open source!
> On Sep 1, 2012 4:53 PM, "pajju"  wrote:
>
>> HI
>>
>> I'm looking for Django Powered Open Sourced CRM's which is ready for
>> Production use.
>> I did not find much help google'ing for the same. :)
>>
>> And In other Technologies, Open Sourced based CRM's which one is better -
>> vTiger or SugarCRM or anything better which is fully Open Sourced ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/-VtPeadpBvUJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Using different ports in views?

2012-09-01 Thread Robert Steckroth
I appreciate you taking the time to respond to my inquiry. I believe
that my question was
hastily typed and therefor too brief for an adequate response. Next
time I poll this community, it will be more
zealous and less anxious regarding my/our Django development. Sincerely Robert.

On Sat, Sep 1, 2012 at 6:07 AM, Serge G. Spaolonzi  wrote:
> Django's internal webserver is worth for development proposes only. In
> production environments you should use apache/wsgi or another server.
> Facing a similar situation i would create different projects for each
> port that share the same database. From the development server you can
> run each project in different ports, from apache/wsgi you can create a
> different virtualhost from each port.
>
> Regards
>
> On Fri, Aug 31, 2012 at 8:49 PM, Robert Steckroth
>  wrote:
>> Hello gang, I would like to have some of my django views send the
>> response to a different ports.
>> Is it possible to specify which port to use in the views?
>> --
>> Bust0ut, Surgemcgee: Systems Engineer ---
>> surgemcgee.com
>> BudTVNetwork.com
>> RadioWeedShow.com
>> "Bringing entertainment to Unix"
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
BudTVNetwork.com
RadioWeedShow.com
"Bringing entertainment to Unix"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Using the CSRF token with two views

2012-09-01 Thread Robert Steckroth
Hello gang, I have created a dynamic template loading system utilizing
ajax inside the template.
The templates and data are retrieved and displayed as expected. The
problem is that the contact form
is provided by one view and processed by another. This, of course
raises a CSRF token error in the posting
submit. What is the best way to inform the processing view of my CSRF
token information from the providing one.
I am unable to combine these views for "design structure" reasons.
Also, the form/template can be pulled from the
providing view many times in the template (not just at load time). I
am thinking along the lines of a session variable and
would hate to exempt the CSRF token in the views for security reasons.

-- 
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
BudTVNetwork.com
RadioWeedShow.com
"Bringing entertainment to Unix"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: About the Django URL tag {% url %}……

2012-09-01 Thread 绯红天空
2012/8/31 Amyth Arora 

> Paste the code to your urls.py and highlight which urls are not working.
>
>
> On Thu, Aug 30, 2012 at 8:07 PM, Nikolas Stevenson-Molnar <
> nik.mol...@consbio.org> wrote:
>
>> Also, your URL patters should start with "^" like your first one does.
>> And unless you need the older version, I would upgrade to the latest
>> stable version of Django (1.4.1) before doing anything else.
>>
>> _Nik
>>
>> On 8/29/2012 7:37 PM, Scarl wrote:
>> > My python version is 2.7.2 , and django version is 1.2.7
>> > I have a test just now.
>> > If i put the name parameter in mysite.urls like url(r'^test/$',
>> > 'testpage', name='www'), the {% url www %} can work...
>> > But when I put the name parameter in mysite.myapp.urls like
>> > url(r'help/$', 'testpage', name='www'), and mysite.urls is
>> > url(r'test/', include(mysite.myapp.urls)). This time the {% url www %}
>> > can not work!
>> > Is it when I use include('mysite.myapp.urls'), the name parameter can
>> > not work? And the name parameter can only in mysite.urls?
>> > Can anyone help me? thx!
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Django users" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/django-users/-/x6qNBIrfKLsJ.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras.offic...@gmail.com, ad...@techstricks.com
> Twitter - @a_myth_
> http://techstricks.com/
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



blog.rar
Description: application/rar


Editable Tables

2012-09-01 Thread Sait Maraşlıoğlu
Just seen a demo page
http://nextgensim.info/grids
so beautiful grids,
lift framework can do that, I guess, havent dig much but as far as I seen, 
its an alternative framework.
Can anybody tell me how to create this kind of interactive tables? What 
django has to offer, if not What keywords, I need to search?
thx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ryukcNt0x2wJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



matching a name in url

2012-09-01 Thread Mando
Hello all, I'm still new to django and I'm having a little problem with the 
url matching.

here is my line of code
url(r'^comment/allcomments/(?P[-\w]+)/all/$', 
'comment.views.allUserComments'),

def allUserComments(request, commentName):
userComments = Post.objects.get(name=commentName)
return render_to_response('/comment/comments.html', { 'Post': 
userComments })


what i want it to do is similar to the Poll tutorial on 
https://www.djangoproject.com/, but I can't seem to get it to work. I keep 
getting the following after clicking on the user "name"

Using the URLconf defined in Sampleblog.urls, Django tried these URL 
patterns, in this order:

   1. ^$ [name='home']
   2. ^comment/allcomments/(?P[-\w]+)/all/$
   3. ^comment/comments.html$ [name='comment']
   4. ^static/(?P.*)$
   5. ^admin/doc/
   6. ^admin/

The current URL, comment/mando/all/, didn't match any of these.

the comment page shows this with a link for the "name"
Last 5 Comments
mando  - said on Sept. 1, 
2012, 5:18 p.m
Testing 2

mando  - said on Sept. 1, 
2012, 5:17 p.m
Testing 12

mando  - said on Sept. 1, 
2012, 5:17 p.m
 1
is there something i'm missing here? Any suggestions are greatly appreciated

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/D-skLJUDiP4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django deployment questions

2012-09-01 Thread Mike
I just started to use Fabric to automate my deployments to my staging 
server. (and when I'm ready, to the production server as well).  I have 
just a few questions for more experienced folks:

Do you clone your whole git repository onto your server, or upload a new 
archive each time you release?  Seems like it would be easier to switch 
versions of the running code, by switching tags, but it would use up a lot 
more disk space. I'd also have to have an ssh key to the central git 
repository on the web server.  Sounds like that could be a security issue. 
At the moment I'm programming Fabric to upload an archive, untar it, and 
symlink it to a fixed directory where the web server expects it to be.

Do you log out all users or just reset the sessions (manage.py reset 
sessions)?

thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jIsZUTiptKQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Using the CSRF token with two views

2012-09-01 Thread Melvyn Sopacua
On 2-9-2012 0:52, Robert Steckroth wrote:

> The
> problem is that the contact form
> is provided by one view and processed by another. This, of course
> raises a CSRF token error in the posting
> submit.
I don't see the logic of this, unless by view you mean request. This is
also a bit confusing:
>  I have created a dynamic template loading system utilizing
> ajax inside the template.

If by template you mean django template, then the above can not ever be
created. AJAX is incapable of generating server side code by design.
What is more likely, is that your template generates javascript that
fetches bits of HTML using other urls, that are then coupled to other
django templates and this gives a similar end result in which a page
consists of dynamic blocks akin to django's {% include %} tag.

However, the execution flow is still that django provides the content
for the browser, so the contact form can have it's own CSRF token. Are
you providing that token in the template that renders the contact form?
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: matching a name in url

2012-09-01 Thread Melvyn Sopacua
On 2-9-2012 0:48, Mando wrote:

> here is my line of code
> url(r'^comment/allcomments/(?P[-\w]+)/all/$', 
 ^^^
> The current URL, comment/mando/all/, didn't match any of these.

See it now?
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2012-09-01 Thread Melvyn Sopacua
On 1-9-2012 9:31, nav wrote:

> hank you for all your replies the reason why a localhost was prepending a 
> www in front was because of the PREPEND_WWW=True setting which was not 
> present before. Once this setting is commented out everything works as it 
> should.
First of all, thanks for following up and not leaving the search results
without an answer.

> Hope this saves someone some time in the future.
It can save someone more time if you'd file a bug report for it. Django
should make no attempts to prepend www if the requested hostname is a
raw IP address (for both IPv4 and 6). It makes no sense to do that.


-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What does this code do? Also, testing decorator via terminal?

2012-09-01 Thread Melvyn Sopacua
On 1-9-2012 8:38, Kurtis Mullins wrote:
>>
>> On Fri, Aug 31, 2012 at 9:17 PM, Micky Hulse  wrote:
>>> I'd like to add:
>>> if objects.status_code != 200:
>>> return objects
>>> ... which is found via this code:
>>> 
>>
>> Doh! After a bit of trial and error, I given up on trying to merge
>> those two code snippets.
>>
>> I'd still like to know what `if isinstance(objects, HttpResponse)` is
>> doing?
> 
> 
> All that is doing is checking to see if the object named "objects" is an
> HttpResponse object.

More precise, if it's an object instance that has HttpResponse as a
class in it's inheritance chain.
The goal of this check is to be sure you can perform certain operations
on it. You can of course just perform these operations and if the
operation isn't supported then just let it blow up, but doing an
isinstance check allows you to catch the error earlier and give a better
diagnostic to the end user.
There's also a negative to the check: If I have good reasons not to
subclass HttpResponse but can still make it behave like HttpResponse,
then this check is working against me.

-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.