Browse Source

admin done

inu1255 7 years ago
parent
commit
b54f73b35c
67 changed files with 5828 additions and 6 deletions
  1. 1 0
      .gitignore
  2. BIN
      common/__init__.pyc
  3. BIN
      common/admin.pyc
  4. BIN
      common/common.pyc
  5. BIN
      common/migrations/__init__.pyc
  6. BIN
      common/models.pyc
  7. BIN
      common/upload_to_oss.pyc
  8. BIN
      common/views.pyc
  9. BIN
      content_manage/__init__.pyc
  10. BIN
      content_manage/admin.pyc
  11. BIN
      content_manage/migrations/0001_initial.pyc
  12. BIN
      content_manage/migrations/0002_auto_20171116_1047.pyc
  13. BIN
      content_manage/migrations/0003_auto_20171116_1139.pyc
  14. BIN
      content_manage/migrations/0004_auto_20171116_1253.pyc
  15. BIN
      content_manage/migrations/0005_banner.pyc
  16. BIN
      content_manage/migrations/0006_news.pyc
  17. BIN
      content_manage/migrations/0007_auto_20171117_1117.pyc
  18. BIN
      content_manage/migrations/0008_auto_20171120_0146.pyc
  19. BIN
      content_manage/migrations/__init__.pyc
  20. BIN
      content_manage/models.pyc
  21. 6 3
      content_manage/views.py
  22. BIN
      content_manage/views.pyc
  23. 32 0
      serv.py
  24. 1785 0
      templates/www/__build_info__
  25. 1 0
      templates/www/index.html
  26. 22 0
      templates/www/static/0.f7ce74.js
  27. 43 0
      templates/www/static/app.ac3e43.js
  28. 6 0
      templates/www/static/app.fef7c2.css
  29. 1480 0
      templates/www/static/css/ionicons.css
  30. 11 0
      templates/www/static/css/ionicons.min.css
  31. BIN
      templates/www/static/fonts/ionicons.eot
  32. 2230 0
      templates/www/static/fonts/ionicons.svg
  33. BIN
      templates/www/static/fonts/ionicons.ttf
  34. BIN
      templates/www/static/fonts/ionicons.woff
  35. BIN
      templates/www/static/hbo.ico
  36. BIN
      templates/www/static/img/logo-770ff6.png
  37. 4 0
      templates/www/static/jquery.min.js
  38. 3 0
      templates/www/static/particles/app.js
  39. 110 0
      templates/www/static/particles/particles.json
  40. 9 0
      templates/www/static/particles/particles.min.js
  41. 35 0
      templates/www/static/vendor.95b8d5.js
  42. BIN
      users/__init__.pyc
  43. BIN
      users/admin.pyc
  44. BIN
      users/migrations/0001_initial.pyc
  45. BIN
      users/migrations/0002_users_real_name.pyc
  46. BIN
      users/migrations/0003_auto_20171116_0630.pyc
  47. BIN
      users/migrations/0004_auto_20171116_0702.pyc
  48. BIN
      users/migrations/0005_auto_20171116_0733.pyc
  49. BIN
      users/migrations/0006_auto_20171116_0917.pyc
  50. BIN
      users/migrations/0007_auto_20171116_1019.pyc
  51. BIN
      users/migrations/0008_auto_20171117_0232.pyc
  52. BIN
      users/migrations/0009_auto_20171117_0828.pyc
  53. BIN
      users/migrations/0010_auto_20171117_0831.pyc
  54. BIN
      users/migrations/0011_auto_20171120_0814.pyc
  55. BIN
      users/migrations/0012_remove_reader_fb_id.pyc
  56. BIN
      users/migrations/__init__.pyc
  57. BIN
      users/models.pyc
  58. 7 0
      users/views.py
  59. BIN
      users/views.pyc
  60. BIN
      xdcjing/__init__.pyc
  61. 21 0
      xdcjing/gen_root.py
  62. 2 2
      xdcjing/settings.py
  63. BIN
      xdcjing/settings.pyc
  64. 1 1
      xdcjing/urls.py
  65. BIN
      xdcjing/urls.pyc
  66. 19 0
      xdcjing/views.py
  67. BIN
      xdcjing/wsgi.pyc

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+*.pyc

BIN
common/__init__.pyc


BIN
common/admin.pyc


BIN
common/common.pyc


BIN
common/migrations/__init__.pyc


BIN
common/models.pyc


BIN
common/upload_to_oss.pyc


BIN
common/views.pyc


BIN
content_manage/__init__.pyc


BIN
content_manage/admin.pyc


BIN
content_manage/migrations/0001_initial.pyc


BIN
content_manage/migrations/0002_auto_20171116_1047.pyc


BIN
content_manage/migrations/0003_auto_20171116_1139.pyc


BIN
content_manage/migrations/0004_auto_20171116_1253.pyc


BIN
content_manage/migrations/0005_banner.pyc


BIN
content_manage/migrations/0006_news.pyc


BIN
content_manage/migrations/0007_auto_20171117_1117.pyc


BIN
content_manage/migrations/0008_auto_20171120_0146.pyc


