Skip to content

Instantly share code, notes, and snippets.

@trey
Created July 26, 2008 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trey/2680 to your computer and use it in GitHub Desktop.
Save trey/2680 to your computer and use it in GitHub Desktop.
The way to do things post-newformsadmin
INSTALLED_APPS = (
'your_app',
'django.contrib.admin',
'django.contrib.admindocs',
...
)
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^$', direct_to_template, {'template': 'home.html'}),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/(.*)', admin.site.root),
)
# This allows Django to serve static files when you're developing your project.
# You'll have to do something else in production.
# More information: http://www.djangoproject.com/documentation/static_files/
# -----------------------------------------------------------------------------
if settings.DEBUG:
urlpatterns += patterns("django.views",
url(r"^static/(?P<path>.*)", "static.serve", {
"document_root": settings.MEDIA_ROOT,
})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment