0
votes

I've created an app (let's call it "app") with some models under it. I recently activated the admin page, and fortunately it displays all the models under the app. Unfortunately, the urls are all wrong. The url "/admin/app/modelX" actually works, but the admin page presents the url "/app/modelX" without including "admin". My urls.py has (r'^admin/?', include(admin.site.urls)), Inside the app folder, admin.py is along these lines:

from smartctl.models import Model1, Model2, Model3, Model4, Model5 from django.contrib import admin

class Model1Admin(admin.ModelAdmin): pass

admin.site.register(Model1, Model1Admin)

I've looked for any admin folder to find out how it is generating these urls, but I can't find it (or the "contrib" folder it is supposed to be under). I am using the django test server, version 1.2.5.

1

1 Answers

0
votes

I found out that the link is generated correctly if I enter the admin url as ".../admin/". As you can see I included a "?" in urls.py so that "admin" and "admin/" were treated equivalently. Unfortunately, this results in different behavior when the links are generated.