Il giorno 05/mar/2014, alle ore 03:54, Camilo Torres ha scritto:
> On Tuesday, March 4, 2014 4:47:58 AM UTC-4:30, Vittorio wrote:
> In an admin form I input all data for a specific invoice (client, date of issue, number of invoice) and, by means of inlines, the ordered items. In these inlines I defined a raw_id_fields referring to the 'items' model which is showing correctly in the form, BUT ... when I click on it a "change" page is often (not always) popping up instead of the expected "select" one.
> Tis happens both in development and in production.
>
> Surfing the net I saw a message with the same subject as mine http://stackoverflow.com/questions/21009319/django-1-6-1-raw-id-fields-open-a-change-popup-instead-of-select-popup with a somewhat cryptic only answer...
> Hello,
>
> Try to delete your browser cache.
>
No, it isn't a matter of browser cache.
Let's narrow the problem focusing on the linux machine only where there's myapp and the apache2 server.
If I run my app via "python manage.py runserver 192.168.100.100:8000" it all works correctly:
"GET /warehouse/warehouse/invoice/ HTTP/1.1" 200 2145
"GET /warehouse/jsi18n/ HTTP/1.1" 200 2005
"GET /warehouse/warehouse/invoice/5/ HTTP/1.1" 200 22551
"GET /warehouse/warehouse/items/?t=code&_popup=1 HTTP/1.1" 200 21793
and the correct select popup window's shown.
Whilst, *** using the same settings.py file ***, and Apache2 (see the enabled-site conf file below) in production I get a change popup window only and a nasty
/?e=1 appears at the and of the http called page.
Please help, I'm really stranded here.
Thanks a lot
Vittorio
=====================================
#settings.py
import os
ABSOLUTE_PATH='%s/' % os.path.abspath(os.path.dirname(locals.__name__)).replace('\\','/')
DEBUG = True
ALLOWED_HOSTS=['*']
ADMINS = (
('Amministratore', 'wareh@gmail.com'),
)
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'wareh@gmail.com'
EMAIL_HOST_PASSWORD = 'AbsolutelyFake99'
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',#, 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'warehouse', # Or path to database file if using sqlite3.
'USER': 'mycompany', # Not used with sqlite3.
'PASSWORD': 'mycompany', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
},
'noematica': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'noematica', # Or path to database file if using sqlite3.
'USER': 'mycompany', # Not used with sqlite3.
'PASSWORD': 'mycompany', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
},
}
TIME_ZONE = 'Europe/Rome'
LANGUAGE_CODE = 'it-it'
DECIMAL_SEPARATOR=','
THOUSAND_SEPARATOR='.'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
MEDIA_ROOT=''
MEDIA_URL = '/media/'
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
SECRET_KEY = 'b(%_qs2$sk3_ht&+@9+6=%t1ff$ey@f9$rrydsqw&r$-z)xbk%*'
# 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',
)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.gzip.GZipMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
ROOT_URLCONF = 'mywh.urls'
WSGI_APPLICATION = 'mywh.wsgi.application'
TEMPLATE_DIRS = (
'/home/wh/mywh/mywh/templates',
)
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',# 'south',
'warehouse',
'noematica',
)
DATABASE_ROUTERS = ['warehouse.DBRouter.DBRouter']
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
================================================
#enabled-sites/django.conf
Listen 8000
WSGIScriptAlias / /home/wh/mywh/django.wsgi
WSGIPythonPath /home/wh/mywh
<VirtualHost 192.168.1.19:8000>
LogLevel warn
DocumentRoot /home/wh/mywh/mywh
AliasMatch ^/([^/]*\.css) /home/wh/mywh/mywh/static/
AliasMatch ^/itemslist/(.*)\.png$ /home/wh/mywh/mywh/media/$1.png
AliasMatch ^/([^/]*\.png) /home/wh/mywh/mywh/media/
Alias /media/ /home/wh/mywh/mywh/media/
Alias /static/ /home/wh/mywh/mywh/static/
Alias /templates/ /home/wh/mywh/mywh/templates/
<Directory /home/wh/mywh/mywh/static>
Order deny,allow
Allow from all
Require all granted
</Directory>
<Directory /home/wh/mywh/mywh/media>
Order deny,allow
Allow from all
Require all granted
</Directory>
<Directory /home/wh/mywh/mywh/templates>
Order deny,allow
Allow from all
Require all granted
</Directory>
ServerAdmin webmaster@localhost
....
<Directory /home/wh/mywh/>
<Files django.wsgi>
Order deny,allow
Allow from all
Require all granted
</Files>
</Directory>
</VirtualHost>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4A09652E-FE4A-4482-B060-1AC0FD125DFA%40de-martino.it.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment