Re: Server Error 500 Nginx when DEBUG=False

2023-01-29 Thread ALBERT ASHABA AHEEBWA
Thank you Larry!

As I mentioned before, this only happens when DEBUG = False.

I deployed the same app to pythonanywhere and it worked fine. No errors
whatsoever.

So I do believe it is has to do with my nginx.

My problem with it is that only 2 routes are not working fine.



Best Regards,

Albert Ashaba Aheebwa
+256 781 435857

On Sun, 29 Jan 2023, 17:20 Larry Martell,  wrote:

>
>
> On Sun, Jan 29, 2023 at 9:14 AM ALBERT ASHABA AHEEBWA <
> ashabaaheebwaalb...@gmail.com> wrote:
>
>> So I was able to successfully host my first ever Django app on linode.
>> After the excitement had won off, I started testing the routes, everything
>> was running fine except for two routes.
>>
>> SERVER ERROR (500)
>>
>> These two views are sharing a template and I much doubt that is the
>> cause. Since they are pointing to different routes.
>>
>> There's nothing in the /var/log/nginx/error.log file that is helpful.
>>
>> Everything is working as expected when DEBUG=True.
>>
>> Please help point me in the right direction.
>>
>
> Check the uwsgi and Django logs. Also you can try using runserver and
> seeing if any errors are shown there. If that does not yield anything
> useful, set a breakpoint and step through the code until you find where the
> error is coming from.
>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACwCsY6n_2CgcScNXtR8TwH_r8r2hMM6otQoVX8Or%2BkfsW617A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACwCsY6n_2CgcScNXtR8TwH_r8r2hMM6otQoVX8Or%2BkfsW617A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAQecPfCETmEYTa%2By0o%2Bv%2BAOBGzyAqE_b3E_OgLNnq-tK_SSZA%40mail.gmail.com.


Re: Server Error 500 Nginx when DEBUG=False

2023-01-29 Thread Larry Martell
On Sun, Jan 29, 2023 at 9:14 AM ALBERT ASHABA AHEEBWA <
ashabaaheebwaalb...@gmail.com> wrote:

> So I was able to successfully host my first ever Django app on linode.
> After the excitement had won off, I started testing the routes, everything
> was running fine except for two routes.
>
> SERVER ERROR (500)
>
> These two views are sharing a template and I much doubt that is the cause.
> Since they are pointing to different routes.
>
> There's nothing in the /var/log/nginx/error.log file that is helpful.
>
> Everything is working as expected when DEBUG=True.
>
> Please help point me in the right direction.
>

Check the uwsgi and Django logs. Also you can try using runserver and
seeing if any errors are shown there. If that does not yield anything
useful, set a breakpoint and step through the code until you find where the
error is coming from.

>

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


Server Error 500 Nginx when DEBUG=False

2023-01-29 Thread ALBERT ASHABA AHEEBWA
So I was able to successfully host my first ever Django app on linode.
After the excitement had won off, I started testing the routes, everything
was running fine except for two routes.

SERVER ERROR (500)

These two views are sharing a template and I much doubt that is the cause.
Since they are pointing to different routes.

There's nothing in the /var/log/nginx/error.log file that is helpful.

Everything is working as expected when DEBUG=True.

Please help point me in the right direction.


Best Regards,

Albert Ashaba Aheebwa
+256 781 435857

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAQecPf%3D2DmPn7_1FOk-CHnRCriR2XjHKUrPJPteyXn5KkLouQ%40mail.gmail.com.


Re: Server Error (500)

2019-04-09 Thread Julio Cojom
If it's development servers or localhost , allow DEBUG=True, that will help
you a lot every time that you found this issues.

Assuming that you use git, if you use localhost before push your changes,
then the shell where you run "manage.py runserver" will show you specific
data about your problem.


On Tue, Apr 9, 2019, 4:46 AM tribhuvan kishor 
wrote:

> first of all, allow debugging that will help you to show server errors and
> their specific reasons.
> setting.py
> DEBUG=true
> then run make migration command
> python manage makemigrations
> then migrate the model
> by using
> python manage migrate
> then let us know if there is any error
>
>
> On Tue, Apr 9, 2019 at 3:14 AM Roger Gammans 
> wrote:
>
>> Did you run 'python manage.py migrate' ?
>>
>> Did it come back with any errors?
>>
>> I ask because specifying price field for values up to 10^9998 strikes me
>> as extreme an likely to causes problems; perhaps you meant max_digits=7 not
>> 1 .
>>
>>
>> On Mon, 2019-04-08 at 04:26 -0700, fazal rehman wrote:
>>
>> Hello,
>> I am a beginner in django.I am getting Server error(500) whenever I am
>> trying to open the server have made some objects, I can see them but when i
>> am trying to open it I get error 500. I have one DEBUG=false.I have
>> attached models.py and settings.py.
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1554727878.3451.6.camel%40gammascience.co.uk
>> <https://groups.google.com/d/msgid/django-users/1554727878.3451.6.camel%40gammascience.co.uk?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> regards
> Tribhuvan Kishor Bhaskar
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACiphSUVyUOQ0G-td6gMXfks5X0U5vPHP4PuCGA_YH-3%2Bvsy-g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACiphSUVyUOQ0G-td6gMXfks5X0U5vPHP4PuCGA_YH-3%2Bvsy-g%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Server Error (500)

2019-04-09 Thread tribhuvan kishor
first of all, allow debugging that will help you to show server errors and
their specific reasons.
setting.py
DEBUG=true
then run make migration command
python manage makemigrations
then migrate the model
by using
python manage migrate
then let us know if there is any error


On Tue, Apr 9, 2019 at 3:14 AM Roger Gammans 
wrote:

> Did you run 'python manage.py migrate' ?
>
> Did it come back with any errors?
>
> I ask because specifying price field for values up to 10^9998 strikes me
> as extreme an likely to causes problems; perhaps you meant max_digits=7 not
> 1 .
>
>
> On Mon, 2019-04-08 at 04:26 -0700, fazal rehman wrote:
>
> Hello,
> I am a beginner in django.I am getting Server error(500) whenever I am
> trying to open the server have made some objects, I can see them but when i
> am trying to open it I get error 500. I have one DEBUG=false.I have
> attached models.py and settings.py.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1554727878.3451.6.camel%40gammascience.co.uk
> <https://groups.google.com/d/msgid/django-users/1554727878.3451.6.camel%40gammascience.co.uk?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
regards
Tribhuvan Kishor Bhaskar

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACiphSUVyUOQ0G-td6gMXfks5X0U5vPHP4PuCGA_YH-3%2Bvsy-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Server Error (500)

2019-04-08 Thread Roger Gammans
Did you run 'python manage.py migrate' ?

Did it come back with any errors? 

I ask because specifying  price field for values up to 10^9998 strikes
me as extreme an likely to causes problems; perhaps you meant
max_digits=7 not 1 .


On Mon, 2019-04-08 at 04:26 -0700, fazal rehman wrote:
> Hello,I am a beginner in django.I am getting Server error(500)
> whenever I am trying to open the server have made some objects, I can
> see them but when i am trying to open it I get error 500. I have one
> DEBUG=false.I have attached models.py and settings.py.
> 
> 
> 
> -- 
> 
> 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 https://groups.google.com/group/django-users.
> 
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/922704da-519c-4503-8753-
> a631949ba9a7%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 

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


Re: Server Error (500)

2019-04-08 Thread fazal rehman


On Monday, April 8, 2019 at 5:22:12 PM UTC+5:30, Jeff_dev wrote:
>
> Kindly attach your view.py 
>
> On Monday, 8 April 2019 12:26:18 UTC+1, fazal rehman wrote:
>>
>> Hello,
>> I am a beginner in django.I am getting Server error(500) whenever I am 
>> trying to open the server have made some objects, I can see them but when i 
>> am trying to open it I get error 500. I have one DEBUG=false.I have 
>> attached models.py and settings.py.
>>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e153a4bf-c3a1-442b-a4e7-cbec72fb6d02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
from django.shortcuts import render

# Create your views here.


Re: Server Error (500)

2019-04-08 Thread AMI FIDELE
hello fazal
please go into your settings and change debug into true
like this:

DEBUG = True

ALLOWED_HOSTS = []


On Mon, Apr 8, 2019 at 1:26 PM fazal rehman 
wrote:

> Hello,
> I am a beginner in django.I am getting Server error(500) whenever I am
> trying to open the server have made some objects, I can see them but when i
> am trying to open it I get error 500. I have one DEBUG=false.I have
> attached models.py and settings.py.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Server Error (500)

2019-04-08 Thread Jeff_dev
Kindly attach your view.py 

On Monday, 8 April 2019 12:26:18 UTC+1, fazal rehman wrote:
>
> Hello,
> I am a beginner in django.I am getting Server error(500) whenever I am 
> trying to open the server have made some objects, I can see them but when i 
> am trying to open it I get error 500. I have one DEBUG=false.I have 
> attached models.py and settings.py.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e944cafa-67a3-4b9e-892f-deb72fdedec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Server Error (500)

2019-04-08 Thread fazal rehman
Hello,
I am a beginner in django.I am getting Server error(500) whenever I am 
trying to open the server have made some objects, I can see them but when i 
am trying to open it I get error 500. I have one DEBUG=false.I have 
attached models.py and settings.py.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
from django.db import models