BIN
content_manage/migrations/__init__.pyc


BIN
content_manage/models.pyc


+ 6 - 3
content_manage/views.py

@@ -56,8 +56,11 @@ def content_edit(request,offset):
         obj.save()
         res = {"code":0, "msg":"sucess",}
     else:
-        res = {"code":-1, "msg":"编辑失败"}
-    print(res)
+        obj,flag = Article.objects.get_or_create(title = title,type=int(offset))
+        obj.img_url = img_url
+        obj.content = content
+        obj.save()
+        res = {"code":0,"msg":"success",}
     return JsonResponse(res)
 
 
@@ -313,4 +316,4 @@ def news_delete(request):
     else:
         res={"code": -1, "msg": u"参数不完整"}
 
-    return JsonResponse(res)
+    return JsonResponse(res)

BIN
content_manage/views.pyc


+ 32 - 0
serv.py

@@ -0,0 +1,32 @@
+__author__ = 'alexander'
+import os
+import sys 
+
+from tornado.options import options, define, parse_command_line
+import django.core.handlers.wsgi
+import tornado.httpserver
+import tornado.ioloop
+import tornado.web
+import tornado.wsgi
+from django.core.wsgi import get_wsgi_application
+
+_HERE = os.path.abspath(os.path.dirname(__file__))
+sys.path.append(_HERE)
+sys.path.append(os.path.join(_HERE,'common'))
+os.environ['DJANGO_SETTINGS_MODULE'] = "xdcjing.settings"
+
+def main(port):
+    wsgi_app = tornado.wsgi.WSGIContainer(
+            #django.core.handlers.wsgi.WSGIHandler()
+                    get_wsgi_application()
+                            )   
+    tornado_app = tornado.web.Application(
+            [('.*', tornado.web.FallbackHandler, dict(fallback=wsgi_app)),
+                    ],debug=False)
+    server = tornado.httpserver.HTTPServer(tornado_app)
+    server.listen(port)
+    tornado.ioloop.IOLoop.instance().start()
+
+if __name__ == '__main__':
+    main(int(sys.argv[1]))
+

File diff suppressed because it is too large
+ 1785 - 0
templates/www/__build_info__


File diff suppressed because it is too large
+ 1 - 0
templates/www/index.html


File diff suppressed because it is too large
+ 22 - 0
templates/www/static/0.f7ce74.js


File diff suppressed because it is too large
+ 43 - 0
templates/www/static/app.ac3e43.js


File diff suppressed because it is too large
+ 6 - 0
templates/www/static/app.fef7c2.css


File diff suppressed because it is too large
+ 1480 - 0
templates/www/static/css/ionicons.css


File diff suppressed because it is too large
+ 11 - 0
templates/www/static/css/ionicons.min.css


BIN
templates/www/static/fonts/ionicons.eot


File diff suppressed because it is too large
+ 2230 - 0
templates/www/static/fonts/ionicons.svg


BIN
templates/www/static/fonts/ionicons.ttf


BIN
templates/www/static/fonts/ionicons.woff


BIN
templates/www/static/hbo.ico


BIN
templates/www/static/img/logo-770ff6.png


File diff suppressed because it is too large
+ 4 - 0
templates/www/static/jquery.min.js


+ 3 - 0
templates/www/static/particles/app.js

@@ -0,0 +1,3 @@
+// window.particlesJS.load('particles-js', 'static/particles/particles.json', function() {
+//   console.log('callback - particles.js config loaded')
+// })

+ 110 - 0
templates/www/static/particles/particles.json

@@ -0,0 +1,110 @@
+{
+  "particles": {
+    "number": {
+      "value": 10,
+      "density": {
+        "enable": true,
+        "value_area": 800
+      }
+    },
+    "color": {
+      "value": "#eee"
+    },
+    "shape": {
+      "type": "circle",
+      "stroke": {
+        "width": 0,
+        "color": "#000000"
+      },
+      "polygon": {
+        "nb_sides": 5
+      },
+      "image": {
+        "src": "img/github.svg",
+        "width": 100,
+        "height": 100
+      }
+    },
+    "opacity": {
+      "value": 0.5,
+      "random": false,
+      "anim": {
+        "enable": false,
+        "speed": 1,
+        "opacity_min": 0.1,
+        "sync": false
+      }
+    },
+    "size": {
+      "value": 10,
+      "random": true,
+      "anim": {
+        "enable": false,
+        "speed": 80,
+        "size_min": 0.1,
+        "sync": false
+      }
+    },
+    "line_linked": {
+      "enable": true,
+      "distance": 300,
+      "color": "#eee",
+      "opacity": 0.4,
+      "width": 2
+    },
+    "move": {
+      "enable": true,
+      "speed": 3,
+      "direction": "none",
+      "random": false,
+      "straight": false,
+      "out_mode": "out",
+      "bounce": false,
+      "attract": {
+        "enable": false,
+        "rotateX": 600,
+        "rotateY": 1200
+      }
+    }
+  },
+  "interactivity": {
+    "detect_on": "canvas",
+    "events": {
+      "onhover": {
+        "enable": false,
+        "mode": "repulse"
+      },
+      "onclick": {
+        "enable": true,
+        "mode": "push"
+      },
+      "resize": true
+    },
+    "modes": {
+      "grab": {
+        "distance": 800,
+        "line_linked": {
+          "opacity": 1
+        }
+      },
+      "bubble": {
+        "distance": 800,
+        "size": 80,
+        "duration": 2,
+        "opacity": 0.8,
+        "speed": 0.2
+      },
+      "repulse": {
+        "distance": 400,
+        "duration": 0.4
+      },
+      "push": {
+        "particles_nb": 4
+      },
+      "remove": {
+        "particles_nb": 2
+      }
+    }
+  },
+  "retina_detect": true
+}

