Proofreading README
This commit is contained in:
parent
2709a66007
commit
d541b66761
|
@ -16,5 +16,5 @@ media
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/django
|
# End of https://www.gitignore.io/api/django
|
||||||
/static/
|
/static/
|
||||||
/var/
|
|
||||||
.venv/
|
.venv/
|
||||||
|
*.sqlite3
|
||||||
|
|
26
README.md
26
README.md
|
@ -1,13 +1,13 @@
|
||||||
# Pasteque
|
# Paf'Pastèque
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
**Pasteque** is a free and open source (MIT License) **Pastebin like**
|
**Pasteque** is a free and open source (MIT License) **Pastebin like**
|
||||||
application written in Python/Django.
|
application written in Python/Django.
|
||||||
|
|
||||||
An instance can be found at: [wyz.fr](https://wyz.fr). The wyz.fr
|
An instance can be found at: [p.afpy.org](https://p.afpy.org). The AFPy
|
||||||
instance is installed by ansible, the role is available here:
|
instance is installed by ansible, the role is available here:
|
||||||
[https://git.afpy.org/mdk/infra/src/branch/main/roles/pasteque](https://git.afpy.org/mdk/infra/src/branch/main/roles/pasteque).
|
[https://git.afpy.org/AFPy/infra/src/branch/main/roles/pasteque](https://git.afpy.org/AFPy/infra/src/branch/main/roles/pasteque).
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
@ -15,10 +15,7 @@ instance is installed by ansible, the role is available here:
|
||||||
- Support any database supported by Django (Sqlite3, MySQL, PostgreSQL, Oracle, ...)
|
- Support any database supported by Django (Sqlite3, MySQL, PostgreSQL, Oracle, ...)
|
||||||
- Available in english, french .. and easily translatable into another languages.
|
- Available in english, french .. and easily translatable into another languages.
|
||||||
- Syntax highlighting for a bunch of languages using Pygments.
|
- Syntax highlighting for a bunch of languages using Pygments.
|
||||||
- Time-based or "page loads"-based pastes expiration.
|
- Easy paste from command line or any programming language.
|
||||||
- Password protection.
|
|
||||||
- Possibility to enable/disable renderers and to choose the default one.
|
|
||||||
- Limit pastes size.
|
|
||||||
|
|
||||||
|
|
||||||
## Running Pasteque
|
## Running Pasteque
|
||||||
|
@ -27,25 +24,18 @@ In a [venv](https://docs.python.org/3/library/venv.html), install the requiremen
|
||||||
|
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
In `settings.py` edit:
|
In a `local_settings.py` file, at the root of the repo:
|
||||||
|
|
||||||
DISPLAY_NAME = 'YourCompany-Paste'
|
DISPLAY_NAME = 'YourCompany-Paste'
|
||||||
COMPRESS_ENABLED = True
|
COMPRESS_ENABLED = True
|
||||||
|
DEBUG = False
|
||||||
SECRET_KEY = 'fill_a_secret_key_here'
|
SECRET_KEY = 'fill_a_secret_key_here'
|
||||||
ALLOWED_HOSTS = ['localhost','127.0.0.1','paste.henriet.eu']
|
ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'paste.henriet.eu']
|
||||||
|
|
||||||
Create some needed directories:
|
Create the database:
|
||||||
|
|
||||||
mkdir -p var/{logs,db}
|
|
||||||
|
|
||||||
Then create the database:
|
|
||||||
|
|
||||||
./manage.py migrate
|
./manage.py migrate
|
||||||
|
|
||||||
Insert initial data (like known languages):
|
|
||||||
|
|
||||||
./manage.py loaddata initial
|
|
||||||
|
|
||||||
If you're in production collect static files:
|
If you're in production collect static files:
|
||||||
|
|
||||||
./manage.py collectstatic
|
./manage.py collectstatic
|
||||||
|
|
|
@ -20,7 +20,7 @@ ADMINS = (("user", "user@hostname.domain"),)
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
"ENGINE": "django.db.backends.sqlite3", # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
|
"ENGINE": "django.db.backends.sqlite3", # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
|
||||||
"NAME": os.path.join(SITE_ROOT, "var", "db", "webtools.sqlite3"),
|
"NAME": os.path.join(SITE_ROOT, "webtools.sqlite3"),
|
||||||
# The following settings are not used with sqlite3:
|
# The following settings are not used with sqlite3:
|
||||||
"USER": "",
|
"USER": "",
|
||||||
"PASSWORD": "",
|
"PASSWORD": "",
|
||||||
|
@ -37,7 +37,6 @@ SITE_ID = 1
|
||||||
MANAGERS = ADMINS
|
MANAGERS = ADMINS
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
MEDIA_URL = ""
|
MEDIA_URL = ""
|
||||||
CACHE_PATH = os.path.join(SITE_ROOT, "var", "pygments-static")
|
|
||||||
COMPRESS_ROOT = os.path.join(SITE_ROOT, "static")
|
COMPRESS_ROOT = os.path.join(SITE_ROOT, "static")
|
||||||
MEDIA_ROOT = os.path.join(SITE_ROOT, "assets")
|
MEDIA_ROOT = os.path.join(SITE_ROOT, "assets")
|
||||||
STATIC_ROOT = os.path.join(SITE_ROOT, "static")
|
STATIC_ROOT = os.path.join(SITE_ROOT, "static")
|
||||||
|
@ -96,37 +95,6 @@ PASTE = {
|
||||||
"default_language": "Python",
|
"default_language": "Python",
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGING = {
|
|
||||||
"version": 1,
|
|
||||||
"disable_existing_loggers": False,
|
|
||||||
"filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}},
|
|
||||||
"handlers": {
|
|
||||||
"mail_admins": {
|
|
||||||
"level": "ERROR",
|
|
||||||
"filters": ["require_debug_false"],
|
|
||||||
"class": "django.utils.log.AdminEmailHandler",
|
|
||||||
},
|
|
||||||
"console": {
|
|
||||||
"level": "DEBUG",
|
|
||||||
"class": "logging.StreamHandler",
|
|
||||||
},
|
|
||||||
"logfile": {
|
|
||||||
"level": "DEBUG",
|
|
||||||
"class": "logging.handlers.RotatingFileHandler",
|
|
||||||
"filename": os.path.join(SITE_ROOT, "var", "logs", "error.log"),
|
|
||||||
"maxBytes": 50000,
|
|
||||||
"backupCount": 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"loggers": {
|
|
||||||
"django.request": {
|
|
||||||
"handlers": ["console", "logfile"],
|
|
||||||
"level": "ERROR",
|
|
||||||
"propagate": True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from local_settings import *
|
from local_settings import *
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
Loading…
Reference in New Issue