Skip to content

Commit eec092b

Browse files
committed
procfile updated
updated startserver heroku is shit requirement phew phew code_share v1 code_share v1:work bruh work bruh
1 parent 2f21beb commit eec092b

File tree

7 files changed

+25
-12
lines changed

7 files changed

+25
-12
lines changed

code_share/Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
worker: sh startserver.sh
1+
web: gunicorn code_share.wsgi

code_share/app_code_share/views.py

-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
def home(request):
88

99
if request.method == 'GET':
10-
print "work"
1110
return render(request, 'app_code_share/homepage.html',{})
1211

1312
if request.method == 'POST':
14-
print "post_work"
1513
code_share = request.POST.get('code_snippet')
1614
file_name = request.POST.get('file_name')
1715
hash_value = str(hash(code_share))[1:8]
@@ -28,13 +26,11 @@ def home(request):
2826
def view_by_hash(request, hash_id):
2927

3028
if request.method == 'GET':
31-
print "Asd"
3229
code_share = CodeShare.objects.get(hash_value=hash_id)
3330

3431
return render(request, 'app_code_share/homepage.html', {'code_share': code_share})
3532

3633
if request.method == 'POST':
37-
print "asdas"
3834
code_share = request.POST.get('code_snippet')
3935
file_name = request.POST.get('file_name')
4036
code_obj = CodeShare.objects.get(hash_value=hash_id)
@@ -48,13 +44,11 @@ def view_by_hash(request, hash_id):
4844
def view_by_file(request, file_name):
4945

5046
if request.method == 'GET':
51-
print "Asd"
5247
code_share = CodeShare.objects.get(file_name=file_name)
5348

5449
return render(request, 'app_code_share/homepage.html', {'code_share': code_share})
5550

5651
if request.method == 'POST':
57-
print "asdas"
5852
code_share = request.POST.get('code_snippet')
5953
file_name = request.POST.get('file_name')
6054
code_obj = CodeShare.objects.get(file_name=file_name)

code_share/code_share/settings.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
44
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
55

6+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
67

78
# Quick-start development settings - unsuitable for production
89
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
@@ -13,7 +14,7 @@
1314
# SECURITY WARNING: don't run with debug turned on in production!
1415
DEBUG = True
1516

16-
ALLOWED_HOSTS = []
17+
ALLOWED_HOSTS = ['*']
1718

1819

1920
# Application definition
@@ -113,4 +114,18 @@
113114
STATIC_PATH,
114115
)
115116

116-
STATIC_URL = '/static/'
117+
STATIC_URL = '/static/'
118+
119+
import dj_database_url
120+
DATABASES['default'] = dj_database_url.config()
121+
122+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
123+
124+
ALLOWED_HOSTS = ['*']
125+
126+
DEBUG = False
127+
128+
try:
129+
from .local_settings import *
130+
except ImportError:
131+
pass

code_share/code_share/wsgi.py

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "code_share.settings")
1515

1616
application = get_wsgi_application()
17+
18+
from whitenoise.django import DjangoWhiteNoise
19+
application = DjangoWhiteNoise(application)

code_share/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
appdirs==1.4.2
2+
dj-database-url==0.4.2
23
Django==1.10.6
4+
gunicorn==19.7.0
35
packaging==16.8
46
pyparsing==2.1.10
57
six==1.10.0
8+
whitenoise==3.3.0

code_share/runtime.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.5.2

code_share/startserver.sh

-3
This file was deleted.

0 commit comments

Comments
 (0)