Commits

vickyi committed 1deff56 Draft

在本地能运行了

Comments (0)

Files changed (12)

.settings/org.eclipse.core.resources.prefs

+eclipse.preferences.version=1
+encoding//ChineBlog/blog/models.py=utf-8
+encoding//ChineBlog/blog/urls.py=utf-8
+encoding//ChineBlog/blog/views.py=utf-8
+encoding//ChineBlog/dashboard.py=utf-8
+encoding//ChineBlog/settings.py=utf-8
+encoding//ChineBlog/social/google/__init__.py=utf-8
+encoding//ChineBlog/social/renren/__init__.py=utf-8
+encoding//ChineBlog/social/txweibo/__init__.py=utf-8
+encoding//ChineBlog/social/urls.py=utf-8
+encoding//ChineBlog/social/views.py=utf-8
+encoding//ChineBlog/social/weibo/__init__.py=utf-8
+encoding//ChineBlog/social/weibo/weibo1.py=utf-8
Add a comment to this file

ChineBlog/blog/static/uploads/avatar.jpg

Removed
Old image
Add a comment to this file

ChineBlog/blog/static/uploads/me.jpg

Added
New image

ChineBlog/blog/templates/blog/coolblue/base.html

 	
 	<link rel="shortcut icon" href="/static/blog/coolblue/images/chine.ico"/>
 	
-	<title>{% block title %}{% endblock %}残阳似血的博客</title>
+	<title>{% block title %}{% endblock %}myblog</title>
 	
 	{% block css %}
 	{% endblock %}

ChineBlog/blog/templates/blog/coolblue/footer.html

 		    <h3>联系信息</h3>
 
 		    <p>
-			<strong>QQ: </strong>344861256<br/>
+			<strong>QQ: </strong>895642425<br/>
 			</p>
 	
-	        <p><strong>E-mail: </strong>chinekingseu@gmail.com</p>
+	        <p><strong>E-mail: </strong>dolphinzhang1987@gmail.com</p>
 			<p><strong>更多信息 - 请访问</strong> <a href="{% url blog_about %}">关于作者</a></p>
 
             <h3>获取更新</h3>
 
 	<p class="footer-left">
 		&copy; 2012 Copyright Info &nbsp; &nbsp; &nbsp;
-		<a href="#" title="残阳似血的博客">残阳似血的博客</a> powered by <a href="http://www.djangoproject.com/" target="_blank">Django</a>
+		<a href="#" title="myblog">myblog</a> powered by <a href="http://www.djangoproject.com/" target="_blank">Django</a>
 	</p>
 
 	<p class="footer-right">

ChineBlog/blog/templates/blog/coolblue/nav.html

 <div id="header-wrap"><header>
 
  	<hgroup>
-        <h1 id="logo-text"><a href="/" title="">残阳似血的博客</a></h1>
+        <h1 id="logo-text"><a href="/" title="">myblog</a></h1>
 		<p id="slogan">Lost good things... </p>
     </hgroup>
 

ChineBlog/blog/templates/blog/coolblue/sidebar.html

     </div>
 	
 	<div>
-		<h3>残阳似血的微博</h3>
-		<iframe width="100%" height="400" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=400&fansRow=2&ptype=1&speed=0&skin=1&isTitle=1&noborder=1&isWeibo=1&isFans=0&uid=1883113397&verifier=45ddb58d&dpc=1"></iframe>
+		<h3>my微博</h3>
+		<iframe width="100%" height="450" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=450&fansRow=1&ptype=1&speed=0&skin=8&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=1785153462&verifier=1c7c4ebd&dpc=1"></iframe>
 	</div>
 	
 	<div>

ChineBlog/blog/views.py

     except BlogUser.DoesNotExist:
         user = User.objects.get(username=admin)
         info = 'Define the user info in the admin interface' # Define the admin info here
-        avatar = 'avatar.jpg'
+        avatar = 'me.jpg'
         
         author = BlogUser(small_avatar=avatar, info=info, user=user)
         author.save()

ChineBlog/manage.py

-#!/usr/bin/env python
-from django.core.management import execute_manager
-import imp
-try:
-    imp.find_module('settings') # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
-    sys.exit(1)
-
-import settings
-
-if __name__ == "__main__":
-    execute_manager(settings)
+#!/usr/bin/python
+from django.core.management import execute_manager
+import imp
+try:
+    imp.find_module('settings') # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
+    sys.exit(1)
+
+import settings
+
+if __name__ == "__main__":
+    execute_manager(settings)

