Invalid HTTP_HOST header in shared server

2016-06-27 Thread Luis Zárate
Hi, I am having some issue with gunicorn/nginx configuration. I have a shared server that support several sites (all based in Django) with the same ip address. Invalid HTTP_HOST header: 'www.mysite.com'. You may need to add ' www.mysite.com' to ALLOWED_HOSTS. I checked and all projects have

AUTH_PASSWORD_VALIDATORS not used when creating new users?

2016-06-27 Thread Farhan Khan
Hi all, I set the AUTH_PASSWORD_VALIDATORS variable to the standard set here: https://docs.djangoproject.com/en/1.9/topics/auth/passwords/#enabling-password-validation. When I use the `createsuperuser` function in manage.py, my password must conform to the validators. But when I use

Re: Using django/mod_wsgi with apache httpd ErrorDocument seems to confuse reverse URL mapping

2016-06-27 Thread Patrick Ethier
Quick update, the answer to my question in reading the source code is to set FORCE_SCRIPT_NAME=/wsgi-app/ from the example below. It also seems that the trailing slash in the WSGIScriptAlias is not appropriate, so the directive should be: WSGIScriptAlias /wsgi-app ... It also seems, as per

Re: how to display JSON data in template

2016-06-27 Thread Stephen J. Butler
Your json_obj is just a collection of python data structures (dictionaries, arrays, strings, ints, etc)... it isn't JSON. You need to serialize it to a string first using DjangoJSONEncoder. https://docs.djangoproject.com/en/1.9/topics/serialization/ On Mon, Jun 27, 2016 at 12:41 PM,

how to display JSON data in template

2016-06-27 Thread ayshalab
Greetings, How can I access and display JSON data in a template html file? I am getting the JSON data back in the javascript console as follows : I tried {{ jason_data }} but no luck. Thank you! Here is how I am returning the json data in views.py: return HttpResponse(json_obj,

Re: Serving static files

2016-06-27 Thread ludovic coues
It's not that the framework will come to an halt. It's that a server serving static file directly would be an order of magnitude faster. https://unix4lyfe.org/time/hn.html is a nice article on how server react to heavy load when serving static file. 2016-06-27 18:26 GMT+02:00 Ankush Thakur

Serving static files

2016-06-27 Thread Ankush Thakur
I keep hearing in the docs and in tutorials that frameworks are horrible when it comes to service static files. In production, also, one needs to set up another dedicated server to serve static files. I'm wondering why. What is so special about serving static files that a framework comes to a

How to use password_change function from django.contrib.auth.views

2016-06-27 Thread Juan Sebastian Avila Rodriguez
I tried to implement the password_change view but is not working. I only add the code below to the urls.py: from django.contrib.auth import views as auth_views ... url( r'^change-password/$', auth_views.password_change, name='change_password' ), url(

Using django/mod_wsgi with apache httpd ErrorDocument seems to confuse reverse URL mapping

2016-06-27 Thread Patrick Ethier
Hi, I'm trying to set up mod_wsgi and Django to handle authentication and I'm getting a weird problem. After much troubleshooting I've distilled it down to the configs below: /etc/httpd/conf.d/10-django.conf ServerName site.internal DocumentRoot

Re: Please help me with CBV template_name behaviour.

2016-06-27 Thread James Schneider
> > As an afterthought, I wonder why my misspelling didn't cause an error >>> instead of a "wrong" Template being used? >>> >>> Any insights? >>> >>> >> Not particularly. That should have caused an error. The only way it >> wouldn't have is if you have (or one of your installed apps has) a file >>