File diff suppressed because it is too large
+ 9 - 0
templates/www/static/particles/particles.min.js


File diff suppressed because it is too large
+ 35 - 0
templates/www/static/vendor.95b8d5.js


BIN
users/__init__.pyc


BIN
users/admin.pyc


BIN
users/migrations/0001_initial.pyc


BIN
users/migrations/0002_users_real_name.pyc


BIN
users/migrations/0003_auto_20171116_0630.pyc


BIN
users/migrations/0004_auto_20171116_0702.pyc


BIN
users/migrations/0005_auto_20171116_0733.pyc


BIN
users/migrations/0006_auto_20171116_0917.pyc


BIN
users/migrations/0007_auto_20171116_1019.pyc


BIN
users/migrations/0008_auto_20171117_0232.pyc


BIN
users/migrations/0009_auto_20171117_0828.pyc


BIN
users/migrations/0010_auto_20171117_0831.pyc


BIN
users/migrations/0011_auto_20171120_0814.pyc


BIN
users/migrations/0012_remove_reader_fb_id.pyc


BIN
users/migrations/__init__.pyc


BIN
users/models.pyc


+ 7 - 0
users/views.py

@@ -8,6 +8,7 @@ import traceback
 from django.contrib.auth.hashers import make_password, check_password
 from django.views.decorators.csrf import csrf_exempt
 from django.core.exceptions import ObjectDoesNotExist
+from django.shortcuts import render
 from models import *
 
 from common.common import (get_user_from_request, login_required,
@@ -334,3 +335,9 @@ def fb_question(request):
 
     else:
         return JsonResponse({"code":-1, "msg":"参数不完整"})
+
+
+def home(request):
+    """
+    """
+    return render(request,"www/index.html",{})

BIN
users/views.pyc


BIN
xdcjing/__init__.pyc


+ 21 - 0
xdcjing/gen_root.py

@@ -0,0 +1,21 @@
+#-*-coding:utf-8 -*-
+import os
+os.environ["DJANGO_SETTINGS_MODULE"] = "xdcjing.settings"
+import django
+django.setup()
+
+
+from django.contrib.auth.hashers import make_password, check_password
+from users.models import Users
+
+
+def gen_root_user():
+    """
+    """
+    password = make_password("xdcjadmin")
+    Users.objects.filter(username="xdcjadmin").delete()
+    obj,flag = Users.objects.get_or_create(username="xdcjadmin",password=password)
+    print obj,flag
+
+if __name__ == "__main__":
+    gen_root_user()

+ 2 - 2
xdcjing/settings.py

@@ -102,7 +102,7 @@ ROOT_URLCONF = 'xdcjing.urls'
 TEMPLATES = [
     {
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
-        'DIRS': [],
+        'DIRS': ["/root/xdcjing/templates"],
         'APP_DIRS': True,
         'OPTIONS': {
             'context_processors': [
@@ -126,7 +126,7 @@ DATABASES = {
         'ENGINE': 'django.db.backends.mysql',
         'NAME': 'xdcjing_db',
         'USER': 'root',
-        'PASSWORD': 'root',
+        'PASSWORD': '123456',
         'HOST': '127.0.0.1',
         'PORT': 3306,
     }

BIN
xdcjing/settings.pyc


+ 1 - 1
xdcjing/urls.py

@@ -6,10 +6,10 @@ import common.views
 
 urlpatterns = [
     # Examples:
-    # url(r'^$', 'xdcjing.views.home', name='home'),
     # url(r'^blog/', include('blog.urls')),
 
     # url(r'^admin/$', include(admin.site.urls)),
+    url(r'^$',users.views.home),
     url(r'^login/$', users.views.login),
     url(r'^logout/$', users.views.logout),
     url(r'^adduser/$', users.views.adduser),

BIN
xdcjing/urls.pyc


+ 19 - 0
xdcjing/views.py

@@ -0,0 +1,19 @@
+# -*-coding:utf-8 -*-
+import json
+import time
+import traceback
+# from django.shortcuts import render
+# from django.http import HttpResponse
+# from django.core.serializers.json import DjangoJSONEncoder
+from django.contrib.auth.hashers import make_password, check_password
+from django.views.decorators.csrf import csrf_exempt
+from django.core.exceptions import ObjectDoesNotExist
+from django.shortcuts import render
+from models import *
+
+
+def home(request):
+    """
+    """
+    return render(request,"www/index.html",{})
+

BIN
xdcjing/wsgi.pyc