Giter Club home page Giter Club logo

nahan's Introduction

NaHan: A Tiny Forum.

NaHan is a tiny forum written by Python flask and bootstrap. Its goal is to learn flask and web development in practice.

Topic page:

Admin page:

Features

Major features:

  1. Whole user manage system, containing registration, login, password change, retrieve;
  2. Topic management system, login users can create topics, append topics, have comments on topics.
  3. Markdown support in topic, appendix of topic and comment.
  4. Can use @someone to remind other user anywhere. The user which be is reminded will receive notify.
  5. A convenient administrator system, super user can block or activate users, topics, nodes and comments.
  6. A simple keyword search engine, one can search some specific topics.

How to Run

  1. Firstly, make sure all the relevant modules installed.

    You'd better use virtualenv to create a isolated python environments, and then use pip to install all the requirements.

     pip install -r requirements.txt
    
  2. Do some custom configure in config.py, have a glance as followers:

     # flask config
     SECRET_KEY = os.environ.get('SECRET_KEY') or '!@#$%^&*12345678'
     
     # Config about senting email.
     MAIL_SERVER = 'smtp.qq.com'
     MAIL_PORT = 465
     MAIL_USE_SSL = True
     MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
     MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
     FORUM_MAIL_SUBJECT_PREFIX = 'NaHan'
     FORUM_MAIL_SENDER = 'Nahan <[email protected]>'
    
     # Optional, setting about translation.
     BABEL_DEFAULT_LOCALE = 'zh'
     BABEL_DEFAULT_TIMEZONE = 'CST'
     
     # Some config about forum, containing pagination page size, saving position and limit of avatar.
     PER_PAGE = 10   
     UPLOAD_FOLDER = os.path.join(basedir, 'nahan/static/upload')
     ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg'])
     MAX_CONTENT_LENGTH = 512 * 1024
     
     # Database setting.
     SQLALCHEMY_DATABASE_URI = (os.environ.get('DEV_DATABASE_URL') or
                            'mysql://root:******@localhost/nahan')
    
  3. Start corresponding database service.

    In MacOS, start mysql using the following command:

     mysql.server start
    
  4. Go to the project's directory, run python manage.py runserver.

For more about how to run a flask project, you need to have much knowledge about flask, docs can be found here.

nahan's People

Contributors

selfboot avatar xuelinf avatar

Watchers

James Cloos avatar xfkxfk 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.