diff --git a/bestoon/settings.py.sample b/bestoon/settings.py.sample index 84197fe..8cbccaf 100644 --- a/bestoon/settings.py.sample +++ b/bestoon/settings.py.sample @@ -120,9 +120,18 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ +PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) +STATIC_ROOT = os.path.join(PROJECT_DIR, 'web/static') STATIC_URL = '/static/' +RECAPTCHA_PRIVATE_KEY = 'your private key' +RECAPTCHA_PUBLIC_KEY = 'your public key' +RECAPTCHA_DEFAULT_ACTION = 'generic' +RECAPTCHA_SCORE_THRESHOLD = 0.5 -RECAPTCHA_SECRET_KEY = '' -POSTMARK_API_TOKEN='' +EMAIL_HOST = '' +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' diff --git a/fandogh.yml b/fandogh.yml new file mode 100644 index 0000000..8482f7b --- /dev/null +++ b/fandogh.yml @@ -0,0 +1,17 @@ +kind: ExternalService +name: bestoon +spec: + image_pull_policy: Always + port: 80 + source: + context: . + media_path: '' + project_type: django + python_version: '3.7' + static_path: static + wsgi: bestoon.wsgi + volume_mounts: + - mount_path: /usr/src/app/bestoon/web/static/ + sub_path: static + domains: + - name: rayakade.ir diff --git a/requirements.txt b/requirements.txt index 7915b5d..70aac0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Django>=1.11.27 -python-postmark==0.4.10 requests==2.20.0 django-cors-middleware +django-recaptcha3 diff --git a/web/models.py b/web/models.py index 14ed45c..659c3ba 100644 --- a/web/models.py +++ b/web/models.py @@ -32,7 +32,7 @@ class Expense(models.Model): text = models.CharField(max_length=255) date = models.DateTimeField() amount = models.BigIntegerField() - user = models.ForeignKey(User) + user = models.ForeignKey(User, on_delete=models.CASCADE) def __unicode__(self): return "{}-{}-{}".format(self.date, self.user, self.amount) @@ -42,7 +42,7 @@ class Income(models.Model): text = models.CharField(max_length=255) date = models.DateTimeField() amount = models.BigIntegerField() - user = models.ForeignKey(User) + user = models.ForeignKey(User, on_delete=models.CASCADE) def __unicode__(self): return "{}-{}-{}".format(self.date, self.user, self.amount) diff --git a/web/static/css/style.css b/web/static/css/style.css index 50cbc19..f8544ad 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -1,5 +1,5 @@ @import url(http://fonts.googleapis.com/earlyaccess/droidarabicnaskh.css); -@import url('https://fontup.ir/css?fonts=Samim:400'); +/*@import url('https://fontup.ir/css?fonts=Samim:400');*/ @import url(http://weloveiconfonts.com/api/?family=fontawesome); [class*="fontawesome-"]:before { diff --git a/web/templates/index.html b/web/templates/index.html index 8bb8b32..bb31661 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -1,5 +1,5 @@ {% extends "template.html"%} -{% load staticfiles %} +{% load static %} {% block content %} diff --git a/web/templates/login.html b/web/templates/login.html index 3b3af47..577f18d 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -1,5 +1,5 @@ {% extends "template.html"%} -{% load staticfiles %} +{% load static %} {% block content %}