Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 27, 2011 21:47:09

o.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


I am running Django 1.2.4 and mod_wsgi. My application is running
fine.
My admin won't load correctly.

wsgi_handler.py
-----------------------
import os
import sys

PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
sys.path.append(PROJECT_ROOT)
sys.path.append(os.path.join('/home/amr/django'))
sys.path.append(os.path.join('/home/amr/django/amr'))
sys.path.append(os.path.join('/home/amr/bin'))
sys.path.append(os.path.join('/usr/local/www/documents/media'))

os.environ = 'amr.settings'
os.environ = '/python_egg_cache'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

httpd.conf
--------------
Listen 8002
<VirtualHost _default_:8002>
DocumentRoot /usr/local/www/documents
<Directory /usr/local/www/documents>
Order allow,deny
Allow from all
</Directory>

Alias /media/ /usr/local/www/documents/media/
<Directory /usr/local/www/documents/media>
Order deny,allow
Allow from all
</Directory>

WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
<Directory /usr/local/www/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
#
</VirtualHost>

This link exists in /usr/local/www/documents/media
media -> /usr/local/lib/python2.6/site-packages/django/contrib/admin/
media

according to the documentation.

I'm missing something, and just cannot see it. Pointers in fixing this
would be appreciated.
Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 27, 2011 22:26:55

Wim F.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


Hi Octopus,

What do you mean by: "won't load correctedly"?

Is there an admin interface at /admin/ ? If not, did you enable the
admin in your settings.py and in your urls.py?

Is there one or more object missing from the admin interface? If there
is one missing, maybe you've made an error in your admin.py file,
which causes the object not to load in the admin. Comment your
ModelAdmin instances and try again, if necessary go back to the most
basic admin.site.register(MyModel)

Do the static files (css, js) not load? Then maybe your paths in
settings.py are not configured properly.

Hope this helps, and if you need any further assistance please let us
know what exactly is wrong.

Good luck!

Wim


On Jan 27, 10:47 pm, octopusgrabbus <old_road_f...@verizon.net> wrote:
> I am running Django 1.2.4 and mod_wsgi. My application is running
> fine.
> My admin won't load correctly.
>
> wsgi_handler.py
> -----------------------
> import os
> import sys
>
> PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
> sys.path.append(PROJECT_ROOT)
> sys.path.append(os.path.join('/home/amr/django'))
> sys.path.append(os.path.join('/home/amr/django/amr'))
> sys.path.append(os.path.join('/home/amr/bin'))
> sys.path.append(os.path.join('/usr/local/www/documents/media'))
>
> os.environ = 'amr.settings'
> os.environ = '/python_egg_cache'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> httpd.conf
> --------------
> Listen 8002
> <VirtualHost _default_:8002>
> DocumentRoot /usr/local/www/documents
> <Directory /usr/local/www/documents>
>     Order allow,deny
>     Allow from all
> </Directory>
>
> Alias /media/ /usr/local/www/documents/media/
> <Directory /usr/local/www/documents/media>
> Order deny,allow
> Allow from all
> </Directory>
>
> WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
> <Directory /usr/local/www/wsgi-scripts>
>     Order allow,deny
>     Allow from all
> </Directory>
> #
> </VirtualHost>
>
> This link exists in /usr/local/www/documents/media
> media -> /usr/local/lib/python2.6/site-packages/django/contrib/admin/
> media
>
> according to the documentation.
>
> I'm missing something, and just cannot see it. Pointers in fixing this
> would be appreciated.
> Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 27, 2011 22:48:15

o.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


I am referring to Django's admin site. By not loading correctly, I
mean the admin site works, but does not display the nice look and feel
that displays when using Django's built in web server.

"Do the static files (css, js) not load? Then maybe your paths in
settings.py are not configured properly. "

Yes, they do not load.

To the best of my knowledge, I have no ModelAdmin instances.

Here are the appropriate lines from project's settings.py

# Main URL for the project
BASE_URL = 'http://localhost:8002'

# Absolute path to the directory that holds media
#MEDIA_ROOT = '%s/media/' % BASE_PATH
MEDIA_ROOT = '/usr/local/www/documentation/media'

# URL that handles the media served from MEDIA_ROOT
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images.
#ADMIN_MEDIA_PREFIX = "%sadmin/" % MEDIA_URL
ADMIN_MEDIA_PREFIX = "admin/"

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'amr.login',
'amr.inventory_check',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
)

