Skip to content

Commit fc3e734

Browse files
authored
Merge pull request #60 from vitorfs/upgrade-django3
Release v2.0
2 parents ec84153 + 07c98bd commit fc3e734

File tree

368 files changed

+6109
-4475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+6109
-4475
lines changed

.gitignore

Lines changed: 84 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,107 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
13
*.py[cod]
4+
*$py.class
25

36
# C extensions
47
*.so
58

6-
# Packages
7-
*.egg
8-
*.egg-info
9-
dist
10-
build
11-
eggs
12-
parts
13-
bin
14-
var
15-
sdist
16-
develop-eggs
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
1724
.installed.cfg
18-
lib
19-
lib64
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
2033

2134
# Installer logs
2235
pip-log.txt
36+
pip-delete-this-directory.txt
2337

2438
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
2541
.coverage
26-
.tox
42+
.coverage.*
43+
.cache
2744
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
2849

2950
# Translations
3051
*.mo
52+
*.pot
3153

32-
# Mr Developer
33-
.mr.developer.cfg
34-
.project
35-
.pydevproject
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
3658

37-
.DS_Store
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
3871

39-
reminder.md
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
4074

41-
*.sqlite3
75+
# pyenv
76+
.python-version
4277

78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
4385
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
4499

45-
*.bib
46-
maildumps
47-
.idea
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
106+
.idea/
107+
.DS_Store

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: python
22
python:
3-
- "2.7"
4-
install: "pip install -r requirements.txt"
3+
- "3.9"
4+
install: "pip install -r requirements/tests.txt"
55
before_script:
66
- cp .env.example .env
77
- python manage.py migrate
88
script:
9-
- python manage.py test --settings=parsifal.test_settings
10-
sudo: false
9+
- python manage.py test --settings=parsifal.settings.tests
10+
sudo: false

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build:
2+
isort parsifal
3+
black parsifal
4+
flake8 parsifal
5+
./manage.py makemigrations --check --dry-run --settings=parsifal.settings.tests

bin/gunicorn_start

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
NAME="parsifal"
4+
DIR=/home/parsifal/parsifal
5+
USER=parsifal
6+
GROUP=parsifal
7+
WORKERS=3
8+
BIND=unix:/home/parsifal/run/gunicorn.sock
9+
DJANGO_SETTINGS_MODULE=parsifal.settings.production
10+
DJANGO_WSGI_MODULE=parsifal.wsgi
11+
LOG_LEVEL=info
12+
13+
source /home/parsifal/venv/bin/activate
14+
15+
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
16+
export PYTHONPATH=$DIR:$PYTHONPATH
17+
18+
exec /home/parsifal/venv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
19+
--name $NAME \
20+
--workers $WORKERS \
21+
--user=$USER \
22+
--group=$GROUP \
23+
--bind=$BIND \
24+
--log-level=$LOG_LEVEL \
25+
--log-file=-

etc/nginx.conf

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
upstream app_server {
2+
server unix:/home/parsifal/run/gunicorn.sock fail_timeout=0;
3+
}
4+
5+
server {
6+
server_name www.parsif.al parsif.al;
7+
listen 80;
8+
return 301 https://parsif.al$request_uri;
9+
}
10+
11+
server {
12+
server_name www.parsif.al;
13+
listen 443;
14+
return 301 https://parsif.al$request_uri;
15+
}
16+
17+
server {
18+
server_name parsif.al;
19+
listen 443;
20+
21+
keepalive_timeout 5;
22+
client_max_body_size 64M;
23+
24+
access_log /home/parsifal/logs/nginx-access.log;
25+
error_log /home/parsifal/logs/nginx-error.log;
26+
27+
gzip on;
28+
gzip_types text/plain text/css application/x-javascript image/svg+xml;
29+
gzip_comp_level 1;
30+
gzip_disable msie6;
31+
gzip_http_version 1.0;
32+
gzip_proxied any;
33+
gzip_vary on;
34+
35+
location = /favicon.ico {
36+
alias /home/parsifal/static/img/favicon.ico;
37+
}
38+
39+
location /static/ {
40+
access_log off;
41+
expires 3600;
42+
alias /home/parsifal/static/;
43+
}
44+
45+
location /media/ {
46+
access_log off;
47+
expires 3600;
48+
alias /home/parsifal/media/;
49+
}
50+
51+
location / {
52+
try_files $uri @proxy_to_app;
53+
}
54+
55+
location @proxy_to_app {
56+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
57+
proxy_set_header Host $http_host;
58+
proxy_set_header X-Real-IP $remote_addr;
59+
proxy_set_header X-Forwarded-Proto $scheme;
60+
proxy_redirect off;
61+
proxy_pass http://app_server;
62+
}
63+
64+
}

etc/supervisord

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[program:parsifal]
2+
command=/home/parsifal/parsifal/bin/gunicorn_start
3+
user=parsifal
4+
autostart=true
5+
autorestart=true
6+
redirect_stderr=true
7+
stdout_logfile=/home/parsifal/logs/gunicorn.log

manage.py

100644100755
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
23
import os
34
import sys
45

5-
if __name__ == "__main__":
6-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "parsifal.settings")
7-
8-
from django.core.management import execute_from_command_line
96

7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'parsifal.settings.local')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
1018
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

parsifal/account_settings/forms.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

parsifal/account_settings/models.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)