raylu 14 жил өмнө
parent
commit
6f470aaf6b
3 өөрчлөгдсөн 19 нэмэгдсэн , 8 устгасан
  1. 14 0
      postinstall
  2. 2 3
      pyc/settings.py
  3. 3 5
      pyc/urls.py

+ 14 - 0
postinstall

@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+# http://docs.dotcloud.com/tutorials/django/#static-files-and-admin-media
+
+import os
+os.environ['DJANGO_SETTINGS_MODULE'] = 'pyc.settings'
+import django.contrib.admin
+
+admindir = os.path.dirname(django.contrib.admin.__file__)
+mediadir = os.path.join(admindir, 'media')
+
+staticlink = os.path.join('static', 'admin')
+if not os.path.islink(staticlink):
+	os.symlink(mediadir, staticlink)

+ 2 - 3
pyc/settings.py

@@ -4,7 +4,7 @@ DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
 ADMINS = (
-	# ('Your Name', 'your_email@example.com'),
+	('raylu', 'lurayl@gmail.com'),
 )
 
 MANAGERS = ADMINS
@@ -121,8 +121,7 @@ INSTALLED_APPS = (
 	'django.contrib.sites',
 	'django.contrib.messages',
 	'django.contrib.staticfiles',
-	# Uncomment the next line to enable the admin:
-	# 'django.contrib.admin',
+	'django.contrib.admin',
 	# Uncomment the next line to enable admin documentation:
 	# 'django.contrib.admindocs',
 )

+ 3 - 5
pyc/urls.py

@@ -1,8 +1,7 @@
 from django.conf.urls.defaults import patterns, include, url
 
-# Uncomment the next two lines to enable the admin:
-# from django.contrib import admin
-# admin.autodiscover()
+from django.contrib import admin
+admin.autodiscover()
 
 urlpatterns = patterns('',
     # Examples:
@@ -12,6 +11,5 @@ urlpatterns = patterns('',
     # Uncomment the admin/doc line below to enable admin documentation:
     # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
-    # Uncomment the next line to enable the admin:
-    # url(r'^admin/', include(admin.site.urls)),
+    url(r'^admin/', include(admin.site.urls)),
 )