Giter Site home page Giter Site logo

lol666666 / pollsystemdemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giraffe0813/pollsystemdemo

0.0 1.0 0.0 29 KB

根据Django官方的教程写的投票系统 在教程基础上用bootstrap美化了一丢丢 真的要被Django吸粉了

Python 77.80% HTML 22.20%

pollsystemdemo's Introduction

PollSystemDemo

根据Django官方的教程写的投票系统 真的要被Django吸粉了

运行投票系统

1.安装python,MySQL-python, gunicorn(可选)
2.clone 项目

 $ cd worksapce
 $ git clone [email protected]:giraffe0813/PollSystemDemo.git

3.修改setting.py文件中的数据库配置

 $ cd PollSystemDemo/mysite
 $ vi setting.py

依据实际使用的数据库地址,用户,密码修改下面的配置

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mydatabase',
        'USER': 'root',
        'PASSWORD': 'coffee',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}

4.建表

执行下面的命令会在上面配置的数据库中新建多张表

 $ cd PollSystemDemo
 $ python manage.py migrate

5.运行 两种方法

  • 最简单的方法
 $ pyhton manage.py runserver
  • 第二种方法 需要安装gunicorn
 $ gunicorn mysite.wsgi:application -b 127.0.0.1:8000 --reload

6 访问
浏览器中访问 localhost:8000 即可

使用投票系统管理后台

1 创建管理员账号

  $ cd PollSystemDemo
  $ python manage.py createsuperuser 

按照提示设置用户名,邮箱和密码

2 运行项目

  • 最简单的方法
 $ pyhton manage.py runserver
  • 第二种方法 需要安装gunicorn
 $ gunicorn mysite.wsgi:application -b 127.0.0.1:8000 --relo

3 访问管理后台

浏览器访问 localhost:8000/admin 按照第一步设置的用户名和密码登陆就可以使用管理系统了

🎅

pollsystemdemo's People

Contributors

giraffe0813 avatar

Watchers

baby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.