# Create your models here.
class product(models.Model):
	title = models.CharField(max_length=120)
	description = models.TextField(blank= True,null= True)
	price = models.DecimalField(decimal_places=2,max_digits=1)
	summary= models.TextField()
"""
Django settings for trydjango project.

Generated by 'django-admin startproject' using Django 2.0.7.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'q)49o@ii!s(h!4zp49ag#gip6yc#ezw(d9v71!5v#%s=yl$'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1','localhost']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

#third party app  
'products',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'trydjango.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'trydjango.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = '/static/'



Re: Why get "Server Error 500" instead of 404 template?

2017-12-11 Thread Chris Seberino
I didn't have logging enabled in my settings.py.

Problem solved.






 

>
>
>
> ---
> % more nginx.conf
>
> server {
> server_name ~^(www\.)?domainname\.(org|com)$;
> listen  80;
> return  301 https://domainname.org$request_uri;
> }
>
> server {
> server_name ~^(www\.)?domainname\.com$;
> listen  443 ssl http2;
> ssl_certificate /etc/letsencrypt/live/
> domainname.org/fullchain.pem;
> ssl_certificate_key /etc/letsencrypt/live/
> domainname.org/privkey.pem;
> return  301 https://domainname.org$request_uri;
> }
>
> server {
> server_name ~^(www\.)?domainname.org$;
> listen  443 ssl http2;
> ssl_certificate /etc/letsencrypt/live/
> domainname.org/fullchain.pem;
> ssl_certificate_key /etc/letsencrypt/live/
> domainname.org/privkey.pem;
> root/home/cs/Ws/domainname.org/nginx;
>
> location / {
> location /static {
> }
>
> include/etc/nginx/uwsgi_params;
> uwsgi_pass localhost:8000;
> }
> }
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b51ffc57-ca28-412f-bcc7-1c4e4fba4522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why get "Server Error 500" instead of 404 template?

2017-12-11 Thread Chris Seberino


>
> For more information, you need to show us your nginx configuration and 
> your wsgi server configuration.
>
>
>
Thanks a million.  Here is what you asked for...


---
 % more wsgi.py 

import django.core.wsgi
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
application = django.core.wsgi.get_wsgi_application()


---
% more nginx.conf

server {
server_name ~^(www\.)?domainname\.(org|com)$;
listen  80;
return  301 https://domainname.org$request_uri;
}

server {
server_name ~^(www\.)?domainname\.com$;
listen  443 ssl http2;
ssl_certificate
 /etc/letsencrypt/live/domainname.org/fullchain.pem;
ssl_certificate_key 
/etc/letsencrypt/live/domainname.org/privkey.pem;
return  301 https://domainname.org$request_uri;
}

server {
server_name ~^(www\.)?domainname.org$;
listen  443 ssl http2;
ssl_certificate
 /etc/letsencrypt/live/domainname.org/fullchain.pem;
ssl_certificate_key 
/etc/letsencrypt/live/domainname.org/privkey.pem;
root/home/cs/Ws/domainname.org/nginx;

location / {
location /static {
}

include/etc/nginx/uwsgi_params;
uwsgi_pass localhost:8000;
}
}

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45f769d1-4ee0-4662-abe2-fa55ad8bf485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why get "Server Error 500" instead of 404 template?

2017-12-11 Thread Antonis Christofides
Hello,

Usually when you get a mere "Server error 500" without it showing you the Debug
page though you have DEBUG=True, this means that the error occurs very early,
before Django has had the opportunity to run. In that case, the error should
have been logged in the gunicorn/uwsgi/whatever log, i.e. in whatever program it
is that runs Django.

For more information, you need to show us your nginx configuration and your wsgi
server configuration.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 2017-12-10 18:42, Chris Seberino wrote:
> I cannot track down why 404 page isn't being used.  I can't get any help from
> syslog or Nginx log files.
> I tried adding DEBUG=True to settings.py and still no clues.
> I only get "Server Error 500".
>
> Here is settings.py
>
> TEMPLATES        = [{"BACKEND" :
>                         "django.template.backends.django.DjangoTemplates",
>                      "DIRS"    : [VIEWS.format(e) for e in APPS],
>                      "OPTIONS" :
>                         {"context_processors" :
>                          ["django.template.context_processors.debug",
>                           "django.template.context_processors.request"]}}]
> MIDDLEWARE       = ["django.middleware.security.SecurityMiddleware",
>                     "django.contrib.sessions.middleware.SessionMiddleware",
>                     "django.middleware.common.CommonMiddleware",
>                     "django.middleware.csrf.CsrfViewMiddleware",
>                     "django.contrib.auth.middleware.AuthenticationMiddleware",
>                     "django.contrib.messages.middleware.MessageMiddleware",
>                     "django.middleware.clickjacking.XFrameOptionsMiddleware"]
> WSGI_APPLICATION = "nginx.wsgi.application"
> INSTALLED_APPS   = APPS + ["django.contrib.admin",
>                            "django.contrib.auth",
>                            "django.contrib.contenttypes",
>                            "django.contrib.messages",
>                            "django.contrib.sessions",
>                            "django.contrib.staticfiles"]
> -- 
> 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
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/977652c4-f86e-491c-a5af-ccbba38dc733%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/977652c4-f86e-491c-a5af-ccbba38dc733%40googlegroups.com?utm_medium=email_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

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


Why get "Server Error 500" instead of 404 template?

2017-12-10 Thread Chris Seberino
I cannot track down why 404 page isn't being used.  I can't get any help 
from syslog or Nginx log files.
I tried adding DEBUG=True to settings.py and still no clues.
I only get "Server Error 500".

Here is settings.py

TEMPLATES= [{"BACKEND" :
"django.template.backends.django.DjangoTemplates",
 "DIRS": [VIEWS.format(e) for e in APPS],
 "OPTIONS" :
{"context_processors" :
 ["django.template.context_processors.debug",
  "django.template.context_processors.request"]}}]
MIDDLEWARE   = ["django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",

"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",

"django.middleware.clickjacking.XFrameOptionsMiddleware"]
WSGI_APPLICATION = "nginx.wsgi.application"
INSTALLED_APPS   = APPS + ["django.contrib.admin",
   "django.contrib.auth",
   "django.contrib.contenttypes",
   "django.contrib.messages",
   "django.contrib.sessions",
   "django.contrib.staticfiles"]

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/977652c4-f86e-491c-a5af-ccbba38dc733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: server error (500)

2013-07-25 Thread Charly Román
You need to add a app, the error is clear, yo don't have anything to show.

2013/7/25 Oliver :
> Thanks Evans.  I'm new to Django so Im trying to learn faster on setting up
> my project or apps.  I appreciate the help for pointing out what I'm
> missing.
>
> Thanks so much.  I'll get to work now :)
>
>
>
>
> On Thursday, July 25, 2013 9:36:53 AM UTC-4, Tom Evans wrote:
>>
>> On Thu, Jul 25, 2013 at 2:32 PM, Oliver  wrote:
>> > I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found
>> > the
>> > requested URL / not found on the server"
>>
>> Yes. You will need to add some views and URLs to the server if you
>> want to see things when you go to URLs.
>>
>> When you still had debug=True, Django spits out the "It works…"
>> message, which ends with this sentence:
>>
>> "You're seeing this message because you have DEBUG = True in your
>> Django settings file and you haven't configured any URLs. Get to
>> work!"
>>
>> Get to it!
>>
>> Cheers
>>
>> Tom
>
> --
> 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.




Re: server error (500)

2013-07-25 Thread Oliver
Thanks Evans.  I'm new to Django so Im trying to learn faster on setting up 
my project or apps.  I appreciate the help for pointing out what I'm 
missing.

Thanks so much.  I'll get to work now :)




On Thursday, July 25, 2013 9:36:53 AM UTC-4, Tom Evans wrote:
>
> On Thu, Jul 25, 2013 at 2:32 PM, Oliver  
> wrote: 
> > I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found 
>  the 
> > requested URL / not found on the server" 
>
> Yes. You will need to add some views and URLs to the server if you 
> want to see things when you go to URLs. 
>
> When you still had debug=True, Django spits out the "It works…" 
> message, which ends with this sentence: 
>
> "You're seeing this message because you have DEBUG = True in your 
> Django settings file and you haven't configured any URLs. Get to 
> work!" 
>
> Get to it! 
>
> Cheers 
>
> Tom 
>

-- 
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: server error (500)

2013-07-25 Thread Oliver
I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found  the 
requested URL / not found on the server"







On Thursday, July 25, 2013 8:19:13 AM UTC-4, Oliver wrote:
>
> when you change Debug=False
>
>
>
>
> On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>>
>> The error log doesn't show anything. In which step following the 
>> documentation are you getting this error? 
>>
>> On Thu, Jul 25, 2013 at 12:09 PM, Oliver <oda...@gmail.com> wrote: 
>> > my environment is in my local pc or machine so its a development 
>> machine. 
>> > 
>> > I tried that empy field in allowed_host. 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
>> >> 
>> >> use this in your settings.py 
>> >> ALLOWED_HOSTS = [] 
>> >> 
>> >> where are you envirioment? you app there in production or development? 
>> >> Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com> escreveu: 
>> >> > 
>> >> > Hi, 
>> >> 
>> >> > 
>> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com> wrote: 
>> >> > > If I set DEBUG = False, I get this 
>> >> > > 
>> >> > > It worked! 
>> >> > > 
>> >> > > Congratulations on your first Django-powered page. 
>> >> > > 
>> >> > > Of course, you haven't actually done any work yet. Here's what to 
>> do 
>> >> > > next: 
>> >> > > 
>> >> > > If you plan to use a database, edit the DATABASES setting in 
>> >> > > mysite/settings.py. 
>> >> > > Start your first app by running python manage.py startapp 
>> [appname]. 
>> >> > > 
>> >> > > You're seeing this message because you have DEBUG = True in your 
>> >> > > Django 
>> >> > > settings file and you haven't configured any URLs. Get to work! 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > If I set it to true, I get the server error (500).  I created the 
>> >> > > template 
>> >> > > and static folder inside mysite folder.  Here is my setting.py. 
>> >> > > 
>> >> > 
>> >> > Can  you check the apache error log to see if you can find more 
>> >> > information there? It is located in 
>> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>> >> > 
>> >> > 
>> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
>> >> > > following the 
>> >> > > tutorials at Django website documentation. 
>> >> > > 
>> >> > > I appreciate any help. 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > # Django settings for mysite project. 
>> >> > > 
>> >> > > DEBUG = True 
>> >> > > TEMPLATE_DEBUG = DEBUG 
>> >> > > 
>> >> > > ADMINS = ( 
>> >> > > # ('mysite', 'em...@email.com'), 
>> >> 
>> >> > > ) 
>> >> > > 
>> >> > > MANAGERS = ADMINS 
>> >> > > 
>> >> > > DATABASES = { 
>> >> > > 'default': { 
>> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
>> >> > > 'postgresql_psycopg2', 
>> >> > > 'mysql', 'sqlite3' or 'oracle'. 
>> >> > > 'NAME': 'mysitedb',  # Or path to 
>> database 
>> >> > > file 
>> >> > > if using sqlite3. 
>> >> > > # The following settings are not used with sqlite3: 
>> >> > > 'USER': 'root', 
>> >> > > 'PASSWORD': '', 
>> >> > > 'HOST': '',  # Empty for localhost 
>> through 
>> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
>> >> > > 'PORT': '',  # Set to empty string for 
>> >> > > default. 
>>

Re: server error (500)

2013-07-25 Thread Tom Evans
On Thu, Jul 25, 2013 at 2:32 PM, Oliver  wrote:
> I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found  the
> requested URL / not found on the server"

Yes. You will need to add some views and URLs to the server if you
want to see things when you go to URLs.

When you still had debug=True, Django spits out the "It works…"
message, which ends with this sentence:

"You're seeing this message because you have DEBUG = True in your
Django settings file and you haven't configured any URLs. Get to
work!"

Get to it!

Cheers

Tom

-- 
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: server error (500)

2013-07-25 Thread Oliver
I did allowed host to 0.0.0.0.  It's back to server error(500)

On Thursday, July 25, 2013 9:32:45 AM UTC-4, Christian Erhardt wrote:
>
> Set Allowed Hosts to 0.0.0.0
>
> Am Donnerstag, 25. Juli 2013 14:19:13 UTC+2 schrieb Oliver:
>>
>> when you change Debug=False
>>
>>
>>
>>
>> On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>>>
>>> The error log doesn't show anything. In which step following the 
>>> documentation are you getting this error? 
>>>
>>> On Thu, Jul 25, 2013 at 12:09 PM, Oliver <oda...@gmail.com> wrote: 
>>> > my environment is in my local pc or machine so its a development 
>>> machine. 
>>> > 
>>> > I tried that empy field in allowed_host. 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
>>> >> 
>>> >> use this in your settings.py 
>>> >> ALLOWED_HOSTS = [] 
>>> >> 
>>> >> where are you envirioment? you app there in production or 
>>> development? 
>>> >> Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com> escreveu: 
>>> >> > 
>>> >> > Hi, 
>>> >> 
>>> >> > 
>>> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com> wrote: 
>>> >> > > If I set DEBUG = False, I get this 
>>> >> > > 
>>> >> > > It worked! 
>>> >> > > 
>>> >> > > Congratulations on your first Django-powered page. 
>>> >> > > 
>>> >> > > Of course, you haven't actually done any work yet. Here's what to 
>>> do 
>>> >> > > next: 
>>> >> > > 
>>> >> > > If you plan to use a database, edit the DATABASES setting in 
>>> >> > > mysite/settings.py. 
>>> >> > > Start your first app by running python manage.py startapp 
>>> [appname]. 
>>> >> > > 
>>> >> > > You're seeing this message because you have DEBUG = True in your 
>>> >> > > Django 
>>> >> > > settings file and you haven't configured any URLs. Get to work! 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > If I set it to true, I get the server error (500).  I created the 
>>> >> > > template 
>>> >> > > and static folder inside mysite folder.  Here is my setting.py. 
>>> >> > > 
>>> >> > 
>>> >> > Can  you check the apache error log to see if you can find more 
>>> >> > information there? It is located in 
>>> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>>> >> > 
>>> >> > 
>>> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
>>> >> > > following the 
>>> >> > > tutorials at Django website documentation. 
>>> >> > > 
>>> >> > > I appreciate any help. 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > # Django settings for mysite project. 
>>> >> > > 
>>> >> > > DEBUG = True 
>>> >> > > TEMPLATE_DEBUG = DEBUG 
>>> >> > > 
>>> >> > > ADMINS = ( 
>>> >> > > # ('mysite', 'em...@email.com'), 
>>> >> 
>>> >> > > ) 
>>> >> > > 
>>> >> > > MANAGERS = ADMINS 
>>> >> > > 
>>> >> > > DATABASES = { 
>>> >> > > 'default': { 
>>> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
>>> >> > > 'postgresql_psycopg2', 
>>> >> > > 'mysql', 'sqlite3' or 'oracle'. 
>>> >> > > 'NAME': 'mysitedb',  # Or path to 
>>> database 
>>> >> > > file 
>>> >> > > if using sqlite3. 
>>> >> > > # The following settings are not used wit

Re: server error (500)

2013-07-25 Thread Christian Erhardt
Set Allowed Hosts to 0.0.0.0

Am Donnerstag, 25. Juli 2013 14:19:13 UTC+2 schrieb Oliver:
>
> when you change Debug=False
>
>
>
>
> On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>>
>> The error log doesn't show anything. In which step following the 
>> documentation are you getting this error? 
>>
>> On Thu, Jul 25, 2013 at 12:09 PM, Oliver <oda...@gmail.com> wrote: 
>> > my environment is in my local pc or machine so its a development 
>> machine. 
>> > 
>> > I tried that empy field in allowed_host. 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
>> >> 
>> >> use this in your settings.py 
>> >> ALLOWED_HOSTS = [] 
>> >> 
>> >> where are you envirioment? you app there in production or development? 
>> >> Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com> escreveu: 
>> >> > 
>> >> > Hi, 
>> >> 
>> >> > 
>> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com> wrote: 
>> >> > > If I set DEBUG = False, I get this 
>> >> > > 
>> >> > > It worked! 
>> >> > > 
>> >> > > Congratulations on your first Django-powered page. 
>> >> > > 
>> >> > > Of course, you haven't actually done any work yet. Here's what to 
>> do 
>> >> > > next: 
>> >> > > 
>> >> > > If you plan to use a database, edit the DATABASES setting in 
>> >> > > mysite/settings.py. 
>> >> > > Start your first app by running python manage.py startapp 
>> [appname]. 
>> >> > > 
>> >> > > You're seeing this message because you have DEBUG = True in your 
>> >> > > Django 
>> >> > > settings file and you haven't configured any URLs. Get to work! 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > If I set it to true, I get the server error (500).  I created the 
>> >> > > template 
>> >> > > and static folder inside mysite folder.  Here is my setting.py. 
>> >> > > 
>> >> > 
>> >> > Can  you check the apache error log to see if you can find more 
>> >> > information there? It is located in 
>> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>> >> > 
>> >> > 
>> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
>> >> > > following the 
>> >> > > tutorials at Django website documentation. 
>> >> > > 
>> >> > > I appreciate any help. 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > # Django settings for mysite project. 
>> >> > > 
>> >> > > DEBUG = True 
>> >> > > TEMPLATE_DEBUG = DEBUG 
>> >> > > 
>> >> > > ADMINS = ( 
>> >> > > # ('mysite', 'em...@email.com'), 
>> >> 
>> >> > > ) 
>> >> > > 
>> >> > > MANAGERS = ADMINS 
>> >> > > 
>> >> > > DATABASES = { 
>> >> > > 'default': { 
>> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
>> >> > > 'postgresql_psycopg2', 
>> >> > > 'mysql', 'sqlite3' or 'oracle'. 
>> >> > > 'NAME': 'mysitedb',  # Or path to 
>> database 
>> >> > > file 
>> >> > > if using sqlite3. 
>> >> > > # The following settings are not used with sqlite3: 
>> >> > > 'USER': 'root', 
>> >> > > 'PASSWORD': '', 
>> >> > > 'HOST': '',  # Empty for localhost 
>> through 
>> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
>> >> > > 'PORT': '',  # Set to empty string for 
>> >> > > default. 
>> >> > > } 
>> >> > > } 
>> >> > > 
>> >> > &

Re: server error (500)

2013-07-25 Thread Oliver
when you change Debug=False




On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>
> The error log doesn't show anything. In which step following the 
> documentation are you getting this error? 
>
> On Thu, Jul 25, 2013 at 12:09 PM, Oliver <oda...@gmail.com > 
> wrote: 
> > my environment is in my local pc or machine so its a development 
> machine. 
> > 
> > I tried that empy field in allowed_host. 
> > 
> > 
> > 
> > 
> > 
> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
> >> 
> >> use this in your settings.py 
> >> ALLOWED_HOSTS = [] 
> >> 
> >> where are you envirioment? you app there in production or development? 
> >> Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com> escreveu: 
> >> > 
> >> > Hi, 
> >> 
> >> > 
> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com> wrote: 
> >> > > If I set DEBUG = False, I get this 
> >> > > 
> >> > > It worked! 
> >> > > 
> >> > > Congratulations on your first Django-powered page. 
> >> > > 
> >> > > Of course, you haven't actually done any work yet. Here's what to 
> do 
> >> > > next: 
> >> > > 
> >> > > If you plan to use a database, edit the DATABASES setting in 
> >> > > mysite/settings.py. 
> >> > > Start your first app by running python manage.py startapp 
> [appname]. 
> >> > > 
> >> > > You're seeing this message because you have DEBUG = True in your 
> >> > > Django 
> >> > > settings file and you haven't configured any URLs. Get to work! 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > If I set it to true, I get the server error (500).  I created the 
> >> > > template 
> >> > > and static folder inside mysite folder.  Here is my setting.py. 
> >> > > 
> >> > 
> >> > Can  you check the apache error log to see if you can find more 
> >> > information there? It is located in 
> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
> >> > 
> >> > 
> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
> >> > > following the 
> >> > > tutorials at Django website documentation. 
> >> > > 
> >> > > I appreciate any help. 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > # Django settings for mysite project. 
> >> > > 
> >> > > DEBUG = True 
> >> > > TEMPLATE_DEBUG = DEBUG 
> >> > > 
> >> > > ADMINS = ( 
> >> > > # ('mysite', 'em...@email.com'), 
> >> 
> >> > > ) 
> >> > > 
> >> > > MANAGERS = ADMINS 
> >> > > 
> >> > > DATABASES = { 
> >> > > 'default': { 
> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
> >> > > 'postgresql_psycopg2', 
> >> > > 'mysql', 'sqlite3' or 'oracle'. 
> >> > > 'NAME': 'mysitedb',  # Or path to 
> database 
> >> > > file 
> >> > > if using sqlite3. 
> >> > > # The following settings are not used with sqlite3: 
> >> > > 'USER': 'root', 
> >> > > 'PASSWORD': '', 
> >> > > 'HOST': '',  # Empty for localhost 
> through 
> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
> >> > > 'PORT': '',  # Set to empty string for 
> >> > > default. 
> >> > > } 
> >> > > } 
> >> > > 
> >> > > # Hosts/domain names that are valid for this site; required if 
> DEBUG 
> >> > > is 
> >> > > False 
> >> > > # See 
> >> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
> >> > > ALLOWED_HOSTS = ['localhost'] 
> >> > > 
> >> > > # Local time zone for this installation. Choices can be found here: 
> >> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
> >> > >

Re: server error (500)

2013-07-25 Thread victoria
The error log doesn't show anything. In which step following the
documentation are you getting this error?

On Thu, Jul 25, 2013 at 12:09 PM, Oliver <odav...@gmail.com> wrote:
> my environment is in my local pc or machine so its a development machine.
>
> I tried that empy field in allowed_host.
>
>
>
>
>
> On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote:
>>
>> use this in your settings.py
>> ALLOWED_HOSTS = []
>>
>> where are you envirioment? you app there in production or development?
>> Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com> escreveu:
>> >
>> > Hi,
>>
>> >
>> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com> wrote:
>> > > If I set DEBUG = False, I get this
>> > >
>> > > It worked!
>> > >
>> > > Congratulations on your first Django-powered page.
>> > >
>> > > Of course, you haven't actually done any work yet. Here's what to do
>> > > next:
>> > >
>> > > If you plan to use a database, edit the DATABASES setting in
>> > > mysite/settings.py.
>> > > Start your first app by running python manage.py startapp [appname].
>> > >
>> > > You're seeing this message because you have DEBUG = True in your
>> > > Django
>> > > settings file and you haven't configured any URLs. Get to work!
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > If I set it to true, I get the server error (500).  I created the
>> > > template
>> > > and static folder inside mysite folder.  Here is my setting.py.
>> > >
>> >
>> > Can  you check the apache error log to see if you can find more
>> > information there? It is located in
>> > C:\BitNami\djangostack-1.5.1-0\apache2\logs
>> >
>> >
>> > > I run the inspectdb and it went fine, no errors.   I'm new and
>> > > following the
>> > > tutorials at Django website documentation.
>> > >
>> > > I appreciate any help.
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > # Django settings for mysite project.
>> > >
>> > > DEBUG = True
>> > > TEMPLATE_DEBUG = DEBUG
>> > >
>> > > ADMINS = (
>> > > # ('mysite', 'em...@email.com'),
>>
>> > > )
>> > >
>> > > MANAGERS = ADMINS
>> > >
>> > > DATABASES = {
>> > > 'default': {
>> > > 'ENGINE': 'django.db.backends.mysql', # Add
>> > > 'postgresql_psycopg2',
>> > > 'mysql', 'sqlite3' or 'oracle'.
>> > > 'NAME': 'mysitedb',  # Or path to database
>> > > file
>> > > if using sqlite3.
>> > > # The following settings are not used with sqlite3:
>> > > 'USER': 'root',
>> > > 'PASSWORD': '',
>> > > 'HOST': '',  # Empty for localhost through
>> > > domain sockets or '127.0.0.1' for localhost through TCP.
>> > > 'PORT': '',  # Set to empty string for
>> > > default.
>> > > }
>> > > }
>> > >
>> > > # Hosts/domain names that are valid for this site; required if DEBUG
>> > > is
>> > > False
>> > > # See
>> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
>> > > ALLOWED_HOSTS = ['localhost']
>> > >
>> > > # Local time zone for this installation. Choices can be found here:
>> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
>> > > # although not all choices may be available on all operating systems.
>> > > # In a Windows environment this must be set to your system time zone.
>> > > TIME_ZONE = 'EST'
>> > >
>> > > # Language code for this installation. All choices can be found here:
>> > > # http://www.i18nguy.com/unicode/language-identifiers.html
>> > > LANGUAGE_CODE = 'en-us'
>> > >
>> > > SITE_ID = 1
>> > >
>> > > # If you set this to False, Django will make some optimizations so as
>> > > not
>> > > # to load the internationalization machinery.
>> > > USE_I18N = True
>> > >
>> > > # If you set this to False, Dja

Re: server error (500)

2013-07-25 Thread Oliver
my environment is in my local pc or machine so its a development machine. 

I tried that empy field in allowed_host.  





On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote:
>
> use this in your settings.py
> ALLOWED_HOSTS = []
>
> where are you envirioment? you app there in production or development?
> Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com > 
> escreveu:
> >
> > Hi,
> >
> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com > 
> wrote:
> > > If I set DEBUG = False, I get this
> > >
> > > It worked!
> > >
> > > Congratulations on your first Django-powered page.
> > >
> > > Of course, you haven't actually done any work yet. Here's what to do 
> next:
> > >
> > > If you plan to use a database, edit the DATABASES setting in
> > > mysite/settings.py.
> > > Start your first app by running python manage.py startapp [appname].
> > >
> > > You're seeing this message because you have DEBUG = True in your Django
> > > settings file and you haven't configured any URLs. Get to work!
> > >
> > >
> > >
> > >
> > >
> > > If I set it to true, I get the server error (500).  I created the 
> template
> > > and static folder inside mysite folder.  Here is my setting.py.
> > >
> >
> > Can  you check the apache error log to see if you can find more
> > information there? It is located in
> > C:\BitNami\djangostack-1.5.1-0\apache2\logs
> >
> >
> > > I run the inspectdb and it went fine, no errors.   I'm new and 
> following the
> > > tutorials at Django website documentation.
> > >
> > > I appreciate any help.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > # Django settings for mysite project.
> > >
> > > DEBUG = True
> > > TEMPLATE_DEBUG = DEBUG
> > >
> > > ADMINS = (
> > > # ('mysite', 'em...@email.com '),
> > > )
> > >
> > > MANAGERS = ADMINS
> > >
> > > DATABASES = {
> > > 'default': {
> > > 'ENGINE': 'django.db.backends.mysql', # Add 
> 'postgresql_psycopg2',
> > > 'mysql', 'sqlite3' or 'oracle'.
> > > 'NAME': 'mysitedb',  # Or path to database 
> file
> > > if using sqlite3.
> > > # The following settings are not used with sqlite3:
> > > 'USER': 'root',
> > > 'PASSWORD': '',
> > > 'HOST': '',  # Empty for localhost through
> > > domain sockets or '127.0.0.1' for localhost through TCP.
> > > 'PORT': '',  # Set to empty string for 
> default.
> > > }
> > > }
> > >
> > > # Hosts/domain names that are valid for this site; required if DEBUG is
> > > False
> > > # See 
> https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> > > ALLOWED_HOSTS = ['localhost']
> > >
> > > # Local time zone for this installation. Choices can be found here:
> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> > > # although not all choices may be available on all operating systems.
> > > # In a Windows environment this must be set to your system time zone.
> > > TIME_ZONE = 'EST'
> > >
> > > # Language code for this installation. All choices can be found here:
> > > # http://www.i18nguy.com/unicode/language-identifiers.html
> > > LANGUAGE_CODE = 'en-us'
> > >
> > > SITE_ID = 1
> > >
> > > # If you set this to False, Django will make some optimizations so as 
> not
> > > # to load the internationalization machinery.
> > > USE_I18N = True
> > >
> > > # If you set this to False, Django will not format dates, numbers and
> > > # calendars according to the current locale.
> > > USE_L10N = True
> > >
> > > # If you set this to False, Django will not use timezone-aware 
> datetimes.
> > > USE_TZ = True
> > >
> > > # Absolute filesystem path to the directory that will hold 
> user-uploaded
> > > files.
> > > # Example: "/var/www/example.com/media/"
> > > MEDIA_ROOT = ''
> > >
> > > # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> > > # trailing slash.
> > > # Examples: "http://example.com/media/;, "http://media.example.com/;
> > > MEDIA_

Re: server error (500)

2013-07-25 Thread Oliver
Hi Victoria,

attached is my the error log from the apache2

Thanks





On Thursday, July 25, 2013 3:35:00 AM UTC-4, victoria wrote:
>
> Hi, 
>
> On Thu, Jul 25, 2013 at 4:30 AM, Oliver <oda...@gmail.com > 
> wrote: 
> > If I set DEBUG = False, I get this 
> > 
> > It worked! 
> > 
> > Congratulations on your first Django-powered page. 
> > 
> > Of course, you haven't actually done any work yet. Here's what to do 
> next: 
> > 
> > If you plan to use a database, edit the DATABASES setting in 
> > mysite/settings.py. 
> > Start your first app by running python manage.py startapp [appname]. 
> > 
> > You're seeing this message because you have DEBUG = True in your Django 
> > settings file and you haven't configured any URLs. Get to work! 
> > 
> > 
> > 
> > 
> > 
> > If I set it to true, I get the server error (500).  I created the 
> template 
> > and static folder inside mysite folder.  Here is my setting.py. 
> > 
>
> Can  you check the apache error log to see if you can find more 
> information there? It is located in 
> C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>
>
> > I run the inspectdb and it went fine, no errors.   I'm new and following 
> the 
> > tutorials at Django website documentation. 
> > 
> > I appreciate any help. 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > # Django settings for mysite project. 
> > 
> > DEBUG = True 
> > TEMPLATE_DEBUG = DEBUG 
> > 
> > ADMINS = ( 
> > # ('mysite', 'em...@email.com '), 
> > ) 
> > 
> > MANAGERS = ADMINS 
> > 
> > DATABASES = { 
> > 'default': { 
> > 'ENGINE': 'django.db.backends.mysql', # Add 
> 'postgresql_psycopg2', 
> > 'mysql', 'sqlite3' or 'oracle'. 
> > 'NAME': 'mysitedb',  # Or path to database 
> file 
> > if using sqlite3. 
> > # The following settings are not used with sqlite3: 
> > 'USER': 'root', 
> > 'PASSWORD': '', 
> > 'HOST': '',  # Empty for localhost through 
> > domain sockets or '127.0.0.1' for localhost through TCP. 
> > 'PORT': '',  # Set to empty string for 
> default. 
> > } 
> > } 
> > 
> > # Hosts/domain names that are valid for this site; required if DEBUG is 
> > False 
> > # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
> > ALLOWED_HOSTS = ['localhost'] 
> > 
> > # Local time zone for this installation. Choices can be found here: 
> > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
> > # although not all choices may be available on all operating systems. 
> > # In a Windows environment this must be set to your system time zone. 
> > TIME_ZONE = 'EST' 
> > 
> > # Language code for this installation. All choices can be found here: 
> > # http://www.i18nguy.com/unicode/language-identifiers.html 
> > LANGUAGE_CODE = 'en-us' 
> > 
> > SITE_ID = 1 
> > 
> > # If you set this to False, Django will make some optimizations so as 
> not 
> > # to load the internationalization machinery. 
> > USE_I18N = True 
> > 
> > # If you set this to False, Django will not format dates, numbers and 
> > # calendars according to the current locale. 
> > USE_L10N = True 
> > 
> > # If you set this to False, Django will not use timezone-aware 
> datetimes. 
> > USE_TZ = True 
> > 
> > # Absolute filesystem path to the directory that will hold user-uploaded 
> > files. 
> > # Example: "/var/www/example.com/media/" 
> > MEDIA_ROOT = '' 
> > 
> > # URL that handles the media served from MEDIA_ROOT. Make sure to use a 
> > # trailing slash. 
> > # Examples: "http://example.com/media/;, "http://media.example.com/; 
> > MEDIA_URL = '' 
> > 
> > # Absolute path to the directory static files should be collected to. 
> > # Don't put anything in this directory yourself; store your static files 
> > # in apps' "static/" subdirectories and in STATICFILES_DIRS. 
> > # Example: "/var/www/example.com/static/" 
> > #STATIC_ROOT = '' 
> > 
> > # URL prefix for static files. 
> > # Example: "http://example.com/static/;, "http://static.example.com/; 
> > STATIC_URL = '/static/' 
> > 
> > # Additional locations of static files 
> > STATICFILES_DIRS = ( 
> > # Put strings here, like "/home/html/static" or 

Re: server error (500)

2013-07-25 Thread Mário Idival
use this in your settings.py
ALLOWED_HOSTS = []

where are you envirioment? you app there in production or development?
Em 25/07/2013 04:35, "victoria" <ka...@bitrock.com> escreveu:
>
> Hi,
>
> On Thu, Jul 25, 2013 at 4:30 AM, Oliver <odav...@gmail.com> wrote:
> > If I set DEBUG = False, I get this
> >
> > It worked!
> >
> > Congratulations on your first Django-powered page.
> >
> > Of course, you haven't actually done any work yet. Here's what to do
next:
> >
> > If you plan to use a database, edit the DATABASES setting in
> > mysite/settings.py.
> > Start your first app by running python manage.py startapp [appname].
> >
> > You're seeing this message because you have DEBUG = True in your Django
> > settings file and you haven't configured any URLs. Get to work!
> >
> >
> >
> >
> >
> > If I set it to true, I get the server error (500).  I created the
template
> > and static folder inside mysite folder.  Here is my setting.py.
> >
>
> Can  you check the apache error log to see if you can find more
> information there? It is located in
> C:\BitNami\djangostack-1.5.1-0\apache2\logs
>
>
> > I run the inspectdb and it went fine, no errors.   I'm new and
following the
> > tutorials at Django website documentation.
> >
> > I appreciate any help.
> >
> >
> >
> >
> >
> >
> >
> > # Django settings for mysite project.
> >
> > DEBUG = True
> > TEMPLATE_DEBUG = DEBUG
> >
> > ADMINS = (
> > # ('mysite', 'em...@email.com'),
> > )
> >
> > MANAGERS = ADMINS
> >
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.mysql', # Add
'postgresql_psycopg2',
> > 'mysql', 'sqlite3' or 'oracle'.
> > 'NAME': 'mysitedb',  # Or path to database
file
> > if using sqlite3.
> > # The following settings are not used with sqlite3:
> > 'USER': 'root',
> > 'PASSWORD': '',
> > 'HOST': '',  # Empty for localhost through
> > domain sockets or '127.0.0.1' for localhost through TCP.
> > 'PORT': '',  # Set to empty string for
default.
> > }
> > }
> >
> > # Hosts/domain names that are valid for this site; required if DEBUG is
> > False
> > # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> > ALLOWED_HOSTS = ['localhost']
> >
> > # Local time zone for this installation. Choices can be found here:
> > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> > # although not all choices may be available on all operating systems.
> > # In a Windows environment this must be set to your system time zone.
> > TIME_ZONE = 'EST'
> >
> > # Language code for this installation. All choices can be found here:
> > # http://www.i18nguy.com/unicode/language-identifiers.html
> > LANGUAGE_CODE = 'en-us'
> >
> > SITE_ID = 1
> >
> > # If you set this to False, Django will make some optimizations so as
not
> > # to load the internationalization machinery.
> > USE_I18N = True
> >
> > # If you set this to False, Django will not format dates, numbers and
> > # calendars according to the current locale.
> > USE_L10N = True
> >
> > # If you set this to False, Django will not use timezone-aware
datetimes.
> > USE_TZ = True
> >
> > # Absolute filesystem path to the directory that will hold user-uploaded
> > files.
> > # Example: "/var/www/example.com/media/"
> > MEDIA_ROOT = ''
> >
> > # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> > # trailing slash.
> > # Examples: "http://example.com/media/;, "http://media.example.com/;
> > MEDIA_URL = ''
> >
> > # Absolute path to the directory static files should be collected to.
> > # Don't put anything in this directory yourself; store your static files
> > # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> > # Example: "/var/www/example.com/static/"
> > #STATIC_ROOT = ''
> >
> > # URL prefix for static files.
> > # Example: "http://example.com/static/;, "http://static.example.com/;
> > STATIC_URL = '/static/'
> >
> > # Additional locations of static files
> > STATICFILES_DIRS = (
> > # Put strings here, like "/home/html/static" or
"C:/www/django/static".
> > # Always use forward slashes, even on Windows.
> &

Re: server error (500)

2013-07-25 Thread victoria
Hi,

On Thu, Jul 25, 2013 at 4:30 AM, Oliver <odav...@gmail.com> wrote:
> If I set DEBUG = False, I get this
>
> It worked!
>
> Congratulations on your first Django-powered page.
>
> Of course, you haven't actually done any work yet. Here's what to do next:
>
> If you plan to use a database, edit the DATABASES setting in
> mysite/settings.py.
> Start your first app by running python manage.py startapp [appname].
>
> You're seeing this message because you have DEBUG = True in your Django
> settings file and you haven't configured any URLs. Get to work!
>
>
>
>
>
> If I set it to true, I get the server error (500).  I created the template
> and static folder inside mysite folder.  Here is my setting.py.
>

Can  you check the apache error log to see if you can find more
information there? It is located in
C:\BitNami\djangostack-1.5.1-0\apache2\logs


> I run the inspectdb and it went fine, no errors.   I'm new and following the
> tutorials at Django website documentation.
>
> I appreciate any help.
>
>
>
>
>
>
>
> # Django settings for mysite project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('mysite', 'em...@email.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2',
> 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'mysitedb',  # Or path to database file
> if using sqlite3.
> # The following settings are not used with sqlite3:
> 'USER': 'root',
> 'PASSWORD': '',
> 'HOST': '',  # Empty for localhost through
> domain sockets or '127.0.0.1' for localhost through TCP.
> 'PORT': '',  # Set to empty string for default.
> }
> }
>
> # Hosts/domain names that are valid for this site; required if DEBUG is
> False
> # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> ALLOWED_HOSTS = ['localhost']
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'EST'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded
> files.
> # Example: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/;, "http://media.example.com/;
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/var/www/example.com/static/"
> #STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://example.com/static/;, "http://static.example.com/;
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # List of finder classes that know how to find static files in
> # various locations.
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
> 'C:\BitNami\djangostack-1.5.1-0\mysite\mysite\static',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '358gds4dg4s0*&^&^lkN0g4ses4rt6strssgs'
>
> # List of callables that know how to import templates from various sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.tem

server error (500)

2013-07-24 Thread Oliver
*If I set DEBUG = False, I get this*

It worked!Congratulations on your first Django-powered page.

Of course, you haven't actually done any work yet. Here's what to do next:

   - If you plan to use a database, edit the DATABASES setting in 
   mysite/settings.py.
   - Start your first app by running python manage.py startapp [appname].

You're seeing this message because you have DEBUG = True in your Django 
settings file and you haven't configured any URLs. Get to work!




*
*
*If I set it to true, I get the server error (500).  I created the template 
and static folder inside mysite folder.  Here is my setting.py. *
*
*
*I run the inspectdb and it went fine, no errors.   I'm new and following 
the tutorials at Django website documentation.   *
*
*
*I appreciate any help.  *







# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('mysite', 'em...@email.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mysitedb',  # Or path to database file 
if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'root',
'PASSWORD': '',
'HOST': '',  # Empty for localhost through 
domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '',  # Set to empty string for default.
}
}

# Hosts/domain names that are valid for this site; required if DEBUG is 
False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['localhost']

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'EST'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded 
files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/;, "http://media.example.com/;
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
#STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://example.com/static/;, "http://static.example.com/;
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
'C:\BitNami\djangostack-1.5.1-0\mysite\mysite\static',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '358gds4dg4s0*&^&^lkN0g4ses4rt6strssgs'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'mysite.wsgi.application'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or 
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
  

Getting internal server error 500 instead of 404, may be related with django-compressor?

2013-05-27 Thread Xavi
I'm using Django with Apache web server. If I put DEBUG=True Django serves 
404 debug errors without problem. But when I put DEBUG=False Apache is 
returning a 500 internal server error when it catch a 404 error. This 
causes Django to not serve my 404 template (/templates/404.html) and 
visitor see the apache internel error instead.

This is what I get in apache error log:

[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] mod_wsgi 
(pid=10629): Exception occurred processing WSGI script 
'/home/user/WEB/app.wsgi'.
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] Traceback (most 
recent call last):
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 
241, in __call__
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] response = 
self.get_response(request)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 
153, in get_response
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] response = 
self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 
228, in handle_uncaught_exception
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
callback(request, **param_dict)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 
91, in _wrapped_view
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] response = 
view_func(request, *args, **kwargs)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 33, 
in server_error
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
http.HttpResponseServerError(t.render(Context({})))
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, 
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
self._render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, 
in _render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
self.nodelist.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, 
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] bit = 
self.render_node(node, context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, 
in render_node
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
node.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", 
line 123, in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
compiled_parent._render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, 
in _render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
self.nodelist.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, 
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] bit = 
self.render_node(node, context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, 
in render_node
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
node.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", 
line 62, in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] result = 
block.nodelist.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, 
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] bit = 
self.render_node(node, context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, 
in render_node
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
node.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File 
"/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py", 
line 147, in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return 
self.render_compressed(context, self.kind, self.mode, 

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread Mike Dewhirst

On 26/04/2013 3:41am, dsmakear...@gmail.com wrote:

I am running python 3.3.1, django-dev, Windows 7,





When I Set DEBUG=False, I then get "Server Error (500)" not 404.

With some experimentation, I discovered that if I set DEBUG=False the
tutorial app appears to always fail with Server Error 500. As a test, I
went back to tutorial part 1. created a new minimal project, confirmed
that it worked, then set DEBUG=False. and voila I get Server Error (500)
again.


Try launching your browser at http://localhost:8000/admin instead of 
127.0.0.1:8000 and make sure 'localhost' is in ALLOWED_HOSTS.


That should make the 500 error go away when DEBUG == False

Mike



That is:

  * DEBUG = True, in debug mode - the code works without error
  * DEBUG = False, in production mode - the code fails Server Error (500)

Aside from my setting DEBUG to False, this is all django generated code.

I am a django newbie, but this feels like a bug.

Checking the IRC archives I see more than one question about cryptic
Server Error (500) occurrences.

Comments?




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




Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread Mike Dewhirst

On 26/04/2013 8:32am, dsmakear...@gmail.com wrote:

  That probably means the tutorial can't really demonstrate 404.html,
500.html, or 403.html  customization.



If you are getting 500 errors you should be able to see your own 
500.html displayed.





On Thursday, April 25, 2013 6:24:37 PM UTC-4, dsmak...@gmail.com wrote:

Thanks.

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




Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread dsmakearney
 That probably means the tutorial can't really demonstrate 404.html, 
500.html, or 403.html  customization. 



On Thursday, April 25, 2013 6:24:37 PM UTC-4, dsmak...@gmail.com wrote:
>
> Thanks.

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




Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread dsmakearney
Thanks.

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




Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread C. Kirby
Django 1.5 made a change with 
https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production

"The new 
ALLOWED_HOSTS<https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-ALLOWED_HOSTS>setting
 validates the request’s Host header and protects against 
host-poisoning attacks. This setting is now required whenever 
DEBUG<https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-DEBUG>is 
False, or else 
django.http.HttpRequest.get_host()<https://docs.djangoproject.com/en/1.5/ref/request-response/#django.http.HttpRequest.get_host>will
 raise 
SuspiciousOperation<https://docs.djangoproject.com/en/1.5/ref/exceptions/#django.core.exceptions.SuspiciousOperation>.
 
For more details see the full 
documentation<https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-ALLOWED_HOSTS>for
 the new setting."

Full ALLWED_HOSTS documentation
https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-ALLOWED_HOSTS

On Thursday, April 25, 2013 12:41:12 PM UTC-5, dsmak...@gmail.com wrote:
>
> I am running python 3.3.1, django-dev, Windows 7,
>
> dev version of tutorial part 3 -
>  Customizing Error Views  
>  The 404 (page not found) view
>
> The suggested code works as expected though I have some quibbles about 
> documentation wording.
>
> BUT...
>
> When in settings.py DEBUG= True, django prints the stack trace plus a note 
> advising that this view is displayed because DEBUG is set to True.
>
> In settings.py, I see:
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> Makes sense, besides I have created a 404.html and put it in the right 
> place, and I want to see it displayed
>
> When I Set DEBUG=False, I then get "Server Error (500)" not 404.
>
> With some experimentation, I discovered that if I set DEBUG=False the 
> tutorial app appears to always fail with Server Error 500. As a test, I 
> went back to tutorial part 1. created a new minimal project, confirmed that 
> it worked, then set DEBUG=False. and voila I get Server Error (500) again.
>
> That is:
>
>- DEBUG = True, in debug mode - the code works without error
>- DEBUG = False, in production mode - the code fails Server Error (500)
>
> Aside from my setting DEBUG to False, this is all django generated code.
>
> I am a django newbie, but this feels like a bug.  
>
> Checking the IRC archives I see more than one question about cryptic 
> Server Error (500) occurrences.
>
> Comments?
>
>
>
>
>

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




Unexpected Server Error (500) in tutorial

2013-04-25 Thread dsmakearney
I am running python 3.3.1, django-dev, Windows 7,

dev version of tutorial part 3 -
 Customizing Error Views  
 The 404 (page not found) view

The suggested code works as expected though I have some quibbles about 
documentation wording.

BUT...

When in settings.py DEBUG= True, django prints the stack trace plus a note 
advising that this view is displayed because DEBUG is set to True.

In settings.py, I see:
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

Makes sense, besides I have created a 404.html and put it in the right 
place, and I want to see it displayed

When I Set DEBUG=False, I then get "Server Error (500)" not 404.

With some experimentation, I discovered that if I set DEBUG=False the 
tutorial app appears to always fail with Server Error 500. As a test, I 
went back to tutorial part 1. created a new minimal project, confirmed that 
it worked, then set DEBUG=False. and voila I get Server Error (500) again.

That is:

   - DEBUG = True, in debug mode - the code works without error
   - DEBUG = False, in production mode - the code fails Server Error (500)
   
Aside from my setting DEBUG to False, this is all django generated code.

I am a django newbie, but this feels like a bug.  

Checking the IRC archives I see more than one question about cryptic Server 
Error (500) occurrences.

Comments?




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




Re: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Brian Schott
+1
http://pypi.python.org/pypi/django-celery
is a good solution for this kind of background task.  It opens up a lot 
possibilities like django-celery-email for background email sending, etc.  Keep 
your web contexts as short as possible.

For the AJAX server-side integration, check out:
http://www.dajaxproject.com


Brian Schott
bfsch...@gmail.com



On Jan 10, 2013, at 9:12 AM, Tom Evans <tevans...@googlemail.com> wrote:

> On Thu, Jan 10, 2013 at 1:21 PM, Mauro Sánchez <maur...@gmail.com> wrote:
>> Hello, I have a process that takes about 2 or 3 minutes to execute. The
>> problem is that sometimes (not always) it results in an Internal Server
>> Error 500 because of the time it takes.
>> Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
>> that even if the process takes 10 or 15 minutes it just keeps running until
>> it finish?
>> Thanks a lot for the help.
>> Cheers,
>> Mauro.
>> 
> 
> Providing a URL that consumes an entire web worker for >1 minute is a
> good way to open yourself up for a DOS attack - even 10 seconds is too
> long really. Put lengthy operations in to a queue - like django-celery
> -  so that you can manage how much of your resources that task
> consumes, and poll for completion with AJAX.
> 
> Cheers
> 
> Tom
> 
> -- 
> 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.



Re: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Tom Evans
On Thu, Jan 10, 2013 at 1:21 PM, Mauro Sánchez <maur...@gmail.com> wrote:
> Hello, I have a process that takes about 2 or 3 minutes to execute. The
> problem is that sometimes (not always) it results in an Internal Server
> Error 500 because of the time it takes.
> Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
> that even if the process takes 10 or 15 minutes it just keeps running until
> it finish?
> Thanks a lot for the help.
> Cheers,
> Mauro.
>

Providing a URL that consumes an entire web worker for >1 minute is a
good way to open yourself up for a DOS attack - even 10 seconds is too
long really. Put lengthy operations in to a queue - like django-celery
-  so that you can manage how much of your resources that task
consumes, and poll for completion with AJAX.

Cheers

Tom

-- 
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.



AW: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Szabo, Patrick (LNG-VIE)
I’ve had the exact same problem a couple of weeks ago.
There is a timout that you can define for apache however it somehow didn’t take 
when i tried it.
You really should consider a background task, as Bill suggested.

For me it was a query that took forever. I was able to cut the time in half by 
going through this:
https://docs.djangoproject.com/en/1.1/topics/db/optimization/

Especially select_related() helped a lot !
https://docs.djangoproject.com/en/1.1/ref/models/querysets/#select-related


Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Bill Freeman
Gesendet: Donnerstag, 10. Jänner 2013 14:47
An: django-users@googlegroups.com
Betreff: Re: Execution time of a long process results in an Internal Server 
Error 500

Maybe.  But it's generally considered a bad idea to tie up a request thread for 
that long.

A more common solution is to arrange for a background task to do the heavy 
lifting.

If the user must know when the task is done, you can poll in JavaScript.

Bill
On Thu, Jan 10, 2013 at 8:21 AM, Mauro Sánchez 
<maur...@gmail.com<mailto:maur...@gmail.com>> wrote:
Hello, I have a process that takes about 2 or 3 minutes to execute. The problem 
is that sometimes (not always) it results in an Internal Server Error 500 
because of the time it takes.
Is there a way to configure Apache or mod_wsgi to prevent this? Let's say, that 
even if the process takes 10 or 15 minutes it just keeps running until it 
finish?
Thanks a lot for the help.
Cheers,
Mauro.
--
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<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com<mailto:django-users%2bunsubscr...@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<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



. . . . . . . . . . . . . . . . . . . . . . . . . .

Ing. Patrick Szabo

Developer

LexisNexis

A-1030 Wien, Marxergasse 25



patrick.sz...@lexisnexis.at<mailto:patrick.sz...@lexisnexis.at>

Tel.: +43 1 53452 1573

Fax.: +43 1 534 52 146

. . . . . . . . . . . . . . . . . . . . . . . . . .


-- 
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: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Bill Freeman
Maybe.  But it's generally considered a bad idea to tie up a request thread
for that long.

A more common solution is to arrange for a background task to do the heavy
lifting.

If the user must know when the task is done, you can poll in JavaScript.

Bill

On Thu, Jan 10, 2013 at 8:21 AM, Mauro Sánchez <maur...@gmail.com> wrote:

> Hello, I have a process that takes about 2 or 3 minutes to execute. The
> problem is that sometimes (not always) it results in an Internal Server
> Error 500 because of the time it takes.
> Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
> that even if the process takes 10 or 15 minutes it just keeps running until
> it finish?
> Thanks a lot for the help.
> Cheers,
> Mauro.
>
> --
> 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.



Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Mauro Sánchez
Hello, I have a process that takes about 2 or 3 minutes to execute. The
problem is that sometimes (not always) it results in an Internal Server
Error 500 because of the time it takes.
Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
that even if the process takes 10 or 15 minutes it just keeps running until
it finish?
Thanks a lot for the help.
Cheers,
Mauro.

-- 
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.



Apache 2.2.1 + Python 2.6.1 + mod_swgi on Windows - Internal Server Error 500

2010-04-30 Thread Alex
I just had to troubleshoot an installation of Django, trying to get it
to run under mod_swgi with the specs mentioned above. I kept getting
Internal Server Error 500, and checking the Apache logs found this:


[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] mod_wsgi
(pid=3460): Target WSGI script 'C:/xampp/django/testapp/_apache/
django.wsgi' cannot be loaded as Python module.
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] mod_wsgi
(pid=3460): Exception occurred processing WSGI script 'C:/xampp/django/
testapp/_apache/django.wsgi'.
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] Traceback
(most recent call last):
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx]   File "C:/
xampp/django/testapp/_apache/django.wsgi", line 6, in 
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] import
django.core.handlers.wsgi
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx]   File "C:\
\Python26\\Lib\\site-packages\\django\\core\\handlers\\wsgi.py", line
8, in 
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] from
django import http
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx]   File "C:\
\Python26\\lib\\site-packages\\django\\http\\__init__.py", line 5, in

[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] from
urllib import urlencode
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx]   File "C:\
\Python26\\lib\\urllib.py", line 26, in 
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] import
socket
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx]   File "C:\
\Python26\\lib\\socket.py", line 46, in 
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] import
_socket
[Fri Apr 30 10:03:49 2010] [error] [client 192.168.x.xxx] ImportError:
DLL load failed: The specified module could not be found.


After some Googling, it turns out the problem was with Python 2.6.1
under Windows. Installing the latest version, 2.6.5, solved this
problem immediately for me. Hopefully this will be helpful to someone
else!

-Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Internal server error 500 with mod_wsgi

2009-11-21 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 7:26 PM, Karen Tracey  wrote:

>
>
> So I guess you are looking to pull django and satchmo out of
> /var/www/vhosts/hobbygiochi.com/django/, not /var/www/vhosts/
> detectorpoint.com/django/.  I'd guess the detectorpoint.com paths are
> already in sys.path when your wsgi script runs, and they aren't being
> over-ridden because you append to the existing path instead of putting the
> paths you are adding in front.
>
>
I thought the same thing, but this is my python path as django error
trackback:

['/var/www/vhosts/hobbygiochi.com/django/projects/', '/var/www/vhosts/
hobbygiochi.com/django/django_src/', '/var/www/vhosts/
hobbygiochi.com/django/satchmo_src/', '/var/www/vhosts/
hobbygiochi.com/django/libraries/',
'/usr/lib/python2.4/site-packages/setuptools-0.6c9-py2.4.egg',
'/usr/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-i686.egg',
'/usr/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-i686.egg',
'/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/PIL',
'/usr/lib/python2.4/site-packages/gtk-2.0']

is it possible that different apache vhosts share the same pythonpath also
if configuration is different?
how can I check that?

-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-19 Thread Karen Tracey
On Thu, Nov 19, 2009 at 11:51 AM, Alessandro Ronchi <
alessandro.ron...@soasi.com> wrote:

>
>
> On Thu, Nov 19, 2009 at 5:28 PM, Alessandro Ronchi <
> alessandro.ron...@soasi.com> wrote:
>
>>
>>> Really, you can get both pretty debug pages and emails with mod_wsgi as
>>> well as you can with the development server or mod_python.  I've seen both.
>>> The problem with both exception traces you have shown is that the exception
>>> is occurring too early in the processing -- neither of these exceptions you
>>> have posted would ever result in a debug page or an error email, regardless
>>> of deployment setup.
>>>
>>>
>> You're right.
>> I dont' understand why the trackback refers to another project django
>> source. the pythonpath is correct in django.wsgi and empty in shell.
>>
>> Is there something wrong?
>>
>
> as you can see here:
> http://dpaste.com/122437/
>
> my python path is correct, but the trackback points to another django
> directory.
>

I don't see where that page shows the PYTHONPATH setting?  Based on the
traceback the python path apparently includes:

/var/www/vhosts/detectorpoint.com/django/django_src
/var/www/vhosts/detectorpoint.com/django/satchmo_src
/var/www/vhosts/hobbygiochi.com/django/projects

In the wsgi script you pointed to earlier you have:

BASE = '/var/www/vhosts/hobbygiochi.com/django/'

sys.path.append(BASE + 'projects/')
sys.path.append(BASE + 'satchmo_src/satchmo/apps/')
sys.path.append(BASE + 'django_src/')
sys.path.append(BASE + 'libraries/')

So I guess you are looking to pull django and satchmo out of
/var/www/vhosts/hobbygiochi.com/django/, not /var/www/vhosts/
detectorpoint.com/django/.  I'd guess the detectorpoint.com paths are
already in sys.path when your wsgi script runs, and they aren't being
over-ridden because you append to the existing path instead of putting the
paths you are adding in front.

Karen

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-19 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 5:28 PM, Alessandro Ronchi <
alessandro.ron...@soasi.com> wrote:

>
>> Really, you can get both pretty debug pages and emails with mod_wsgi as
>> well as you can with the development server or mod_python.  I've seen both.
>> The problem with both exception traces you have shown is that the exception
>> is occurring too early in the processing -- neither of these exceptions you
>> have posted would ever result in a debug page or an error email, regardless
>> of deployment setup.
>>
>>
> You're right.
> I dont' understand why the trackback refers to another project django
> source. the pythonpath is correct in django.wsgi and empty in shell.
>
> Is there something wrong?
>

as you can see here:
http://dpaste.com/122437/

my python path is correct, but the trackback points to another django
directory.




-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-19 Thread Alessandro Ronchi
>
>
> Really, you can get both pretty debug pages and emails with mod_wsgi as
> well as you can with the development server or mod_python.  I've seen both.
> The problem with both exception traces you have shown is that the exception
> is occurring too early in the processing -- neither of these exceptions you
> have posted would ever result in a debug page or an error email, regardless
> of deployment setup.
>
>
You're right.
I dont' understand why the trackback refers to another project django
source. the pythonpath is correct in django.wsgi and empty in shell.

Is there something wrong?

-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 8:28 PM, Alessandro Ronchi <
alessandro.ron...@soasi.com> wrote:

> I get the same problem also with an Assert False (a typical debug symbol
> I've used with mod_python).
>
> http://dpaste.com/16/
>
> no browser and no email, only logs.
>
>

You seem to have put the assert False in settings.py, and the code is
(still) dying during load of middleware, since that is triggering a load of
settings.  Look at the top of the trace.  The code is here:

http://code.djangoproject.com/browser/django/tags/releases/1.1.1/django/core/handlers/wsgi.py#L230

That is, within the call to self.load_middleware().  The special handling of
exceptions that produces pretty debug pages and sends error email isn't done
until you get into get_response (called down several lines from the
load_middleware()):

http://code.djangoproject.com/browser/django/tags/releases/1.1.1/django/core/handlers/base.py#L66

Specifically when that method call handle_uncaught_exception:

http://code.djangoproject.com/browser/django/tags/releases/1.1.1/django/core/handlers/base.py#L136

which either produces the pretty error page or sends email, depending on
DEBUG setting.

Really, you can get both pretty debug pages and emails with mod_wsgi as well
as you can with the development server or mod_python.  I've seen both.  The
problem with both exception traces you have shown is that the exception is
occurring too early in the processing -- neither of these exceptions you
have posted would ever result in a debug page or an error email, regardless
of deployment setup.

Karen

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 2:02 AM, Karen Tracey  wrote:

> On Wed, Nov 18, 2009 at 7:29 PM, Alessandro Ronchi <
> alessandro.ron...@soasi.com> wrote:
>
>>
>>
>> http://dpaste.com/122205/
>> is my log file.
>>
>>
> Traceback shows it is dying during the load of middleware.  You would not
> get a pretty debug page for this even with DEBUG=True and running the
> development server: you'd get a bare traceback, which is what you see in the
> Apache log.  This is code that is not covered by the
> exception-catching-turn-it-into-a-pretty-page try/except block.  Ultimately
> it says (stripping out the referrer and leading timestamp, etc):
>
>File "/var/www/vhosts/
> hobbygiochi.com/django/satchmo_src/satchmo/apps/livesettings/functions.py",
> line 67, in get_config
>  raise SettingNotSet('%s config group does not exist' % group),
> SettingNotSet: 
>


I get the same problem also with an Assert False (a typical debug symbol
I've used with mod_python).

http://dpaste.com/16/

no browser and no email, only logs.

-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 7:29 PM, Alessandro Ronchi <
alessandro.ron...@soasi.com> wrote:

>
>
> http://dpaste.com/122205/
> is my log file.
>
>
Traceback shows it is dying during the load of middleware.  You would not
get a pretty debug page for this even with DEBUG=True and running the
development server: you'd get a bare traceback, which is what you see in the
Apache log.  This is code that is not covered by the
exception-catching-turn-it-into-a-pretty-page try/except block.  Ultimately
it says (stripping out the referrer and leading timestamp, etc):

   File "/var/www/vhosts/
hobbygiochi.com/django/satchmo_src/satchmo/apps/livesettings/functions.py",
line 67, in get_config
 raise SettingNotSet('%s config group does not exist' % group),
SettingNotSet: 

Which seems to imply something wrong with your satchmo config.  I don't know
satchmo but it seems to be trying to complain about a config group not
existing.  However it seems to run into trouble reporting the name of that
group. That  message might be implying the group name has
non-ASCII data in it, which is making the SettingNotSet instance
unprintable.  That  may be a clue or may be completely wrong -- it's just
the only kind of situation where I've seen that sort of 
message crop up.

Karen

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 1:08 AM, Graham Dumpleton <
graham.dumple...@gmail.com> wrote:

>
>
> On Nov 19, 10:48 am, Alessandro Ronchi 
> wrote:
> > With mod_wsgi I only get error logged into apache and not on the
> interactive
> > trackback in the browser, also If i set DEBUG=True in my settings.
> >
> > Is there any way to handle the django trackback as usual?
>
> Is the error definitely from Django and if so from what part of
> Django?
>
> Perhaps post example of traceback.
>
> Have you looked at 'DEBUG_PROPAGATE_EXCEPTIONS' setting.
>
>
> http://docs.djangoproject.com/en/dev/ref/settings/#debug-propagate-exceptions
>
> Also check over comments against:
>
> http://docs.djangoproject.com/en/dev/ref/settings/#debug
>
> and when tracebacks may be suppressed.
>


http://dpaste.com/122205/
is my log file.

I don't used DEBUG_PROPAGATE_EXCEPTIONS
but as far as I understand it defaults to False, so Django should handle the
error with usual trackback, also with mod_wsgi?

this is my vhost.conf (i'm using plesk):
http://dpaste.com/122208/

and this is my wsgi app:
http://dpaste.com/122209/

-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Graham Dumpleton


On Nov 19, 10:48 am, Alessandro Ronchi 
wrote:
> With mod_wsgi I only get error logged into apache and not on the interactive
> trackback in the browser, also If i set DEBUG=True in my settings.
>
> Is there any way to handle the django trackback as usual?

Is the error definitely from Django and if so from what part of
Django?

Perhaps post example of traceback.

Have you looked at 'DEBUG_PROPAGATE_EXCEPTIONS' setting.

http://docs.djangoproject.com/en/dev/ref/settings/#debug-propagate-exceptions

Also check over comments against:

http://docs.djangoproject.com/en/dev/ref/settings/#debug

and when tracebacks may be suppressed.

Graham

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 12:48 AM, Alessandro Ronchi <
alessandro.ron...@soasi.com> wrote:

> With mod_wsgi I only get error logged into apache and not on the
> interactive trackback in the browser, also If i set DEBUG=True in my
> settings.
>
> Is there any way to handle the django trackback as usual?
>

mod_wsgi also doesn't send me the email of errors. I really need them. Is it
possible to make python send me an email of every internal error also with
mod_wsgi?

-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.




Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
With mod_wsgi I only get error logged into apache and not on the interactive
trackback in the browser, also If i set DEBUG=True in my settings.

Is there any way to handle the django trackback as usual?

-- 
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.