GithubHelp home page GithubHelp logo

paulguo / f2e.im Goto Github PK

View Code? Open in Web Editor NEW
613.0 54.0 217.0 1.7 MB

A community for front-end-developer.

Home Page: http://f2e.im

License: BSD 3-Clause "New" or "Revised" License

Python 14.35% CSS 30.81% JavaScript 54.84%

f2e.im's Introduction

ABOUT F2E.im

F2E is a community for front-end-developer.

How to contribute

Fork and send pull request.

How to run f2e.im on your own machine

  1. install all required modules:

    shell> pip install -r requirements.txt
    
  2. create database and then execute sql file in dbstructure/

    shell> mysql -u YOURUSERNAME -p
    
    mysql> create database f2e;
    mysql> exit
    
    shell> mysql -u YOURUSERNAME -p --database=f2e < dbstructure/f2e.sql
    
  3. set your mysql user/password and smtp server config in application.py and lib/sendmail.py.

  4. check above, using python application.py to start server.

    shell> python application.py --port=9001 --mysql_database=f2e --mysql_host=localhost --mysql_password=YOURPASSWORD --mysql_user=YOURUSERNAME
    

How to set up a production enironment

You need to know a little of supervisor and nginx, all config files are available in conf/

f2e.im's People

Contributors

dc3 avatar fraserxu avatar idealhack avatar paulguo avatar uoryon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

f2e.im's Issues

关于话题在被收藏和被取消收藏时话题作者声誉点增加的问题

topic_time_diff = datetime.datetime.now() - topic_info["created"]
reputation = topic_info["author_reputation"] or 0
reputation = reputation + 2 * math.log(self.current_user["reputation"] or 0 + topic_time_diff.days + 10, 10)
self.user_model.set_user_base_info_by_uid(topic_info["author_id"], {"reputation": reputation})

有点没看明白,为什么话题被收藏和被取消收藏时,声誉都是增加了?两个Handler的算法写的一样。

📌 Follow the Step-by-Step Guide to Claim Your $700 Now!

Introduction:

Welcome to the exciting world of crypto airdrops! Here's a curated list of active airdrops that you wouldn't want to miss. Dive in and explore the opportunities:

📌 Follow the Step-by-Step Guide to Claim Your Tokens!

  1. Share on Social Media:

    🚀 Claim Your Share: Pyth Network Airdrop 🚀 Unlock the potential of $PYTH tokens in this step-by-step guide. Claim yours now! Share on Twitter

    — Pyth Network (@pythnetwork) November 28, 2023
  2. Verify Eligibility:
    After sharing and connecting your walle

Active Airdrops:

  1. Layer Zero Airdrop

    Layer Zero Banner
  2. Pyth Network Airdrop

    Pyth Network Banner
  3. Mantle Network Airdrop

    Mantle Network Banner

数据库结构问题

先看了下sql,发现挺多是text的。
text在从mysql传输前端上不占优势。
但text不是必要的说。大部分用varchar就好。

底层数据库操作类lib/query.py的一些问题,探讨一下!

        # update
        if(self.__check("data") and statement == "data:save"):
            sets = ""
            for data in self.__protected["__data"]:
                sets = sets + "%s = '%s', " % (data, self.__valuefix(self.__protected["__data"][data]))

            sets = sets.strip().rstrip(",")
            sql = sql + " SET %s" % sets

        # insert
        if(self.__check("data") and statement == "data:add"):
            sets = ""
            values = ""
            for data in self.__protected["__data"]:
                sets = sets + "%s, " % data
                values = values + "'%s', " % self.__valuefix(self.__protected["__data"][data])

            sets = sets.strip().rstrip(",")
            values = values.strip().rstrip(",")
            sql = sql + " (%s)" % sets
            sql = sql + " VALUES (%s)" % values

如上,当update或者insert的值是None的时候,照样被带入sql语句了,这样会导致数据库报错。

以update为例子,假设self.__protected["__data"][data]=None,那么就会生成语句update tablename set data = None where ...这样会让数据库报错!

修复方案:
应该先判断一下self.__protected["__data"][data]=None中的值是否为None,否则不执行下面的生成SQL的语句,insert操作处的修改也一样!

希望作者详细测试一下!

感觉F2E的session完全没有被用到

    def get_current_user(self):
        user_id = self.get_secure_cookie("user")
        if not user_id: return None
        return self.user_model.get_user_by_uid(int(user_id))

BaseHandler直接就使用cookie获取id,然后从数据库中获取user的信息,用session的话这里不是应该从session中获取user吗?
搜索了下memcache,只在lib.session中使用了

the admin visit address ?

I built out a commity on local.Then register for an account,But I cant find the button for create subject.
some one can help me!

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.