Here are the appropriate settings from project's urls.py

#(r'^css(?P<path>.*)$', 'django.views.static.serve',
{'document_root': '/home/amr/django/amr'}),
# Uncomment the admin/doc line below to enable admin
documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)


On Jan 27, 5:26 pm, Wim Feijen <wimfei...@gmail.com> wrote:
> Hi Octopus,
>
> What do you mean by: "won't load correctedly"?
>
> Is there an admin interface at /admin/ ? If not, did you enable the
> admin in your settings.py and in your urls.py?
>
> Is there one or more object missing from the admin interface? If there
> is one missing, maybe you've made an error in your admin.py file,
> which causes the object not to load in the admin. Comment your
> ModelAdmin instances and try again, if necessary go back to the most
> basic admin.site.register(MyModel)
>
> Do the static files (css, js) not load? Then maybe your paths in
> settings.py are not configured properly.
>
> Hope this helps, and if you need any further assistance please let us
> know what exactly is wrong.
>
> Good luck!
>
> Wim
>
> On Jan 27, 10:47 pm, octopusgrabbus <old_road_f...@verizon.net> wrote:
>
> > I am running Django 1.2.4 and mod_wsgi. My application is running
> > fine.
> > My admin won't load correctly.
>
> > wsgi_handler.py
> > -----------------------
> > import os
> > import sys
>
> > PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
> > sys.path.append(PROJECT_ROOT)
> > sys.path.append(os.path.join('/home/amr/django'))
> > sys.path.append(os.path.join('/home/amr/django/amr'))
> > sys.path.append(os.path.join('/home/amr/bin'))
> > sys.path.append(os.path.join('/usr/local/www/documents/media'))
>
> > os.environ = 'amr.settings'
> > os.environ = '/python_egg_cache'
>
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
>
> > httpd.conf
> > --------------
> > Listen 8002
> > <VirtualHost _default_:8002>
> > DocumentRoot /usr/local/www/documents
> > <Directory /usr/local/www/documents>
> >     Order allow,deny
> >     Allow from all
> > </Directory>
>
> > Alias /media/ /usr/local/www/documents/media/
> > <Directory /usr/local/www/documents/media>
> > Order deny,allow
> > Allow from all
> > </Directory>
>
> > WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
> > <Directory /usr/local/www/wsgi-scripts>
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> > #
> > </VirtualHost>
>
> > This link exists in /usr/local/www/documents/media
> > media -> /usr/local/lib/python2.6/site-packages/django/contrib/admin/
> > media
>
> > according to the documentation.
>
> > I'm missing something, and just cannot see it. Pointers in fixing this
> > would be appreciated.
> > Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Jan. 28, 2011 00:26:29

O.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


Try this:

ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'

