{"id":13892930,"url":"https://github.com/codelucas/flask_reddit","last_synced_at":"2025-04-05T19:11:39.788Z","repository":{"id":12921004,"uuid":"15598526","full_name":"codelucas/flask_reddit","owner":"codelucas","description":"Reddit clone in flask + python + nginx + https. View site:","archived":false,"fork":false,"pushed_at":"2018-02-20T09:06:18.000Z","size":339,"stargazers_count":534,"open_issues_count":5,"forks_count":107,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-29T18:06:38.490Z","etag":null,"topics":["flask","flask-python","flask-reddit","python","reddit"],"latest_commit_sha":null,"homepage":"https://reddit.codelucas.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codelucas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-03T01:45:09.000Z","updated_at":"2025-03-23T08:58:42.000Z","dependencies_parsed_at":"2022-09-01T11:23:11.449Z","dependency_job_id":null,"html_url":"https://github.com/codelucas/flask_reddit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelucas%2Fflask_reddit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelucas%2Fflask_reddit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelucas%2Fflask_reddit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelucas%2Fflask_reddit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codelucas","download_url":"https://codeload.github.com/codelucas/flask_reddit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386263,"owners_count":20930619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-python","flask-reddit","python","reddit"],"created_at":"2024-08-06T17:01:19.786Z","updated_at":"2025-04-05T19:11:39.768Z","avatar_url":"https://github.com/codelucas.png","language":"Python","readme":"flask\\_reddit\n=============\n\n**flask_reddit** is an extendable + minimalist [Reddit](http://reddit.com) clone.\n\nThis was built so beginners who want a standard CRUD + reddit-like application\ncan quickly get to work.\n\nWe utilize: \n- `flask` as the web framework.\n- `nginx` as the HTTP server  \n- `gunicon` as the wsgi server.\n- `MySQL` for our database \n- `flask-sqlalchemy` as our ORM.\n- `bootstrap-journal` theme makes us beautiful.\n- `virtualenv` emcompasses everything. \n- `supervisord` makes sure our service never crashes.\n\nAnd thats pretty much it!\n\nAll of the configutations are in this repository. Deployment instructions \nwill be out soon.\n\nFeatures\n--------\n- threaded comments\n- up voting\n- subreddits\n- user karma\n- search\n- rate limiting\n- ajax form posting\n- user profiles\n\nBuild Instructions\n------------------\n\n- Set up an instance of MySQL on your server. Note your username and password.\n\n```\nsudo apt-get update\nsudo apt-get upgrade\nsudo apt-get install mysql-server libmysqlclient-dev\n```\n\n- Set up an instance of nginx on your server. *I've provided the .conf scripts needed for our\nservers in the `/server` directory.*\n\n`sudo apt-get install nginx`\n\n- Configure your nginx settings located in `flask_reddit/server/nginx.conf`.\n\n- Add your settings into your global conf file located in `/etc/nginx/nginx.conf`\n\n- Restart nginx to recognize your settings `sudo service nginx restart`\n\n- Set up supervisord to monitor your project to make sure it never crashes.\nSupervisor is also convenient for simply restarting/starting your project with ease.\n\n`sudo apt-get install supervisor`\n\n- When Supervisor is installed you can give it programs to start and watch by creating config \nfiles in the `/etc/supervisor/conf.d` directory. I've provided the conf file which we use\nin the root directory of this repo as `supervisor.conf`. An example supervisor command \nwould be running `supervisorctl restart YOUR_APP_NAME` to restart gunicorn and bring up new changes.\n\n- Install [virtualenv](http://www.virtualenv.org/en/latest/virtualenv.html) and set up a project \nroot where ever you want.\n\n```bash\nsudo apt-get install python-virtualenv;\ncd /path/to/project;\nvirtualenv reddit-env;\ncd reddit-env;\nsource bin/activate; # viola, you are now in an enclosed python workspace.\n```\n\n- Download the repository and  install all of the required python modules \nwhich this server uses.\n\n```bash\ngit clone https://github.com/codelucas/flask_reddit.git;\ncd flask_reddit;\npip install -r requirements.txt\n```\n\n- Due to sensitive configuration information, I have hidden my personal\n`config.py` file in the gitignore. But, I have provided a clean and easy\nto use config template in this repo named `app_config.py`. \n\n- **Fill out the `flask_reddit/app_config.py` file with your own information and then rename it to\n`config.py` so flask recognizes it by using `mv app_config.py config.py`.**\nPlease be sure to fill out the mysql db settings similarly to how you set it up!, \nusername, pass, etc\n\n- Run the `kickstart.py` script to build the first user and subreddits.\n\n`python2.7 kickstart.py`\n\n- flask_reddit has tasks which must **occur on regular time intervals**. To make this\nhappen, we use the `crontab`, which is present on UNIX systems.\n\nA crontab is a dash which allows you to specify what programs to run and how often.\nI've provided flask_reddit's example crontab in the root directory as `jobs.cron`.\n\nTo view your current crontab, run `crontab -l`. To edit your crontab, run `crontab -e`.\n\n- Paste the contents of `jobs.cron` into your crontab by running `crontab -e` and \npasting! More directions are present in the `jobs.cron` file.\n\n- Run the gunicorn server. You won't have to do this ever again if `supervisor` is set up\nproperly.\n\n`sudo sh run_gunicorn.sh`\n\n**Note that we have now deployed two servers: `nginx` and `gunicorn`. `nginx` is our\n*internet facing* HTTP server on port 80 while `gunicorn` is our *wsgi server* which \nis serving up our flask python application locally. `nginx` reads client\nrequests and *decides* which requests to foreward to our `gunicorn` server. For example,\n`nginx` serves static content like images very well but it forwards url routes \nto the homepage to gunicorn.**\n\nFor a full list of details, view our configs at `server/nginx.conf` and \n`server/gunicorn_config.py`.\n\n*Note, for this build to work there are paths that you must change in the `wsgi.py` file, \nthe server configs located in `server` directory and the `run_gunicorn.sh` file.*\n\n*Refer to the flask project configuration options to understand what to put in your own\nconfig.py file.*\n\nDo not hesiate to \u003ca href=\"http://codelucas.com\"\u003econtact\u003c/a\u003e me \u003cLucas Ou\u003e for help or concerns.\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelucas%2Fflask_reddit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelucas%2Fflask_reddit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelucas%2Fflask_reddit/lists"}