Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
venv
.envrc
*.pyc
staticfiles
.DS_Store
.idea/
__pycache__/
db.sqlite3
fm_images/
staticfiles
vendor_images/
status_images/
.envrc
profile_images/

scraper/mi_images/

scraper/gvl_mainst_vendors\.csv

*.csv

scraper/test\.py
\.vscode/

\.vscode/
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: gunicorn fm_proj.wsgi --log-file - --workers=2
web: gunicorn fm_proj.wsgi --log-file - --workers=1
Binary file added fm_images/Davis.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/Davis_U844J2W.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/Davis_rErxtqp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/MothersDay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/MothersDay_e8DzOge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/MothersDay_hsP6Fzt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/TRFM-banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/TRFM-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/TRFM-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/TRFM-logo_3MooI5J.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/TRFM-logo_61MJLz8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/The_Crains_Merry_Christmas_2016.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/aiken_b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/aiken_p.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/banner-imgTEMP.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/buckwalter_b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/buckwalter_p.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/charleston_b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/charleston_p.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/chillwagon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/chillwagon_893ov40.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/chillwagon_cASqc0o.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/fm_awesome.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/jasper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/jasper_b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fm_images/monk_b.JPG
Binary file added fm_images/monk_p.png
Binary file added fm_images/portroyal.jpg
Binary file added fm_images/portroyal_p.jpg
Binary file added fm_images/site-logo.gif
Binary file added fm_images/site-logo_2dyKOCV.gif
Binary file added fm_images/td-mrkt.png
Binary file added fm_images/td_banner.jpeg
Binary file added fm_images/uptown_p.png
67 changes: 54 additions & 13 deletions fm_proj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,55 @@
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '%q=x!-%^j&_=^u=wc4cv=cpaa^)3u^&i*vgl&k2%)^bx=o)1by'
SECRET_KEY = os.environ.get('secret_key')

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

ALLOWED_HOSTS = []
if os.environ.get('debug') == 'True':
DEBUG = True
else:
DEBUG = False

ALLOWED_HOSTS = [
'fm-review-stage.herokuapp.com',
'fathen.co',
'www.fathen.co',
'127.0.0.1',
'127.0.0.1:8000',
'fathen.dhcrain.com'
]

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': ('%(asctime)s [%(process)d] [%(levelname)s] ' +
'pathname=%(pathname)s lineno=%(lineno)s ' +
'funcname=%(funcName)s %(message)s'),
'datefmt': '%Y-%m-%d %H:%M:%S'
},
'simple': {
'format': '%(levelname)s %(message)s'
}
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'logging.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'testlogger': {
'handlers': ['console'],
'level': 'INFO',
}
}
}

# Application definition

Expand Down Expand Up @@ -57,6 +99,7 @@
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'fm_proj.urls'
Expand Down Expand Up @@ -155,21 +198,18 @@
'Cache-Control': 'max-age=94608000',
}

aws_bucket_name = os.environ.get('aws_bucket_name')
aws_access_key_id = os.environ['aws_access_key_id']
aws_secret_access_key = os.environ['aws_secret_access_key']

AWS_STORAGE_BUCKET_NAME = aws_bucket_name
AWS_ACCESS_KEY_ID = aws_access_key_id
AWS_SECRET_ACCESS_KEY = aws_secret_access_key
# AWS_STORAGE_BUCKET_NAME = os.environ.get('aws_bucket_name')
AWS_STORAGE_BUCKET_NAME = os.environ.get('NOTHING_HERE')
AWS_ACCESS_KEY_ID = os.environ['aws_access_key_id']
AWS_SECRET_ACCESS_KEY = os.environ['aws_secret_access_key']

# Tell django-storages that when coming up with the URL for an item in S3 storage, keep
# it simple - just use this domain plus the path. (If this isn't set, things get complicated).
# This controls how the `static` template tag from `staticfiles` gets expanded, if you're using it.
# We also use it in the next setting.
AWS_S3_CUSTOM_DOMAIN = '{}.s3.amazonaws.com'.format(aws_bucket_name)
AWS_S3_CUSTOM_DOMAIN = '{}.s3.amazonaws.com'.format(AWS_STORAGE_BUCKET_NAME)

if aws_bucket_name:
if AWS_STORAGE_BUCKET_NAME:
# This is used by the `static` template tag from `static`, if you're using that. Or if anything else
# refers directly to STATIC_URL. So it's safest to always set it.
# STATIC_URL = 'https://{}/'.format(AWS_S3_CUSTOM_DOMAIN)
Expand All @@ -185,6 +225,7 @@

STATICFILES_LOCATION = 'static'


# For django-review
# this would use a RadioSelect instead of the default Select
REVIEW_FORM_CHOICE_WIDGET = 'django.forms.widgets.RadioSelect'
Expand Down
File renamed without changes.
Binary file added profile_images/Davis.jpg
Binary file added profile_images/IMG_2072.JPG
Binary file added profile_images/dhcrain-headshot-sm.jpg
Binary file added profile_images/profile_mug.jpeg
4 changes: 3 additions & 1 deletion review_app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ class Meta:

class ContactForm(forms.Form):
required_css_class = 'required'
captcha = ReCaptchaField()
name = forms.CharField(required=True)
email = forms.EmailField(required=True)
subject = forms.CharField(required=True)
message = forms.CharField(widget=forms.Textarea)
captcha = ReCaptchaField()