On Jan 28, 1:48 am, octopusgrabbus <old_road_f...@verizon.net> wrote:
> I am referring to Django's admin site. By not loading correctly, I
> mean the admin site works, but does not display the nice look and feel
> that displays when using Django's built in web server.
>
> "Do the static files (css, js) not load? Then maybe your paths in
> settings.py are not configured properly. "
>
> Yes, they do not load.
>
> To the best of my knowledge, I have no ModelAdmin instances.
>
> Here are the appropriate lines from project's settings.py
>
> # Main URL for the project
> BASE_URL = 'http://localhost:8002'
>
> # Absolute path to the directory that holds media
> #MEDIA_ROOT = '%s/media/' % BASE_PATH
> MEDIA_ROOT = '/usr/local/www/documentation/media'
>
> # URL that handles the media served from MEDIA_ROOT
> MEDIA_URL = '/media/'
>
> # URL prefix for admin media -- CSS, JavaScript and images.
> #ADMIN_MEDIA_PREFIX = "%sadmin/" % MEDIA_URL
> ADMIN_MEDIA_PREFIX = "admin/"
>
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.contenttypes',
>     'django.contrib.sessions',
>     'django.contrib.sites',
>     'django.contrib.messages',
>     'amr.login',
>     'amr.inventory_check',
>     # Uncomment the next line to enable the admin:
>     'django.contrib.admin',
>     # Uncomment the next line to enable admin documentation:
>     'django.contrib.admindocs',
> )
>
> Here are the appropriate settings from project's urls.py
>
>     #(r'^css(?P<path>.*)$', 'django.views.static.serve',
> {'document_root': '/home/amr/django/amr'}),
>     # Uncomment the admin/doc line below to enable admin
> documentation:
>     (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
>     # Uncomment the next line to enable the admin:
>     (r'^admin/', include(admin.site.urls)),
> )
>
> On Jan 27, 5:26 pm, Wim Feijen <wimfei...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Octopus,
>
> > What do you mean by: "won't load correctedly"?
>
> > Is there an admin interface at /admin/ ? If not, did you enable the
> > admin in your settings.py and in your urls.py?
>
> > Is there one or more object missing from the admin interface? If there
> > is one missing, maybe you've made an error in your admin.py file,
> > which causes the object not to load in the admin. Comment your
> > ModelAdmin instances and try again, if necessary go back to the most
> > basic admin.site.register(MyModel)
>
> > Do the static files (css, js) not load? Then maybe your paths in
> > settings.py are not configured properly.
>
> > Hope this helps, and if you need any further assistance please let us
> > know what exactly is wrong.
>
> > Good luck!
>
> > Wim
>
> > On Jan 27, 10:47 pm, octopusgrabbus <old_road_f...@verizon.net> wrote:
>
> > > I am running Django 1.2.4 and mod_wsgi. My application is running
> > > fine.
> > > My admin won't load correctly.
>
> > > wsgi_handler.py
> > > -----------------------
> > > import os
> > > import sys
>
> > > PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
> > > sys.path.append(PROJECT_ROOT)
> > > sys.path.append(os.path.join('/home/amr/django'))
> > > sys.path.append(os.path.join('/home/amr/django/amr'))
> > > sys.path.append(os.path.join('/home/amr/bin'))
> > > sys.path.append(os.path.join('/usr/local/www/documents/media'))
>
> > > os.environ = 'amr.settings'
> > > os.environ = '/python_egg_cache'
>
> > > import django.core.handlers.wsgi
> > > application = django.core.handlers.wsgi.WSGIHandler()
>
> > > httpd.conf
> > > --------------
> > > Listen 8002
> > > <VirtualHost _default_:8002>
> > > DocumentRoot /usr/local/www/documents
> > > <Directory /usr/local/www/documents>
> > >     Order allow,deny
> > >     Allow from all
> > > </Directory>
>
> > > Alias /media/ /usr/local/www/documents/media/
> > > <Directory /usr/local/www/documents/media>
> > > Order deny,allow
> > > Allow from all
> > > </Directory>
>
> > > WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
> > > <Directory /usr/local/www/wsgi-scripts>
> > >     Order allow,deny
> > >     Allow from all
> > > </Directory>
> > > #
> > > </VirtualHost>
>
> > > This link exists in /usr/local/www/documents/media
> > > media -> /usr/local/lib/python2.6/site-packages/django/contrib/admin/
> > > media
>
> > > according to the documentation.
>
> > > I'm missing something, and just cannot see it. Pointers in fixing this
> > > would be appreciated.
> > > Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 Jan. 28, 2011 13:50:08

o.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


After making this change, I got the admin interface's look and feel,
and then put back the original and did not get the look and feel, When
I put this change back ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/',
I no longer get the look and feel. I've cleared the cache and
rebooted. It looks like there's a caching condition somewhere, but I'm
not aware of what it is. Any ideas? Thanks.
Then, I put back what I had and tested again and di

