-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from vitorfs/upgrade-django3
Release v2.0
- Loading branch information
Showing
368 changed files
with
6,109 additions
and
4,475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,107 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
lib | ||
lib64 | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.tox | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
.DS_Store | ||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
reminder.md | ||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
*.sqlite3 | ||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
*.bib | ||
maildumps | ||
.idea | ||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
.idea/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
install: "pip install -r requirements.txt" | ||
- "3.9" | ||
install: "pip install -r requirements/tests.txt" | ||
before_script: | ||
- cp .env.example .env | ||
- python manage.py migrate | ||
script: | ||
- python manage.py test --settings=parsifal.test_settings | ||
sudo: false | ||
- python manage.py test --settings=parsifal.settings.tests | ||
sudo: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build: | ||
isort parsifal | ||
black parsifal | ||
flake8 parsifal | ||
./manage.py makemigrations --check --dry-run --settings=parsifal.settings.tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
NAME="parsifal" | ||
DIR=/home/parsifal/parsifal | ||
USER=parsifal | ||
GROUP=parsifal | ||
WORKERS=3 | ||
BIND=unix:/home/parsifal/run/gunicorn.sock | ||
DJANGO_SETTINGS_MODULE=parsifal.settings.production | ||
DJANGO_WSGI_MODULE=parsifal.wsgi | ||
LOG_LEVEL=info | ||
|
||
source /home/parsifal/venv/bin/activate | ||
|
||
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE | ||
export PYTHONPATH=$DIR:$PYTHONPATH | ||
|
||
exec /home/parsifal/venv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \ | ||
--name $NAME \ | ||
--workers $WORKERS \ | ||
--user=$USER \ | ||
--group=$GROUP \ | ||
--bind=$BIND \ | ||
--log-level=$LOG_LEVEL \ | ||
--log-file=- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
upstream app_server { | ||
server unix:/home/parsifal/run/gunicorn.sock fail_timeout=0; | ||
} | ||
|
||
server { | ||
server_name www.parsif.al parsif.al; | ||
listen 80; | ||
return 301 https://parsif.al$request_uri; | ||
} | ||
|
||
server { | ||
server_name www.parsif.al; | ||
listen 443; | ||
return 301 https://parsif.al$request_uri; | ||
} | ||
|
||
server { | ||
server_name parsif.al; | ||
listen 443; | ||
|
||
keepalive_timeout 5; | ||
client_max_body_size 64M; | ||
|
||
access_log /home/parsifal/logs/nginx-access.log; | ||
error_log /home/parsifal/logs/nginx-error.log; | ||
|
||
gzip on; | ||
gzip_types text/plain text/css application/x-javascript image/svg+xml; | ||
gzip_comp_level 1; | ||
gzip_disable msie6; | ||
gzip_http_version 1.0; | ||
gzip_proxied any; | ||
gzip_vary on; | ||
|
||
location = /favicon.ico { | ||
alias /home/parsifal/static/img/favicon.ico; | ||
} | ||
|
||
location /static/ { | ||
access_log off; | ||
expires 3600; | ||
alias /home/parsifal/static/; | ||
} | ||
|
||
location /media/ { | ||
access_log off; | ||
expires 3600; | ||
alias /home/parsifal/media/; | ||
} | ||
|
||
location / { | ||
try_files $uri @proxy_to_app; | ||
} | ||
|
||
location @proxy_to_app { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_redirect off; | ||
proxy_pass http://app_server; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[program:parsifal] | ||
command=/home/parsifal/parsifal/bin/gunicorn_start | ||
user=parsifal | ||
autostart=true | ||
autorestart=true | ||
redirect_stderr=true | ||
stdout_logfile=/home/parsifal/logs/gunicorn.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
#!/usr/bin/env python | ||
"""Django's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "parsifal.settings") | ||
|
||
from django.core.management import execute_from_command_line | ||
|
||
def main(): | ||
"""Run administrative tasks.""" | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'parsifal.settings.local') | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.