home » zplus/freepost.git
Author zPlus <zplus@peers.community> 2018-07-06 11:01:49
Committer zPlus <zplus@peers.community> 2018-07-06 11:01:49
Commit c54c323 (patch)
Tree e228b6a
Parent(s)

Add basic app sructure.


commits diff: d6fde08..c54c323
6 files changed, 64 insertions, 10 deletionsdownload


Diffstat
-rwxr-xr-x .gitignore 4
-rwxr-xr-x README.md 36
-rw-r--r-- freepost/__init__.py 22
-rw-r--r-- passenger_wsgi.py 4
-rw-r--r-- requirements.txt 4
-rw-r--r-- settings.ini 4

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+2/-2 M   .gitignore
index 30084ba..541ca10
old size: 39B - new size: 34B
@@ -1,3 +1,3 @@
1 + __pycache__
1 2 cache/template/*
2 - *.production
3 - css/*.css
3 > \ No newline at end of file
3 + venv

+28/-8 M   README.md
index 28b32c2..82f84bd
old size: 1K - new size: 1K
@@ -1,23 +1,43 @@
1 1 # FreePost
2 2
3 - This is the code powering [freepost](http://freepo.st). FreePost is a web-based discussion board that allows users to post text and links which other users may read and comment on (start a discussion). It also supports upvoting and downvoting of posts and has some nifty features to display the so-called **Hot** posts (those that are very popular and have been upvoted a lot) as well as the newest posts, aptly named **New**. Each user has a profile page which includes some information on themselves.
3 + This is the code powering [freepost](http://freepo.st). FreePost is a web-based
4 + discussion board that allows users to post text and links which other users may
5 + read and comment on (start a discussion). It also supports upvoting and downvoting
6 + of posts and has some nifty features to display the so-called **Hot** posts (those
7 + that are very popular and have been upvoted a lot) as well as the newest posts,
8 + aptly named **New**. Each user has a profile page which includes some information
9 + on themselves.
4 10
5 11 ## Development
6 12
7 - ### Stylesheets
13 + ### Setup Python3 virtual environment
14 +
15 + mkdir venv
16 + virtualenv -p python3 venv
17 + -> alternative: python3 -m venv venv
18 + source ./venv/bin/activate
19 + pip3 install --no-binary :all: -r requirements.txt
20 +
21 + ### Run
8 22
9 - Sources are in `css/`. They are compiled using Stylus. Run this command from the project's root:
23 + source ./venv/bin/activate
24 + python3 -m bottle --debug --reload --bind 127.0.0.1:8000 freepost
10 25
11 - `$ stylus --watch --compress --disable-cache --out css/ css/`
12 26
13 - ### Dev server
27 + ### Stylesheets
28 +
29 + Sources are in `css/`. They are compiled using Stylus. Run this command from
30 + the project's root:
14 31
15 - Copy files to Apache `www`.
32 + stylus --watch --compress --disable-cache --out css/ css/
16 33
17 34 ## Contacts
18 35
19 - If you have any questions please get in contact with us at [freepost](http://freepo.st).
36 + If you have any questions please get in contact with us at
37 + [freepost](http://freepo.st).
20 38
21 39 ## License
22 40
23 - freepost is [free software](https://www.gnu.org/philosophy/free-sw.html) licensed as GNU Affero General Public License, either version 3 or (at your option) any later version.
41 + freepost is [free software](https://www.gnu.org/philosophy/free-sw.html) licensed
42 + as GNU Affero General Public License, either version 3 or (at your option) any
43 + later version.

+22/-0 A   freepost/__init__.py
index 0000000..e1e5e22
old size: 0B - new size: 495B
new file mode: -rw-r--r--
@@ -0,0 +1,22 @@
1 + import bottle
2 + import configparser
3 + import functools
4 + import importlib
5 + import json
6 + from bottle import abort, get, post, redirect, request
7 + from urllib.parse import urlparse
8 +
9 + # This is used to export the bottle object for the WSGI server
10 + # See passenger_wsgi.py
11 + application = bottle.app ()
12 +
13 + # Load settings for this app
14 + application.config.load_config ('settings.ini')
15 +
16 + # Default app templates
17 + bottle.TEMPLATE_PATH = [ './freepost/templates' ]
18 +
19 +
20 + @get ('/', name='index')
21 + def index ():
22 + return "ll"

+4/-0 A   passenger_wsgi.py
index 0000000..fd7ef2a
old size: 0B - new size: 131B
new file mode: -rw-r--r--
@@ -0,0 +1,4 @@
1 + # This file is for the Passenger web server.
2 +
3 + # We must export a WSGI object called "application"
4 + from freepost import application

+4/-0 A   requirements.txt
index 0000000..91e0401
old size: 0B - new size: 89B
new file mode: -rw-r--r--
@@ -0,0 +1,4 @@
1 + bottle == 0.12.*
2 + pyld == 1.*
3 + PyMySQL == 0.9.*
4 + requests == 2.*

+4/-0 A   settings.ini
index 0000000..1451b85
old size: 0B - new size: 69B
new file mode: -rw-r--r--
@@ -0,0 +1,4 @@
1 + # This is a bunch of settings useful for the app
2 +
3 + [name]
4 + key = value