zoukankan      html  css  js  c++  java
  • Django 1 write app

    python3 manage.py runserver 
    

      

    ENV :

     $python3 -c "import django ; print(django.get_version())"
      1.10.2
    

      

    目录结构

    ├── audios
    │   ├── admin.py
    │   ├── apps.py
    │   ├── __init__.py
    │   ├── migrations
    │   ├── models.py
    │   ├── __pycache__
    │   ├── statics
    │   ├── tests.py
    │   └── views.py
    ├── test
    │   ├── __init__.py
    │   ├── __pycache__
    │   ├── settings.py
    │   ├── urls.py
    │   └── wsgi.py
    ├── db.sqlite3
    ├── manage.py
    ├── static
    │   └── admin
    ├── statics
    │   ├── admin
    │   ├── css
    │   ├── fonts
    │   └── js
    └── templates
        └── index.html
    

    settings.py

    STATIC_URL = '/static/'
    STATIC_ROOT = os.path.join(BASE_DIR,'statics')
    
    STATICFILES_DIRS = (
         os.path.join(BASE_DIR, 'audios/statics'),
    )
    

    audios/views.py

    from django.shortcuts import render ,render_to_response
    
    # Create your views here.
    
    def index(request):
        return render_to_response('index.html')
    

    templates/index.html

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        {% load static %}
        <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}"/>
        <script type="text/javascript" src="{% static "js/bootstrap.min.js" %}"></script>
        <title>Title</title>
    </head>
    <body>
    
    <div class="container container-fluid">
    
        <table class="table">
            <thead>
            <th>Loop Num</th>
            <th>Case Type</th>
            </thead>
            <tbody>
            
            </tbody>
        </table>
    </div>
    </body>
    </html>
    

    runserver  ... Done 

    python3 manage.py runserver 0.0.0.0:10001
    

      

      

      

  • 相关阅读:
    从零构建自己的远控•界面搭建(2)
    从零构建自己的远控•项目简介(1)
    特训99小游戏
    WritePrivateProfileSection 示例
    dll劫持
    c/c++创建动态库
    不传请求号修改测试系统或者正式系统代码
    ABAP 业务处理中的弹窗提示
    SAP MM 采购订单中货币单位怎么修改
    ABAP 屏幕字段无搜索帮助处理
  • 原文地址:https://www.cnblogs.com/zsr0401/p/6513466.html
Copyright © 2011-2022 走看看