All Projects → codelucas → Flask_reddit

codelucas / Flask_reddit

Licence: mit
Reddit clone in flask + python + nginx + https. View site:

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Flask reddit

Reddit sse stream
A Server Side Event stream to deliver Reddit comments and submissions in near real-time to a client.
Stars: ✭ 39 (-91.91%)
Mutual labels:  flask, reddit
Flack
Companion code to my PyCon 2016 "Flask at Scale" tutorial session.
Stars: ✭ 458 (-4.98%)
Mutual labels:  flask
Flasksaas
A great starting point to build your SaaS in Flask & Python, with Stripe subscription billing 🚀
Stars: ✭ 412 (-14.52%)
Mutual labels:  flask
Bootstrap Flask
Bootstrap 4 helper for Flask/Jinja2.
Stars: ✭ 441 (-8.51%)
Mutual labels:  flask
Octblog
Yet another blog system powered by Flask and MongoDB
Stars: ✭ 421 (-12.66%)
Mutual labels:  flask
Pb
pb is a formerly-lightweight pastebin and url shortener
Stars: ✭ 448 (-7.05%)
Mutual labels:  flask
Redditmusicplayer
🎵 A free and open-source streaming music web player using data from Reddit
Stars: ✭ 401 (-16.8%)
Mutual labels:  reddit
Invenio
Invenio digital library framework
Stars: ✭ 469 (-2.7%)
Mutual labels:  flask
Subredditsimulator
An automated subreddit with posts created using markov chains
Stars: ✭ 456 (-5.39%)
Mutual labels:  reddit
Maple Bbs
a forums system based on flask
Stars: ✭ 441 (-8.51%)
Mutual labels:  flask
Qqzonemood
QQZone mood spider and analysis. QQ空间多线程爬虫和数据挖掘。提供线上服务,扫码登陆即可自动爬取和分析数据,还有网易云年度报告风格的数据展示;使用docker-compose打包程序,方便部署;额外提供QQ空间抽奖小程序。
Stars: ✭ 439 (-8.92%)
Mutual labels:  flask
Flask Restful Example
flask后端开发接口示例,利用Flask开发后端API接口。包含基本的项目配置、统一响应、MySQL和Redis数据库操作、定时任务、图片生成、项目部署、用户权限认证、报表输出、无限层级生成目录树、阿里云手机验证码验证、微信授权、Celery、单元测试、Drone等模块。
Stars: ✭ 429 (-11%)
Mutual labels:  flask
Flask Socketio
Socket.IO integration for Flask applications.
Stars: ✭ 4,523 (+838.38%)
Mutual labels:  flask
Baseplate.py
reddit's python service framework
Stars: ✭ 416 (-13.69%)
Mutual labels:  reddit
Flask Vue Crud
Single Page App with Flask and Vue.js
Stars: ✭ 467 (-3.11%)
Mutual labels:  flask
Opendata.cern.ch
Source code for the CERN Open Data portal
Stars: ✭ 411 (-14.73%)
Mutual labels:  flask
Sis
Simple image search engine
Stars: ✭ 438 (-9.13%)
Mutual labels:  flask
Mini Shop Server
基于 Flask 框架开发的微信小程序后端项目,用于构建小程序商城后台 (电商相关;rbac权限管理;附带自动生成Swagger 风格的API 文档;可作「Python 项目毕设」;慕课网系列)---- 相关博客链接:🌟
Stars: ✭ 446 (-7.47%)
Mutual labels:  flask
Beibq
基于flask开发类似gitbook的知识管理网站。 http://demo.beibq.cn
Stars: ✭ 480 (-0.41%)
Mutual labels:  flask
Flask Restplus Boilerplate
A boilerplate for flask restful web service
Stars: ✭ 466 (-3.32%)
Mutual labels:  flask

flask_reddit

flask_reddit is an extendable + minimalist Reddit clone.

This was built so beginners who want a standard CRUD + reddit-like application can quickly get to work.

We utilize:

  • flask as the web framework.
  • nginx as the HTTP server
  • gunicon as the wsgi server.
  • MySQL for our database
  • flask-sqlalchemy as our ORM.
  • bootstrap-journal theme makes us beautiful.
  • virtualenv emcompasses everything.
  • supervisord makes sure our service never crashes.

And thats pretty much it!

All of the configutations are in this repository. Deployment instructions will be out soon.

Features

  • threaded comments
  • up voting
  • subreddits
  • user karma
  • search
  • rate limiting
  • ajax form posting
  • user profiles

Build Instructions

  • Set up an instance of MySQL on your server. Note your username and password.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server libmysqlclient-dev
  • Set up an instance of nginx on your server. I've provided the .conf scripts needed for our servers in the /server directory.

sudo apt-get install nginx

  • Configure your nginx settings located in flask_reddit/server/nginx.conf.

  • Add your settings into your global conf file located in /etc/nginx/nginx.conf

  • Restart nginx to recognize your settings sudo service nginx restart

  • Set up supervisord to monitor your project to make sure it never crashes. Supervisor is also convenient for simply restarting/starting your project with ease.

sudo apt-get install supervisor

  • When Supervisor is installed you can give it programs to start and watch by creating config files in the /etc/supervisor/conf.d directory. I've provided the conf file which we use in the root directory of this repo as supervisor.conf. An example supervisor command would be running supervisorctl restart YOUR_APP_NAME to restart gunicorn and bring up new changes.

  • Install virtualenv and set up a project root where ever you want.

sudo apt-get install python-virtualenv;
cd /path/to/project;
virtualenv reddit-env;
cd reddit-env;
source bin/activate; # viola, you are now in an enclosed python workspace.
  • Download the repository and install all of the required python modules which this server uses.
git clone https://github.com/codelucas/flask_reddit.git;
cd flask_reddit;
pip install -r requirements.txt
  • Due to sensitive configuration information, I have hidden my personal config.py file in the gitignore. But, I have provided a clean and easy to use config template in this repo named app_config.py.

  • Fill out the flask_reddit/app_config.py file with your own information and then rename it to config.py so flask recognizes it by using mv app_config.py config.py. Please be sure to fill out the mysql db settings similarly to how you set it up!, username, pass, etc

  • Run the kickstart.py script to build the first user and subreddits.

python2.7 kickstart.py

  • flask_reddit has tasks which must occur on regular time intervals. To make this happen, we use the crontab, which is present on UNIX systems.

A crontab is a dash which allows you to specify what programs to run and how often. I've provided flask_reddit's example crontab in the root directory as jobs.cron.

To view your current crontab, run crontab -l. To edit your crontab, run crontab -e.

  • Paste the contents of jobs.cron into your crontab by running crontab -e and pasting! More directions are present in the jobs.cron file.

  • Run the gunicorn server. You won't have to do this ever again if supervisor is set up properly.

sudo sh run_gunicorn.sh

Note that we have now deployed two servers: nginx and gunicorn. nginx is our internet facing HTTP server on port 80 while gunicorn is our wsgi server which is serving up our flask python application locally. nginx reads client requests and decides which requests to foreward to our gunicorn server. For example, nginx serves static content like images very well but it forwards url routes to the homepage to gunicorn.

For a full list of details, view our configs at server/nginx.conf and server/gunicorn_config.py.

Note, for this build to work there are paths that you must change in the wsgi.py file, the server configs located in server directory and the run_gunicorn.sh file.

Refer to the flask project configuration options to understand what to put in your own config.py file.

Do not hesiate to contact me for help or concerns.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].