On Jan 27, 7:24 pm, OverKrik <overk...@gmail.com> wrote:
> Try this:
>
> ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'
>
> On Jan 28, 1:48 am,octopusgrabbus<old_road_f...@verizon.net> wrote:
>
> > I am referring to Django's admin site. By not loading correctly, I
> > mean the admin site works, but does not display the nice look and feel
> > that displays when using Django's built in web server.
>
> > "Do the static files (css, js) not load? Then maybe your paths in
> > settings.py are not configured properly. "
>
> > Yes, they do not load.
>
> > To the best of my knowledge, I have no ModelAdmin instances.
>
> > Here are the appropriate lines from project's settings.py
>
> > # Main URL for the project
> > BASE_URL = 'http://localhost:8002'
>
> > # Absolute path to the directory that holds media
> > #MEDIA_ROOT = '%s/media/' % BASE_PATH
> > MEDIA_ROOT = '/usr/local/www/documentation/media'
>
> > # URL that handles the media served from MEDIA_ROOT
> > MEDIA_URL = '/media/'
>
> > # URL prefix for admin media -- CSS, JavaScript and images.
> > #ADMIN_MEDIA_PREFIX = "%sadmin/" % MEDIA_URL
> > ADMIN_MEDIA_PREFIX = "admin/"
>
> > INSTALLED_APPS = (
> >     'django.contrib.auth',
> >     'django.contrib.contenttypes',
> >     'django.contrib.sessions',
> >     'django.contrib.sites',
> >     'django.contrib.messages',
> >     'amr.login',
> >     'amr.inventory_check',
> >     # Uncomment the next line to enable the admin:
> >     'django.contrib.admin',
> >     # Uncomment the next line to enable admin documentation:
> >     'django.contrib.admindocs',
> > )
>
> > Here are the appropriate settings from project's urls.py
>
> >     #(r'^css(?P<path>.*)$', 'django.views.static.serve',
> > {'document_root': '/home/amr/django/amr'}),
> >     # Uncomment the admin/doc line below to enable admin
> > documentation:
> >     (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> >     # Uncomment the next line to enable the admin:
> >     (r'^admin/', include(admin.site.urls)),
> > )
>
> > On Jan 27, 5:26 pm, Wim Feijen <wimfei...@gmail.com> wrote:
>
> > > Hi Octopus,
>
> > > What do you mean by: "won't load correctedly"?
>
> > > Is there an admin interface at /admin/ ? If not, did you enable the
> > > admin in your settings.py and in your urls.py?
>
> > > Is there one or more object missing from the admin interface? If there
> > > is one missing, maybe you've made an error in your admin.py file,
> > > which causes the object not to load in the admin. Comment your
> > > ModelAdmin instances and try again, if necessary go back to the most
> > > basic admin.site.register(MyModel)
>
> > > Do the static files (css, js) not load? Then maybe your paths in
> > > settings.py are not configured properly.
>
> > > Hope this helps, and if you need any further assistance please let us
> > > know what exactly is wrong.
>
> > > Good luck!
>
> > > Wim
>
> > > On Jan 27, 10:47 pm,octopusgrabbus<old_road_f...@verizon.net> wrote:
>
> > > > I am running Django 1.2.4 and mod_wsgi. My application is running
> > > > fine.
> > > > My admin won't load correctly.
>
> > > > wsgi_handler.py
> > > > -----------------------
> > > > import os
> > > > import sys
>
> > > > PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
> > > > sys.path.append(PROJECT_ROOT)
> > > > sys.path.append(os.path.join('/home/amr/django'))
> > > > sys.path.append(os.path.join('/home/amr/django/amr'))
> > > > sys.path.append(os.path.join('/home/amr/bin'))
> > > > sys.path.append(os.path.join('/usr/local/www/documents/media'))
>
> > > > os.environ = 'amr.settings'
> > > > os.environ = '/python_egg_cache'
>
> > > > import django.core.handlers.wsgi
> > > > application = django.core.handlers.wsgi.WSGIHandler()
>
> > > > httpd.conf
> > > > --------------
> > > > Listen 8002
> > > > <VirtualHost _default_:8002>
> > > > DocumentRoot /usr/local/www/documents
> > > > <Directory /usr/local/www/documents>
> > > >     Order allow,deny
> > > >     Allow from all
> > > > </Directory>
>
> > > > Alias /media/ /usr/local/www/documents/media/
> > > > <Directory /usr/local/www/documents/media>
> > > > Order deny,allow
> > > > Allow from all
> > > > </Directory>
>
> > > > WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
> > > > <Directory /usr/local/www/wsgi-scripts>
> > > >     Order allow,deny
> > > >     Allow from all
> > > > </Directory>
> > > > #
> > > > </VirtualHost>
>
> > > > This link exists in /usr/local/www/documents/media
> > > > media -> /usr/local/lib/python2.6/site-packages/django/contrib/admin/
> > > > media
>
> > > > according to the documentation.
>
> > > > I'm missing something, and just cannot see it. Pointers in fixing this
> > > > would be appreciated.
> > > > Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#6 Jan. 28, 2011 15:04:31

o.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


In addition, I can't get the built-in server to serve the admin's look
and feel. I see that as a good thing, because clearly it's a wrong
setting that affects both servers. Here are the settings again.

# Main URL for the project
BASE_URL = 'http://localhost:8002'

# Absolute path to the directory that holds media
MEDIA_ROOT = '/usr/local/www/documents/media'

