Permalink
Browse files

Fall 2011 Release

  • Loading branch information...
1 parent 95bcb5b commit 19eb9fec4556a8b38981ba2d7dbb5856177c103c @StephenPower committed Nov 20, 2011
Showing 527 changed files with 56,019 additions and 2,752 deletions.
View
Binary file not shown.
View
@@ -1,13 +1,53 @@
-## Commands to install the proyect
+## Commands to install the project
+
+Some linux variants will run into problems in the buildout process.
+Make sure the following packages are installed on your system:
+apache2 apache2-devel mysql mysql-devel gcc swig python-devel python-setuptools
+Some systems may have different package names or require additional packages.
+
+Set up apache with the following VirtualHost example:
+<VirtualHost *:80>
+ ServerAdmin user@localhost
+ DocumentRoot /opt/CollectorCity-Market-Place
+ ServerName mydomain.com
+ ServerAlias www.mydomain.com
+ ErrorLog /var/log/apache2/CollectorCity-Market-Place-error.log
+ CustomLog /var/log/apache2/CollectorCity-Market-Place-access.log combined
+ Alias /media/admin /opt/CollectorCity-Market-Place/auctions-env/lib/python2.6/site-packages/django/contrib/admin/media
+ Alias /media /opt/CollectorCity-Market-Place/marketplaces/media
+ Alias /favicon.ico /opt/CollectorCity-Market-Place/marketplaces/media/favicon.ico
+ Alias /robots.txt /opt/CollectorCity-Market-Place/marketplaces/media/robots.txt
+
+ <Directory /opt/CollectorCity-Market-Place/media>
+ Order deny,allow
+ Allow from all
+ </Directory>
+
+ WSGIDaemonProcess user processes=1 threads=2 python-path=/opt/CollectorCity-Market-Place/auctions-env/lib/python2.6/site-packages user=user group=user
+ WSGIProcessGroup user
+ WSGIScriptAlias / /opt/CollectorCity-Market-Place/deploy/marketplaces.wsgi
+
+ <Directory /opt/CollectorCity-Market-Place>
+ Order deny,allow
+ Allow from all
+ </Directory>
+</VirtualHost>
+
+
virtualenv --no-site-packages --python=python2.6 auctions-env
pip -E auctions-env install --requirement=auctions/deploy/requirements.txt
source auctions-env/bin/activate
-cd poc
+The Deploy Directory should contain djangoflash.zip and the gchecky.zip files
+The libs directory should contain the geopy, pickefield, pyExcelerator, reversion, south and storages directories
+
+See requirements.txt for more info
+
+cd /CollectorCity-Market-Place/
chmod +x manage.py
# crear db en mysql, editar settings.py
./manage.py syncdb
@@ -29,4 +69,16 @@ Should be run every day, once a day. It checks which customer do not paid their
java -Dsolr.solr.home=multicore -server -jar start.jar
4) Reindex sorl objects
-python manage.py update_index -a 1
+python manage.py update_index -a 1
+## Commands to install the project
+easy_install virtualenv pip
+virtualenv --no-site-packages --python=python2.6 auctions-env
+pip -E auctions-env install --requirement=deploy/requirements.txt
+source auctions-env/bin/activate
+cd marketplaces
+chmod +x manage.py
+# edit settings.py set DEBUG=True to so runserver serves media files.
+# edit settings.py to set database info (use sqlite3 for non-production)
+./manage.py syncdb
+./manage.py migrate
+
View
Binary file not shown.
@@ -1,4 +1,4 @@
-django>=1.1.1
+django<1.3
MySQL-python
PIL==1.1.7
braintree==2.4.0
@@ -10,3 +10,6 @@ django-haystack==1.0.1-final
Jinja2>=2.5
httplib2
coverage
+DjangoSEO
+django-debug-toolbar
+django-seo
View
@@ -0,0 +1,35 @@
+from __future__ import with_statement
+
+from fabric.api import *
+from fabric import state
+
+
+state.output['debug'] = True
+
+def beta():
+ env.hosts = ['www.knewmismatic.com']
+ env.user = None
+ env.password = None
+ env.virtualenv = '/home/beta/ENV'
+ env.repository = '/home/beta/poc'
+ env.repository_user = 'beta'
+ env.user = 'beta'
+ #prompt('username: ', 'user')
+ #prompt('password: ', 'password')
+
+
+def update():
+ with cd(env.repository):
+ run("hg pull -u")
+ run("%s/bin/python %s/stores/manage.py migrate" % (env.virtualenv, env.repository))
+ run("%s/bin/python %s/marketplaces/manage.py migrate" % (env.virtualenv, env.repository))
+
+def apache_restart():
+ sudo("/etc/init.d/apache2 restart")
+
+def deploy():
+ update()
+ apache_restart()
+
+
+
View
Binary file not shown.
@@ -18,7 +18,7 @@ class Meta:
class MarketSubCategoryForm(ModelForm):
class Meta:
model = MarketSubCategory
- fields = ['marketplace', 'slug', 'category']
+ fields = ['marketplace', 'slug']
# def __init__(self, request=None, *args, **kwargs):
# super(MarketSubCategoryForm, self).__init__(*args, **kwargs)
@@ -0,0 +1,6 @@
+from rollyourown.seo import Tag, MetaTag, KeywordTag, Metadata
+
+class SiteMetadata(Metadata):
+ title = Tag(head=True, max_length=68)
+ description = MetaTag(max_length=155)
+ keywords = KeywordTag()
@@ -17,4 +17,5 @@
url('^blog/(?P<post_slug>[a-zA-Z0-9_.-]+)/$', 'market.views.view_post', name='market_blog_view_post'),
url('^switch_listing/$', 'market.views.set_listing_mode', name='set_listing_mode'),
url('^switch_order/$', 'market.views.set_order_mode', name='set_order_mode'),
+ url('^survey/$', 'market.views.survey', name='market_survey'),
)
@@ -24,17 +24,31 @@ def home(request):
from shops.models import Shop
from inventory.models import Product
from market_buy.models import MarketPlacePick, DealerPick
-
+ from market.forms import MarketMailingListMemberForm
+
marketplace = request.marketplace
market_place_picks = MarketPlacePick.objects.filter(marketplace=marketplace).order_by("order")
featured_dealers = DealerPick.objects.filter(marketplace=marketplace).order_by("order")[:2]
recently_products = Product.objects.filter(shop__marketplace=marketplace, has_image=True).order_by("-date_time")[:20]
+ if request.method == "POST":
+ form = MarketMailingListMemberForm(request.POST)
+ if form.is_valid():
+ member = form.save(commit=False)
+ member.marketplace = request.marketplace
+ member.save()
+ request.flash['message'] = unicode(_("Email successfully registered."))
+ request.flash['severity'] = "success"
+ return HttpResponseRedirect(reverse("market_home"))
+ else:
+ form = MarketMailingListMemberForm()
+
return render_to_response("%s/home.html" % request.marketplace.template_prefix,
{
'market_place_picks' : market_place_picks,
'featured_dealers' : featured_dealers,
'recently_products' : recently_products,
+ 'newsletter_form': form
},
RequestContext(request))
@@ -105,7 +119,7 @@ def search(request, category_slug=None, subcategory_slug=None):
raise Http404
paged = (pager.num_pages > 1)
-
+
return render_to_response("%s/search.html" % request.marketplace.template_prefix,
{'current_category' : current_category, 'current_subcategory': current_subcategory,
'products' : paginator, 'pager':pager,
@@ -285,11 +299,22 @@ def contact_us(request):
phone = request.POST.get('phone', 'unknown')
email = request.POST.get('email', 'unknown')
message = request.POST.get('message', '- no message -')
-
+
+ market_admin = request.marketplace.contact_email
msg = "Message from %s (email %s, phone %s).\n%s" % (name, email, phone, message)
- send_mail('Contact Form From %s' % request.marketplace, msg, 'admin@greatcoins.com', [request.marketplace.contact_email], fail_silently=True)
+ send_mail('Contact Form From %s' % request.marketplace, msg, settings.EMAIL_FROM, [mail for (name, mail) in settings.STAFF]+[market_admin], fail_silently=True)
return HttpResponseRedirect(reverse("market_home"))
return render_to_response("%s/contact_us.html" % request.marketplace.template_prefix,
- {} , RequestContext(request))
+ {} , RequestContext(request))
+
+def survey(request):
+ return render_to_response("%s/survey.html" % request.marketplace.template_prefix,
+ {} , RequestContext(request))
+def sitemap(request):
+ return render_to_response("%s/sitemap.xml" % request.marketplace.template_prefix,
+ {} , RequestContext(request))
+def robot(request):
+ return render_to_response("%s/robots.txt" % request.marketplace.template_prefix,
+ {} , RequestContext(request))
@@ -25,17 +25,17 @@ class ShowForm(ModelForm):
class Meta:
model = Show
- exclude = ['marketplace']
+ exclude = ['marketplace', 'country', 'contact_info', 'admission', 'location','time_from', 'time_to']
class BuyerForm(UserCreationForm):
- email = forms.EmailField()
+ email = forms.EmailField()
SORT_CHOICES = (
+ ("relevance", _("Relevance")),
("price", _("Price")),
("-starts_at", _("Age")),
- ("relevance", _("Relevance")),
#("dealer", _("Dealer")),
#("auction", _("Auction")),
#("forsale", _("For sale")),
@@ -93,8 +93,7 @@ class AdvancedSearchForm(SearchForm):
from_price = forms.DecimalField(label=_("Filter By Price"), required=False)
to_price = forms.DecimalField(label=_("to"), required=False)
- view_by = forms.ChoiceField(choices=VIEW_BY_CHOICES,
- widget=forms.RadioSelect(), initial="gallery")
+ view_by = forms.ChoiceField(choices=VIEW_BY_CHOICES, widget=forms.RadioSelect(), initial="gallery")
def __init__(self, marketplace, *args, **kwargs):
super(AdvancedSearchForm, self).__init__(*args, **kwargs)
@@ -1,3 +1,4 @@
+import datetime
from django.db import models
from django.conf import settings
@@ -21,8 +22,8 @@ class Show(models.Model):
name = models.CharField(max_length=128)
date_from = models.DateField()
date_to = models.DateField()
- time_from = models.TimeField()
- time_to = models.TimeField()
+ time_from = models.TimeField(default=datetime.time(12,00))
+ time_to = models.TimeField(default=datetime.time(12,00))
address = models.CharField(max_length=128)
city = models.CharField(max_length=128)
country = models.CharField(max_length=128, default="US")
@@ -7,6 +7,7 @@
url(r'^advanced_search_reset/$', 'market_buy.views.advanced_search', {"reset": True}, name='buy_advanced_search_reset'),
url(r'^categories/$', 'market_buy.views.categories', name='buy_categories'),
url(r'^confirmemail/(?P<code>[\d\w\-]+)/$', 'market_buy.views.confirmemail', name='buy_confirmemail'),
+ url(r'^howtobuy/$', 'market_buy.views.howtobuy', name='buy_howtobuy'),
url(r'^editor_pick/$', 'market_buy.views.editor_pick', name='buy_editor_pick'),
url(r'^latest_items/$', 'market_buy.views.latest_items', name='buy_latest_items'),
url(r'^map_pick/$', 'market_buy.views.map_pick', name='buy_map_pick'),
Oops, something went wrong.

0 comments on commit 19eb9fe

Please sign in to comment.