iHTCboy

UID: 333

Topics created by iHTCboy
Replies from iHTCboy
  • Replied to 感谢开源!!! 3 months, 1 week ago
  • <!DOCTYPE html>
    <html>
    <head>
      <title>Bootstrap 实例</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
      <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
      <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
      <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
    </head>
    <body>
    
    <div class="container">
      <h2>背景颜色</h2>
      <p class="bg-primary text-white">重要的背景颜色。</p>
      <p class="bg-success text-white">执行成功背景颜色。</p>
      <p class="bg-info text-white">信息提示背景颜色。</p>
      <p class="bg-warning text-white">警告背景颜色</p>
      <p class="bg-danger text-white">危险背景颜色。</p>
      <p class="bg-secondary text-white">副标题背景颜色。</p>
      <p class="bg-dark text-white">深灰背景颜色。</p>
      <p class="bg-light text-dark">浅灰背景颜色。</p>
    </div>
    
    </body>
    </html>
    

  • Replied to 为什么我部署的niji修改头像时无法正常显示头像图片 4 months, 1 week ago
  • @Annabel

    在urls.py 添加

    urlpatterns = [
    ...
    url(r'^uploads/(?P<path>.*?)/(?P<subpath>.*?)/(?P<filename>.*?)/$', views.get_upload_file, name="get_upload_file"),
    ...
    

    ]

    在view.py添加

    import os
    from django.http import HttpResponse
    
    def get_upload_file(request, path, subpath, filename):
        file_path = os.getcwd() + '/uploads/{}/{}/{}'.format(path, subpath, filename)
        print(file_path)
        if os.path.isfile(file_path):
            try:
                with open(file_path, 'rb') as f:
                    image_data = f.read()
                return HttpResponse(image_data, content_type="image/png")
            except Exception as e:
                print(e)
    
        return HttpResponse(str('404: Not Found'))
    

    这样就可以显示图片啦

  • Replied to 为什么我部署的niji修改头像时无法正常显示头像图片 4 months, 1 week ago
  • @Annabel

    使用这个编辑器, 在setting里添加 'pagedown',

    INSTALLED_APPS = [
     ...
        'pagedown',
    ...
    ]
    

  • Replied to 为什么我部署的niji修改头像时无法正常显示头像图片 4 months, 1 week ago
  • @eric

    [14/Jun/2019 06:48:53] "GET /avatar/ HTTP/1.1" 200 7033
    1.png [14/Jun/2019 06:49:04] "POST /avatar/ HTTP/1.1" 302 0 [14/Jun/2019 06:49:04] "GET / HTTP/1.1" 200 10142 Not Found: /uploads/forum/avatars/1.png [14/Jun/2019 06:49:04] "GET /uploads/forum/avatars/1.png HTTP/1.1" 404 5948
    

  • Replied to 为什么我部署的niji修改头像时无法正常显示头像图片 4 months, 1 week ago
  • @eric

    [14/Jun/2019 06:48:53] "GET /avatar/ HTTP/1.1" 200 7033
    1.png [14/Jun/2019 06:49:04] "POST /avatar/ HTTP/1.1" 302 0 [14/Jun/2019 06:49:04] "GET / HTTP/1.1" 200 10142 Not Found: /uploads/forum/avatars/1.png [14/Jun/2019 06:49:04] "GET /uploads/forum/avatars/1.png HTTP/1.1" 404 5948
    

  • Replied to 请问有没有详细的部署手册 4 months, 1 week ago
  • @yanghao @fengleon

    我已经调整为独立项目运行,Python3 + Django 2.2.2

    可参考:https://github.com/iHTCboy/niji

  • Replied to 请问有没有详细的部署手册 4 months, 4 weeks ago
  • 配置什么?

  • Replied to 你好 4 months, 4 weeks ago
  • 你好!

  • Replied to 你好,哈哈 4 months, 4 weeks ago
  • 沙发:

    Django-NIJI is a pluggable forum app for Django projects.
    
    Demo
    
    https://demo.nijiforum.com/
    Docs
    
    http://django-niji.rtfd.io
    

  • Replied to 你好,哈哈 4 months, 4 weeks ago
  • @iHTCboy

    测试一下,感觉很棒!谢谢开源!谢谢作者~

  • Replied to 你好,哈哈 4 months, 4 weeks ago
  • 更新,2019年后,苹果更新 Xcode10,后,需要补充更新:

    // 支持设备自动旋转
    - (BOOL)shouldAutorotate {
        return NO;
    }
    
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
        return NO;
    }
    
    // 支持横屏显示
    - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
        // 如果该界面需要支持横竖屏切换
        return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
    }
    

  • Replied to 感谢开源!!! 5 months, 1 week ago
  • @iHTCboy

    真棒!!!

  • Replied to 感谢开源!!! 5 months, 1 week ago
  • 你好啊~~~

    谢谢

NIJI APP
NIJI is a forum app built with Django