Admin login problem

15 views
Skip to first unread message

Yatla

unread,
Dec 12, 2006, 2:35:39 PM12/12/06
to Django users
Newbie here - saw that the same question was asked earlier but not
answered, and the post was locked so I could not reply.

I have a Django site in a subdirectory as follows (via fcgi) - (using
ver 0.96 pre via svn)

http://mydomain.com/dj

When I go into the Admin area as follows

http://mydomain.com/dj/Admin/

The login form that comes up has action="/admin/" (not "/dj/admin"), so
the post goes to

http://mydomain.com/admin

which is not the Django site. Somehow the /dg/ subdirectory info is
not prefixed to the form action. Is there a configuration with the
main site prefix that I'm missing somwhere, I ony see path to media to
be set in tte seetings?

Thanks

Jorge Gajon

unread,
Dec 13, 2006, 12:53:13 PM12/13/06
to django...@googlegroups.com

Hi Yatla,
Are you using an .htaccess file? I have a site on Dreamhost in which
my Django app live under a sub-url like this:
http://mydomain.com/galeria/

In my .htaccess file (in the 'galeria' folder of the domain) I have
the following rules:

RewriteEngine On
RewriteRule ^(media/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(django.fcgi)
RewriteRule ^(.*)$ django.fcgi/galeria/$1 [L]


Remember that in your urls.py file you will need to include the admin
urls like this:

(r'^galeria/admin/', include('django.contrib.admin.urls')),


Hope it helps.

Regards,
Jorge

Yatla

unread,
Dec 13, 2006, 5:35:45 PM12/13/06
to Django users
Jorge,

Many thanks! I was using an .htaccess in the subdirectory, but did not
have the subdirectory specified after the fcgi file in the last rewrite
rule. I don't know much about this so just copied from a tutorial on
this that did not have the subdirectory in the rewriterule. Thanks
again!

btw, it seems to work correctly whether I had the subdirectory in front
of the admin/ or not in the url.py file, ie, just
(r'^admin/', include('django.contrib.admin.urls')),
seems to work after I modified the rewriterule.

Yatla

Yatla

unread,
Dec 15, 2006, 9:07:47 AM12/15/06
to Django users
Jorge,

Turns out that I did need to modify the url as you indicated like

(r'^galeria/admin/', include('django.contrib.admin.urls')),

the first time the site or my browser must have been caching something
and it seemed to work.

Now onwards to build the site

Yatla

Reply all
Reply to author
Forward
0 new messages