You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,7 +14,7 @@ Check link stats by adding **+** to the URL. Example [pygy.co/pygmy+](https://py
14
14
-[Table of Contents](#table-of-contents)
15
15
-[Features](#features)
16
16
-[Technical Info](#technical-info)
17
-
-[Installaton/Setup](#installatonsetup)
17
+
-[Installation/Setup](#installationsetup)
18
18
-[DB Setup:](#db-setup)
19
19
-[Use MySQL](#use-mysql)
20
20
-[Use Postgresql](#use-postgresql)
@@ -39,8 +39,7 @@ The architecture is very loosely coupled which allows custom integrations easily
39
39
- A REST API on top. Uses Flask framework
40
40
- The UI layer for rendering the UI. It uses Django framework
41
41
42
-
Features
43
-
========
42
+
## Features
44
43
45
44
- URL shortner
46
45
- Customized short URL's(ex: `pygy.co/pygmy`)
@@ -50,47 +49,48 @@ Features
50
49
- User dashboard
51
50
- Link Analytics(add + to the tiny URL to get link stats)
52
51
53
-
Technical Info
54
-
==============
52
+
## Technical Info
55
53
56
54
- Python 3, Javascript, JQuery, HTML, CSS
57
55
- REST API: Flask
58
56
- Pygmyui: Django(It serves the web user interface)
59
57
- DB: PostgreSQL/MySQL/SQLite
60
58
- Others: SQLAlchmey, JWT
59
+
- Docker
60
+
61
+
## Installation/Setup
61
62
62
-
Installation/Setup
63
-
=================
63
+
### Docker
64
64
65
-
NOTE: **This module only supports Python 3. Make sure pip and virtualenv are both python 3 based versions.**
66
-
**To install Python 3 on Mac: http://docs.python-guide.org/en/latest/starting/install3/osx/**
65
+
1.`docker run -it -p 8000:8000 amit19/pygmy`
66
+
2. Open http://localhost:8000 in your browser
67
+
68
+
### Manual(from source)
67
69
68
70
1. Clone `git clone https://github.com/amitt001/pygmy.git & cd pygmy`
69
71
2. (Optional) Install virtualenv (optional but recommended)
70
72
-`virtualenv -p python3 env`
71
73
-`source env/bin/activate`
72
74
3. Install dependencies: `pip3 install -r requirements.txt` (if you are using MySQL or PostgreSQL check [DB setup](#db-setup) section)
73
-
4.`cd src`
74
-
5.`python run.py` (It runs Flask and Django servers using gunicorn)
75
-
6. Visit `127.0.0.1:8000` to use the app
76
-
7. Logs can be viewed at `pygmy/data/pygmy.log`
75
+
4.`python run.py` (It runs Flask and Django servers using gunicorn)
76
+
5. Visit `127.0.0.1:8000` to use the app
77
+
6. Logs can be viewed at `pygmy/data/pygmy.log`
77
78
78
79
Note:
79
80
80
-
1. The project has two config files:
81
+
-**This module only supports Python 3. Make sure pip and virtualenv are both python 3 based versions.**(To install Python 3 on Mac: http://docs.python-guide.org/en/latest/starting/install3/osx/)
82
+
- The project has two config files:
81
83
- pygmy.cfg: `pygmy/config/pygmy.cfg` rest API and pygmy core settings file
Open shell using ./shell. Available context is pygmy, Config, DB, etc. See all context by using pygmy_context.
156
154
@@ -224,18 +222,15 @@ Docstring:
224
222
URL value.
225
223
```
226
224
227
-
How Link Stats Are Generated?
228
-
=============================
225
+
###### How Link Stats Are Generated?
229
226
230
227
For getting geo location stats from IP maxminds' [GeoLite2-Country.mmd](http://pygy.co/cm) database is used. It's in `pygmy/app` directory.
231
228
232
-
How Pygmy Auth Token Works?
233
-
===========================
229
+
###### How Pygmy Auth Token Works?
234
230
235
231
It uses JWT. When user logs in using username and password two tokens are generated, refresh token and auth token. Auth token is used for authentication with the Pygmy API. Refresh token can only be used to generate new auth token. Auth token has a very short TTL but refresh token has a longer TTL. After 30 minutes. When a request comes with the old auht token and a new token is generated from the refresh token API. User passwords are encrypted by [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) hash algorithm.
236
232
237
-
Development
238
-
===========
233
+
## Development
239
234
240
235
If you find any bug, have a question or a general feature request. Open an issue on the 'Issue' page.
241
236
@@ -247,20 +242,17 @@ See coverage report(Coverage is bad because the coverage for integration tests i
247
242
248
243
`coverage report`
249
244
250
-
Contributions
251
-
=============
245
+
## Contributions
252
246
253
247
Thanks [batarian71](https://github.com/batarian71) for providing the logo icon.
254
248
255
-
Sponsorship
256
-
===========
249
+
## Sponsorship
257
250
258
251
I would like to thank DigitalOcean for providing initial hosting to Pygmy project. Pygy.co is hosted on DigitalOcean.
0 commit comments