ChineBlog/manage.py~

+#!/usr/bin/python
+from django.core.management import execute_manager
+import imp
+try:
+    imp.find_module('settings') # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
+    sys.exit(1)
+
+import settings
+
+if __name__ == "__main__":
+    execute_manager(settings)

ChineBlog/settings.py

 TEMPLATE_DEBUG = DEBUG
 
 ADMINS = (
-    ('Chine', 'chinekingseu@gmail.com'),
+    ('vic', 'dolphinzhang@gmail.com'),
 )
 
 MANAGERS = ADMINS
 
+#DATABASE Settings
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': get_path(('db', 'chine.db')),                      # Or path to database file if using sqlite3.
-        'USER': '',                      # Not used with sqlite3.
-        'PASSWORD': '',                  # Not used with sqlite3.
+        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'myblogdb',                      # Or path to database file if using sqlite3.
+        'USER': 'root',                      # Not used with sqlite3.
+        'PASSWORD': 'root',                  # Not used with sqlite3.
         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-    }
+     }
 }
 
 # Local time zone for this installation. Choices can be found here:
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
-    'django.middleware.csrf.CsrfResponseMiddleware',
+#    'django.middleware.csrf.CsrfResponseMiddleware',
 )
 
 ROOT_URLCONF = 'ChineBlog.urls'
 BLOG_THEME = 'coolblue'
 # Needed install: PIL
 # Grappelli
-GRAPPELLI_ADMIN_TITLE = "残阳似血的博客"
+GRAPPELLI_ADMIN_TITLE = "青青子矜的博客"
 GRAPPELLI_INDEX_DASHBOARD = 'ChineBlog.dashboard.CustomIndexDashboard'
 # Filebrowser
 FILEBROWSER_DIRECTORY = ''
+"""Before run this project,you have to modify some files"""
+
+1、at the first line of `./manage.py` add:
+`#!/usr/bin/python`
+
+2、change settings according to your env :
+#DATABASE Settings
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'myblogdb',                      # Or path to database file if using sqlite3.
+        'USER': 'root',                      # Not used with sqlite3.
+        'PASSWORD': 'root',                  # Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+     }
+}
+
+and you should create a databse in your mysql whit name myblogdb
+
+3、install required app
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'django.contrib.sitemaps',
+    # Grapplli
+    'grappelli.dashboard',
+    'grappelli',
+    # Filebrowser
+    'filebrowser',
+    # mptt
+    'mptt',
+    # Uncomment the next line to enable the admin:
+    'django.contrib.admin',
+    # Uncomment the next line to enable admin documentation:
+    # 'django.contrib.admindocs',
+#    'south',
+    # blog, social
+    'blog',
+    'social',
+#    'qqweibo'
+)
+1\
+http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other
+chmod +x setuptools-0.6c11-py2.7.egg
+sudo sh setuptools-0.6c11-py2.7.egg
+
+
+https://github.com/django-mptt/django-mptt
+chmod +x setup.py
+sudo python setup.py install
+
+https://github.com/sehmaschine/django-grappelli
+chmod +x setup.py
+sudo python setup.py install
+
+http://django-filebrowser.readthedocs.org/en/3.5.0/index.html
+https://github.com/sehmaschine/django-filebrowser
+chmod +x setup.py
+sudo python setup.py install
+
+http://south.aeracode.org/
+http://south.readthedocs.org/en/latest/installation.html
+sudo python setup.py install
+
+if you get the following error: 
+/ChineBlog/social/txweibo/__init__.py", line 6, in <module>
+    from qqweibo import OAuthHandler, API
+ImportError: No module named qqweibo
+reason:这里用到了一个叫pyqqweibo的包,推荐用setuptools来安装,运行命令easy_install pyqqweibo就可以了。
+
+please do the following steps:
+sudo easy_install pyqqweibo
+or 
+当然也可以从源码安装,pyqqweibo地址——https://github.com/andelf/pyqqweibo
+
+FAQ:
+1\
+Q:
+ImproperlyConfigured: Middleware module "django.middleware.csrf" does not define a "CsrfResponseMiddleware" class
+A:
+CsrfResponseMiddleware is for backward compatibility and should be removed
+
+
+
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.