Skip to content

Commit

Permalink
pipfile and entry..
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanmotnt committed Apr 30, 2020
1 parent fcce77f commit 6ac39b5
Show file tree
Hide file tree
Showing 66 changed files with 363 additions and 29 deletions.
6 changes: 5 additions & 1 deletion Dockerfile.prod
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
&& pip install psycopg2 \
&& apk del build-deps
&& apk del build-deps \
&& pip install django-heroku

# install zlib for pillow
# RUN apk add --no-cache jpeg-dev zlib-dev
Expand All @@ -29,9 +30,12 @@ RUN pip install --upgrade pipenv
COPY ./entrypoint.prod.sh /usr/src/app/entrypoint.prod.sh



# copy project
COPY . /usr/src/app/
RUN pipenv install


#psycopg2 django-heroku django-import-export
# run entrypoint.prod.sh
ENTRYPOINT ["/usr/src/app/entrypoint.prod.sh"]
3 changes: 3 additions & 0 deletions Pipfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ verify_ssl = true

[packages]
django = "==3.0.5"
gunicorn = "==20.0.4"
django-import-export = "==2.0.2"
django-heroku = "==0.3.1"

[requires]
python_version = "3.7"
172 changes: 170 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified db.sqlite3
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion entrypoint.prod.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

pipenv shell
if [ "$DATABASE" = "postgres" ]
then
echo "Waiting for postgres..."
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rasta_problem_bank.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rasta_problem_bank.settings.development')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
Empty file modified mhbank/__init__.py
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/__init__.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/admin.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/apps.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/forms.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/models.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/urls.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/views.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/__pycache__/widgets.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/admin.py
100644 → 100755
Empty file.
Empty file modified mhbank/apps.py
100644 → 100755
Empty file.
Empty file modified mhbank/forms.py
100644 → 100755
Empty file.
Empty file modified mhbank/hashem.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0001_initial.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0002_auto_20200422_2131.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0003_auto_20200422_2335.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0004_auto_20200422_2356.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0005_auto_20200423_0041.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0006_auto_20200423_0101.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0007_auto_20200423_0102.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0008_auto_20200423_0106.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0009_auto_20200423_1558.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0010_auto_20200423_1640.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0011_auto_20200423_1643.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0012_auto_20200423_1644.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/0013_account_last_added_question.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/__init__.py
100644 → 100755
Empty file.
Empty file modified mhbank/migrations/__pycache__/0001_initial.cpython-37.pyc
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified mhbank/migrations/__pycache__/__init__.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified mhbank/models.py
100644 → 100755
Empty file.
Empty file modified mhbank/tests.py
100644 → 100755
Empty file.
Empty file modified mhbank/urls.py
100644 → 100755
Empty file.
Empty file modified mhbank/views.py
100644 → 100755
Empty file.
Empty file modified mhbank/widgets.py
100644 → 100755
Empty file.
Empty file modified rasta_problem_bank/__init__.py
100644 → 100755
Empty file.
Empty file modified rasta_problem_bank/__pycache__/__init__.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified rasta_problem_bank/__pycache__/settings.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified rasta_problem_bank/__pycache__/urls.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified rasta_problem_bank/__pycache__/wsgi.cpython-37.pyc
100644 → 100755
Empty file.
Empty file modified rasta_problem_bank/asgi.py
100644 → 100755
Empty file.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Django settings for rasta_problem_bank project.
Django settings for ra project.
Generated by 'django-admin startproject' using Django 3.0.5.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
Expand All @@ -12,32 +12,32 @@

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

def get_environment_var(var_name, default, prefixed=True):
if prefixed:
var_name = 'BANK_SERVER_%s' % var_name
return os.getenv(var_name, default)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '3vn$cbhyxv5r3c-iu6i9cm8yaqvz0^9kblha1wq4@0jp13hgjv'
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/


# Application definition

INSTALLED_APPS = [
'mhbank.apps.MhbankConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'import_export',
'mhbank',
]

MIDDLEWARE = [
Expand All @@ -63,6 +63,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'homepage.context_processors.site_configuration_processor',
],
},
},
Expand All @@ -71,17 +72,6 @@
WSGI_APPLICATION = 'rasta_problem_bank.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

Expand All @@ -104,7 +94,7 @@
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'fa-ir'
LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Tehran'

Expand All @@ -114,12 +104,44 @@

USE_TZ = True



# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


EMAIL_HOST = 'smtp.zoho.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'ET6vmrh.$gHZFjL'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
DEFAULT_FROM_EMAIL = "Rastaiha <" + EMAIL_HOST_USER + ">"

# Activate Django-Heroku.

OK_STATUS = 'ok'
ERROR_STATUS = 'err'
HELP_STATUS = 'help'

DJANGO_NOTIFICATIONS_CONFIG = {
'USE_JSONFIELD': True,
'SOFT_DELETE': True,
'NUM_TO_FETCH': 40,
}


THUMBNAIL_ALIASES = {
'': {
'avatar': {'size': (80, 80), 'crop': True},
},
}


STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'

Loading

0 comments on commit 6ac39b5

Please sign in to comment.