# https://djangosnippets.org/snippets/3043/
class UserCreationEmailForm(UserCreationForm):
required_css_class = 'required'
captcha = ReCaptchaField()
# we are using email as username so override label and validators
username = forms.CharField(
label="Email:",
Expand Down
77 changes: 77 additions & 0 deletions review_app/migrations/0012_auto_20170907_2154.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-09-07 21:54
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import localflavor.us.models


class Migration(migrations.Migration):

dependencies = [
('review_app', '0011_auto_20160731_1737'),
]

operations = [
migrations.AlterField(
model_name='profile',
name='profile_fm_like',
field=models.ManyToManyField(blank=True, related_name='fm_likes', to='review_app.FarmersMarket'),
),
migrations.AlterField(
model_name='profile',
name='profile_vendor_like',
field=models.ManyToManyField(blank=True, related_name='vendor_likes', to='review_app.Vendor'),
),
migrations.AlterField(
model_name='vendor',
name='at_farmers_market',
field=models.ManyToManyField(to='review_app.FarmersMarket', verbose_name='Located here'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_banner_picture',
field=models.ImageField(blank=True, upload_to='vendor_images', verbose_name='Banner Picture'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_contact_email',
field=models.EmailField(max_length=254, verbose_name='Email'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_contact_name',
field=models.CharField(max_length=50, verbose_name='Contact Name'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_description',
field=models.TextField(blank=True, verbose_name='Description'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_name',
field=models.CharField(max_length=100, verbose_name='Vendor Name'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_phone',
field=localflavor.us.models.PhoneNumberField(blank=True, verbose_name='Phone'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_picture',
field=models.ImageField(blank=True, upload_to='vendor_images', verbose_name='Profile Picture'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_type',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='review_app.VendorType', verbose_name='Catergory'),
),
migrations.AlterField(
model_name='vendor',
name='vendor_website',
field=models.URLField(blank=True, verbose_name='Website'),
),
]
12 changes: 8 additions & 4 deletions review_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ def fm_picture_url(self):
if self.fm_picture:
return self.fm_picture.url
else:
return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/farmersmarket-icon.png"
# return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/farmersmarket-icon.png"
return "../../static/review_app/img/farmersmarket-icon.png"

@property
def fm_banner_picture_url(self):
if self.fm_banner_picture:
return self.fm_banner_picture.url
else:
return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/greens.jpg"
# return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/greens.jpg"
return "../../static/review_app/img/greens.jpg"

def get_absolute_url(self):
return reverse('farmers_market_detail_view', kwargs={'fm_slug': self.fm_slug})
Expand Down Expand Up @@ -107,14 +109,16 @@ def vendor_picture_url(self):
if self.vendor_picture:
return self.vendor_picture.url
else:
return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/vendor_icon.png"
# return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/vendor_icon.png"
return "../../static/review_app/img/vendor_icon.png"

@property
def vendor_banner_picture_url(self):
if self.vendor_banner_picture:
return self.vendor_banner_picture.url
else:
return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/pea.jpg"
# return "https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/pea.jpg"
return "../../static/review_app/img/pea.jpg"

def get_absolute_url(self):
return reverse('vendor_detail_view', kwargs={'vendor_slug': self.vendor_slug})
Expand Down
3 changes: 2 additions & 1 deletion review_app/static/review_app/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ input.secondary.hollow.button {
padding-top: 1.75em;
}
.home-hero {
background: url("https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/fathen.jpg");
/* background: url("https://s3-us-west-2.amazonaws.com/frmrsmrkt/review_app/img/fathen.jpg"); */
background: url("../img/fathen.jpg");
height: 100%;
background-repeat:no-repeat;
-webkit-background-size:cover;
Expand Down
6 changes: 3 additions & 3 deletions review_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from review_app.forms import StatusCreateForm, ContactForm, UserCreationEmailForm
from review.templatetags.review_tags import total_review_average
from review.forms import ReviewForm
# Create your views here.


class IndexView(ListView):
Expand Down Expand Up @@ -78,8 +77,9 @@ def get_context_data(self, **kwargs):
api_key = os.environ['forecast_api']
url = "https://api.forecast.io/forecast/{}/{},{}".format(api_key, location.fm_lat, location.fm_long)
response = requests.get(url).json()
context['forecast_summary'] = response['daily']['summary'] # weekly summary
context['forecast_iframe_url'] = "http://forecast.io/embed/#lat={}&lon={}&name={}".format(location.fm_lat, location.fm_long, location.fm_name)
if (location.fm_lat is not None or location.fm_long is not None):
context['forecast_summary'] = response['daily']['summary'] # weekly summary
context['forecast_iframe_url'] = "https://forecast.io/embed/#lat={}&lon={}&name={}".format(location.fm_lat, location.fm_long, location.fm_name)
if sort:
context['vendor_list'] = Vendor.objects.filter(at_farmers_market__fm_slug=fm_slug).order_by(sort)
elif rated:
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.0
python-3.7.11
Binary file added status_images/bananamama_status.jpg
Binary file added status_images/bioway-staus.jpg
Binary file added status_images/black-hen-hi.png
Binary file added status_images/chillwagon.jpg
Binary file added status_images/cup.jpg
Binary file added status_images/fm_awesome.jpg
Binary file added status_images/gentry.jpg
Binary file added status_images/no_evil.jpg
Binary file added status_images/okra.jpg
Binary file added status_images/td-mrkt.png
Binary file added status_images/west_s.jpg
Binary file added status_images/yello_peppers.jpg
Loading