# URL that handles the media served from MEDIA_ROOT
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images.
ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'


Thanks.
cmn

On Jan 28, 8:49 am, octopusgrabbus <old_road_f...@verizon.net> wrote:
> After making this change, I got the admin interface's look and feel,
> and then put back the original and did not get the look and feel, When
> I put this change back ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/',
> I no longer get the look and feel. I've cleared the cache and
> rebooted. It looks like there's a caching condition somewhere, but I'm
> not aware of what it is. Any ideas? Thanks.
>
> On Jan 27, 7:24 pm, OverKrik <overk...@gmail.com> wrote:
>
> > Try this:
>
> > ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'
>
> > On Jan 28, 1:48 am,octopusgrabbus<old_road_f...@verizon.net> wrote:
>
> > > I am referring to Django's admin site. By not loading correctly, I
> > > mean the admin site works, but does not display the nice look and feel
> > > that displays when using Django's built in web server.
>
> > > "Do the static files (css, js) not load? Then maybe your paths in
> > > settings.py are not configured properly. "
>
> > > Yes, they do not load.
>
> > > To the best of my knowledge, I have no ModelAdmin instances.
>
> > > Here are the appropriate lines from project's settings.py
>
> > > # Main URL for the project
> > > BASE_URL = 'http://localhost:8002'
>
> > > # Absolute path to the directory that holds media
> > > #MEDIA_ROOT = '%s/media/' % BASE_PATH
> > > MEDIA_ROOT = '/usr/local/www/documentation/media'
>
> > > # URL that handles the media served from MEDIA_ROOT
> > > MEDIA_URL = '/media/'
>
> > > # URL prefix for admin media -- CSS, JavaScript and images.
> > > #ADMIN_MEDIA_PREFIX = "%sadmin/" % MEDIA_URL
> > > ADMIN_MEDIA_PREFIX = "admin/"
>
> > > INSTALLED_APPS = (
> > >     'django.contrib.auth',
> > >     'django.contrib.contenttypes',
> > >     'django.contrib.sessions',
> > >     'django.contrib.sites',
> > >     'django.contrib.messages',
> > >     'amr.login',
> > >     'amr.inventory_check',
> > >     # Uncomment the next line to enable the admin:
> > >     'django.contrib.admin',
> > >     # Uncomment the next line to enable admin documentation:
> > >     'django.contrib.admindocs',
> > > )
>
> > > Here are the appropriate settings from project's urls.py
>
> > >     #(r'^css(?P<path>.*)$', 'django.views.static.serve',
> > > {'document_root': '/home/amr/django/amr'}),
> > >     # Uncomment the admin/doc line below to enable admin
> > > documentation:
> > >     (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> > >     # Uncomment the next line to enable the admin:
> > >     (r'^admin/', include(admin.site.urls)),
> > > )
>
> > > On Jan 27, 5:26 pm, Wim Feijen <wimfei...@gmail.com> wrote:
>
> > > > Hi Octopus,
>
> > > > What do you mean by: "won't load correctedly"?
>
> > > > Is there an admin interface at /admin/ ? If not, did you enable the
> > > > admin in your settings.py and in your urls.py?
>
> > > > Is there one or more object missing from the admin interface? If there
> > > > is one missing, maybe you've made an error in your admin.py file,
> > > > which causes the object not to load in the admin. Comment your
> > > > ModelAdmin instances and try again, if necessary go back to the most
> > > > basic admin.site.register(MyModel)
>
> > > > Do the static files (css, js) not load? Then maybe your paths in
> > > > settings.py are not configured properly.
>
> > > > Hope this helps, and if you need any further assistance please let us
> > > > know what exactly is wrong.
>
> > > > Good luck!
>
> > > > Wim
>
> > > > On Jan 27, 10:47 pm,octopusgrabbus<old_road_f...@verizon.net> wrote:
>
> > > > > I am running Django 1.2.4 and mod_wsgi. My application is running
> > > > > fine.
> > > > > My admin won't load correctly.
>
> > > > > wsgi_handler.py
> > > > > -----------------------
> > > > > import os
> > > > > import sys
>
> > > > > PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
> > > > > sys.path.append(PROJECT_ROOT)
> > > > > sys.path.append(os.path.join('/home/amr/django'))
> > > > > sys.path.append(os.path.join('/home/amr/django/amr'))
> > > > > sys.path.append(os.path.join('/home/amr/bin'))
> > > > > sys.path.append(os.path.join('/usr/local/www/documents/media'))
>
> > > > > os.environ = 'amr.settings'
> > > > > os.environ = '/python_egg_cache'
>
> > > > > import django.core.handlers.wsgi
> > > > > application = django.core.handlers.wsgi.WSGIHandler()
>
> > > > > httpd.conf
> > > > > --------------
> > > > > Listen 8002
> > > > > <VirtualHost _default_:8002>
> > > > > DocumentRoot /usr/local/www/documents
> > > > > <Directory /usr/local/www/documents>
> > > > >     Order allow,deny
> > > > >     Allow from all
> > > > > </Directory>
>
> > > > > Alias /media/ /usr/local/www/documents/media/
> > > > > <Directory /usr/local/www/documents/media>
> > > > > Order deny,allow
> > > > > Allow from all
> > > > > </Directory>
>
> > > > > WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
> > > > > <Directory /usr/local/www/wsgi-scripts>
> > > > >     Order allow,deny
> > > > >     Allow from all
> > > > > </Directory>
> > > > > #
> > > > > </VirtualHost>
>
> > > > > This link exists in /usr/local/www/documents/media
> > > > > media -> /usr/local/lib/python2.6/site-packages/django/contrib/admin/
> > > > > media
>
> > > > > according to the documentation.
>
> > > > > I'm missing something, and just cannot see it. Pointers in fixing this
> > > > > would be appreciated.
> > > > > Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#7 Jan. 28, 2011 15:10:11

o.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin won't load revisited


I got the look and feel back by substituting this:

# URL prefix for admin media -- CSS, JavaScript and images.
ADMIN_MEDIA_PREFIX = BASE_URL + '/media/'

and yet the other value did work

ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'

Oh, well. Thanks for the answers.


On Jan 28, 10:04 am, octopusgrabbus <old_road_f...@verizon.net> wrote:
> In addition, I can't get the built-in server to serve the admin's look
> and feel. I see that as a good thing, because clearly it's a wrong
> setting that affects both servers. Here are the settings again.
>
> # Main URL for the project
> BASE_URL = 'http://localhost:8002'
>
> # Absolute path to the directory that holds media
> MEDIA_ROOT = '/usr/local/www/documents/media'
>
> # URL that handles the media served from MEDIA_ROOT
> MEDIA_URL = '/media/'
>
> # URL prefix for admin media -- CSS, JavaScript and images.
> ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'
>
> Thanks.
> cmn
>
> On Jan 28, 8:49 am, octopusgrabbus <old_road_f...@verizon.net> wrote:
>
> > After making this change, I got the admin interface's look and feel,
> > and then put back the original and did not get the look and feel, When
> > I put this change back ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/',
> > I no longer get the look and feel. I've cleared the cache and
> > rebooted. It looks like there's a caching condition somewhere, but I'm
> > not aware of what it is. Any ideas? Thanks.
>
> > On Jan 27, 7:24 pm, OverKrik <overk...@gmail.com> wrote:
>
> > > Try this:
>
> > > ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'
>
> > > On Jan 28, 1:48 am,octopusgrabbus<old_road_f...@verizon.net> wrote:
>
> > > > I am referring to Django's admin site. By not loading correctly, I
> > > > mean the admin site works, but does not display the nice look and feel
> > > > that displays when using Django's built in web server.
>
> > > > "Do the static files (css, js) not load? Then maybe your paths in
> > > > settings.py are not configured properly. "
>
> > > > Yes, they do not load.
>
> > > > To the best of my knowledge, I have no ModelAdmin instances.
>
> > > > Here are the appropriate lines from project's settings.py
>
> > > > # Main URL for the project
> > > > BASE_URL = 'http://localhost:8002'
>
> > > > # Absolute path to the directory that holds media
> > > > #MEDIA_ROOT = '%s/media/' % BASE_PATH
> > > > MEDIA_ROOT = '/usr/local/www/documentation/media'
>
> > > > # URL that handles the media served from MEDIA_ROOT
> > > > MEDIA_URL = '/media/'
>
> > > > # URL prefix for admin media -- CSS, JavaScript and images.
> > > > #ADMIN_MEDIA_PREFIX = "%sadmin/" % MEDIA_URL
> > > > ADMIN_MEDIA_PREFIX = "admin/"
>
> > > > INSTALLED_APPS = (
> > > >     'django.contrib.auth',
> > > >     'django.contrib.contenttypes',
> > > >     'django.contrib.sessions',
> > > >     'django.contrib.sites',
> > > >     'django.contrib.messages',
> > > >     'amr.login',
> > > >     'amr.inventory_check',
> > > >     # Uncomment the next line to enable the admin:
> > > >     'django.contrib.admin',
> > > >     # Uncomment the next line to enable admin documentation:
> > > >     'django.contrib.admindocs',
> > > > )
>
> > > > Here are the appropriate settings from project's urls.py
>
> > > >     #(r'^css(?P<path>.*)$', 'django.views.static.serve',
> > > > {'document_root': '/home/amr/django/amr'}),
> > > >     # Uncomment the admin/doc line below to enable admin
> > > > documentation:
> > > >     (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> > > >     # Uncomment the next line to enable the admin:
> > > >     (r'^admin/', include(admin.site.urls)),
> > > > )
>
> > > > On Jan 27, 5:26 pm, Wim Feijen <wimfei...@gmail.com> wrote:
>
> > > > > Hi Octopus,
>
> > > > > What do you mean by: "won't load correctedly"?
>
> > > > > Is there an admin interface at /admin/ ? If not, did you enable the
> > > > > admin in your settings.py and in your urls.py?
>
> > > > > Is there one or more object missing from the admin interface? If there
> > > > > is one missing, maybe you've made an error in your admin.py file,
> > > > > which causes the object not to load in the admin. Comment your
> > > > > ModelAdmin instances and try again, if necessary go back to the most
> > > > > basic admin.site.register(MyModel)
>
> > > > > Do the static files (css, js) not load? Then maybe your paths in
> > > > > settings.py are not configured properly.
>
> > > > > Hope this helps, and if you need any further assistance please let us
> > > > > know what exactly is wrong.
>
> > > > > Good luck!
>
> > > > > Wim
>
> > > > > On Jan 27, 10:47 pm,octopusgrabbus<old_road_f...@verizon.net> wrote:
>
> > > > > > I am running Django 1.2.4 and mod_wsgi. My application is running
> > > > > > fine.
> > > > > > My admin won't load correctly.
>
> > > > > > wsgi_handler.py
> > > > > > -----------------------
> > > > > > import os
> > > > > > import sys
>
> > > > > > PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
> > > > > > sys.path.append(PROJECT_ROOT)
> > > > > > sys.path.append(os.path.join('/home/amr/django'))
> > > > > > sys.path.append(os.path.join('/home/amr/django/amr'))
> > > > > > sys.path.append(os.path.join('/home/amr/bin'))
> > > > > > sys.path.append(os.path.join('/usr/local/www/documents/media'))
>
> > > > > > os.environ = 'amr.settings'
> > > > > > os.environ = '/python_egg_cache'
>
> > > > > > import django.core.handlers.wsgi
> > > > > > application = django.core.handlers.wsgi.WSGIHandler()
>
> > > > > > httpd.conf
> > > > > > --------------
> > > > > > Listen 8002
> > > > > > <VirtualHost _default_:8002>
> > > > > > DocumentRoot /usr/local/www/documents
> > > > > > <Directory /usr/local/www/documents>
> > > > > >     Order allow,deny
> > > > > >     Allow from all
> > > > > > </Directory>
>
> > > > > > Alias /media/ /usr/local/www/documents/media/
> > > > > > <Directory /usr/local/www/documents/media>
> > > > > > Order deny,allow
> > > > > > Allow from all
> > > > > > </Directory>
>
> > > > > > WSGIScriptAlias / /usr/local/www/wsgi-scripts/wsgi_handler.py
> > > > > > <Directory /usr/local/www/wsgi-scripts>
> > > > > >     Order allow,deny
> > > > > >     Allow from all
> > > > > > </Directory>
> > > > > > #
> > > > > > </VirtualHost>
>
> > > > > > This link exists in /usr/local/www/documents/media
> > > > > > media ->
> > > > > > /usr/local/lib/python2.6/site-packages/django/contrib/admin/
> > > > > > media
>
> > > > > > according to the documentation.
>
> > > > > > I'm missing something, and just cannot see it. Pointers in fixing
> > > > > > this
> > > > > > would be appreciated.
> > > > > > Thank you.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 19th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support