Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge all changes from the fork #3

Merged
merged 97 commits into from
Aug 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
7379338
Appearence fix-ups and add the results module
ankeshanand Jun 25, 2014
3003d51
Initial commit
ankeshanand Jun 26, 2014
5eddbb5
Update requirements.txt
ankeshanand Jun 28, 2014
827ad97
Update README.md
ankeshanand Jun 28, 2014
9420a81
Ensure unique filenames for all files using Python UUID4
ankeshanand Jun 30, 2014
a65bed8
Add primary key to all models
ankeshanand Jun 30, 2014
6083789
Make sure the filename is alphanumeric
ankeshanand Jun 30, 2014
30961e7
Add the template file for Results
ankeshanand Jun 30, 2014
3d3b07b
Add urls.py file for Results app, making an entry for a unique URL wh…
ankeshanand Jun 30, 2014
080101d
Add show_result view that extracts data from the database for the fil…
ankeshanand Jun 30, 2014
91d8114
Add template and static files for the results app
ankeshanand Jul 1, 2014
96c08d1
Ensure files are parsed only when not in the database, and change dic…
ankeshanand Jul 1, 2014
3491a91
Register results app in settings.py and add URL pattern to the centra…
ankeshanand Jul 1, 2014
4c55fac
Add dash-unit background
ankeshanand Jul 1, 2014
63f03e5
dbutily.py: Point to the correct location of config file
ankeshanand Jul 3, 2014
82bdf72
results/views.py: Wait for 3 seconds before publishing the results
ankeshanand Jul 3, 2014
4f4ed09
Include Image Performance in Results View
ankeshanand Jul 3, 2014
b28e5e1
Automatically redirect to results page on file-upload
ankeshanand Jul 6, 2014
7e83f14
Close the connection after writing file-info to db
ankeshanand Jul 6, 2014
721dcef
Resolve the issue of CSRF tokens.
ankeshanand Jul 8, 2014
5bd8d56
Add Compare Result View along with it's URL mapping
ankeshanand Jul 18, 2014
ca3a078
Add Comparison Django Template along with a forms.py file to handle d…
ankeshanand Jul 18, 2014
bc45be9
Retrieve filtered data from the database and pass to the template
ankeshanand Jul 18, 2014
cc93fb2
Add temp data placeholders in the Comparisons template
ankeshanand Jul 18, 2014
ce8d226
Update Comparison View Front-end
ankeshanand Jul 21, 2014
6ec13de
Add a Date Filter to Comparisons View
ankeshanand Jul 22, 2014
09e12eb
Add modals which popup giving a description of the ratings on clickin…
ankeshanand Jul 22, 2014
ec99b1c
Add Comparison link to the results page
ankeshanand Jul 24, 2014
8495867
Add django-bootstrap-form to requirements
ankeshanand Jul 26, 2014
094e388
Add Makefile
ankeshanand Jul 26, 2014
ba91afa
Add Makefile
ankeshanand Jul 26, 2014
8e0ec5e
Update Makefile
ankeshanand Jul 26, 2014
c526e17
Update Makefile
ankeshanand Jul 26, 2014
891efae
Update Makefile
ankeshanand Jul 26, 2014
3789355
Update Makefile
ankeshanand Jul 26, 2014
2bd8f86
Update Makefile
ankeshanand Jul 26, 2014
9bee7a0
add stub file
ankeshanand Jul 26, 2014
9c4eb08
Remove Stub
ankeshanand Jul 26, 2014
755fffc
Add stub file
ankeshanand Jul 26, 2014
f493e87
Remove stub file
ankeshanand Jul 26, 2014
89617cb
Add the stupid stub again
ankeshanand Jul 26, 2014
7dd4a74
Modify settings for the demo server
ankeshanand Jul 27, 2014
b44f32d
Add WSGI file
ankeshanand Jul 27, 2014
998de27
update urls
ankeshanand Jul 27, 2014
773379c
Update STATIC_URL for demo server
ankeshanand Jul 27, 2014
3e9117d
Update STATIC_URL for demo server
ankeshanand Jul 27, 2014
58fe082
Update urls.py
ankeshanand Jul 27, 2014
9c14763
add stub
ankeshanand Jul 27, 2014
6d7ab13
Update plots urls
ankeshanand Jul 27, 2014
dd6f82c
Minor fixes
ankeshanand Jul 27, 2014
6227d2d
Minor fixes
ankeshanand Jul 27, 2014
a5697dd
Raise Http404 instead of 404
ankeshanand Jul 27, 2014
1edb526
Update ajax url
ankeshanand Jul 27, 2014
b129461
Update ajax url
ankeshanand Jul 27, 2014
92ce609
Update fileupload urls
ankeshanand Jul 27, 2014
0c26868
Update fileupload urls
ankeshanand Jul 27, 2014
badf7f1
Update fileupload urls
ankeshanand Jul 27, 2014
d853534
log csrftoken to console
ankeshanand Jul 27, 2014
1f4e300
Update Media URL
ankeshanand Jul 27, 2014
0d4b772
update results url
ankeshanand Jul 27, 2014
7582436
comment out the line to change dir to libs in dbutils.py
ankeshanand Jul 27, 2014
afdd9be
point to the correct location of config file
ankeshanand Jul 27, 2014
01d5c24
point to the correct location of config file
ankeshanand Jul 27, 2014
369e205
point to the correct location of config file
ankeshanand Jul 27, 2014
fda798b
update project_config for demo server
ankeshanand Jul 27, 2014
9b164c1
point the logger to the correct location of config file
ankeshanand Jul 27, 2014
f89a1e3
Fix Compare Results Link
ankeshanand Jul 27, 2014
27f8e87
Fix a link on Comparison page
ankeshanand Jul 27, 2014
4f22ee7
Fix navbar links
ankeshanand Jul 27, 2014
b5d3479
Replace fabula with benchmark
ankeshanand Jul 27, 2014
2cf6b24
Fix logo link
ankeshanand Jul 27, 2014
70f0587
Redirect to the upload page on start
ankeshanand Jul 27, 2014
9a396a1
add srtup.sh
ankeshanand Jul 27, 2014
8f45562
Update README.md
ankeshanand Jul 27, 2014
0a28065
Add tastypie to installed apps
ankeshanand Jul 29, 2014
c13f627
Merge branch 'master' of https://github.com/BRL-CAD/benchmark
ankeshanand Jul 29, 2014
ab02063
Add FileUpload API support through Django Tastypie
ankeshanand Jul 29, 2014
c8a62a9
Update database settings for deployment(master) branch
ankeshanand Jul 29, 2014
73c5c2e
Make the social media share icons work
ankeshanand Aug 3, 2014
9b1ca8a
Add Homepage
ankeshanand Aug 6, 2014
ee85111
Remove stub
ankeshanand Aug 6, 2014
c36f0ba
Update templates folder location
ankeshanand Aug 6, 2014
2e3ff2a
Update wsgi to add sitedir
ankeshanand Aug 6, 2014
a50ee1b
Update template dir location
ankeshanand Aug 7, 2014
a8db27c
Update navbar links on homepage
ankeshanand Aug 7, 2014
e32f557
Add download link
ankeshanand Aug 7, 2014
143f39a
Do everything in a virtualenv
ankeshanand Aug 12, 2014
681388f
Source the virtualenv file using .
ankeshanand Aug 12, 2014
7f9add5
Try to make this work with virtualenv
ankeshanand Aug 12, 2014
96d9f24
Update makefile
ankeshanand Aug 12, 2014
574f047
Update makefile
ankeshanand Aug 12, 2014
e2923da
Update makefile
ankeshanand Aug 12, 2014
ce56edd
Update makefile
ankeshanand Aug 12, 2014
3e55c3d
Update wsgi.py
ankeshanand Aug 12, 2014
b2e743a
Update URLs to include recent results
ankeshanand Aug 19, 2014
34ce6ac
Add recent results view
ankeshanand Aug 19, 2014
b26e731
Add Recent Results template
ankeshanand Aug 19, 2014
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
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
install: bin/python

bin/python:
virtualenv benchmarkenv
. ./benchmarkenv/bin/activate
benchmarkenv/bin/pip install -r requirements.txt

serve: bin/python
benchmarkenv/bin/python manage.py syncdb
benchmarkenv/bin/python manage.py runserver 8888

deploy: benchmarkenv/bin/python
benchmarkenv/bin/python manage.py collectstatic --clear --noinput
touch wsgi.py # trigger reload

clean:
rm -rf bin/ lib/ build/ dist/ *.egg-info/ include/ local/
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ benchmark
Visualization and Database framework for BRL-CAD's benchmarks, a GSoC '14 project.
Originally forked from [here](http://bitbucket.org/suryajith/benchmark/)

Requirements
============

* Django
* Pillow
* mysql-python

Installation
============

* Clone the repository ````git clone https://github.com/ankeshanand/benchmark.git````
* ````cd benchmark````
* ````pip install -r requirements.txt```` (will install django, pillow and mysql-python)
* ````python manage.py syncdb````
* ````python manage.py runserver````
* go to ````localhost:8000/```` and upload some files
* Clone the repository ````git clone https://github.com/BRL-CAD/benchmark.git````
* Change to the project directory ````cd benchmark````
* Swith to the development branch: ````git checkout development````
* If required, make changes to ````settings.py```` to ensure database credentials are matching with that on your system.
* Initailize a few things: ````bash ./setup.sh````
* Install and Serve the application ````make clean && make serve````
* go to ````localhost:8888/```` and upload some files
4 changes: 3 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
* Fix the issue in archiving files.
* URL links in the navbar should be same for both the apps. Fix this.
* Complete all the charts in the plots app.
* Characterize the charts properly.
* Build a home page for the web app.
* Fix links for social media icons.
* Add BRL-CAD logo.

1 change: 1 addition & 0 deletions fileupload/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__author__ = 'ankesh'
32 changes: 32 additions & 0 deletions fileupload/api/resources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from tastypie import fields, utils
from tastypie.authentication import Authentication
from tastypie.authorization import Authorization

__author__ = 'ankesh'

from tastypie.resources import ModelResource
from fileupload.models import Picture
from django.db import models


class MultipartResource(object):
def deserialize(self, request, data, format=None):
if not format:
format = request.META.get('CONTENT_TYPE', 'application/json')
if format == 'application/x-www-form-urlencoded':
return request.POST
if format.startswith('multipart'):
data = request.POST.copy()
data.update(request.FILES)
return data
return super(MultipartResource, self).deserialize(request, data, format)


class PictureResource(MultipartResource, ModelResource):
file = fields.FileField(attribute="file", null=True, blank=True)

class Meta:
queryset = Picture.objects.all()
allowed_methods = ['post']
authentication = Authentication()
authorization = Authorization()
9 changes: 8 additions & 1 deletion fileupload/models.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# encoding: utf-8
from django.db import models
import uuid
import os


def unique_file_name(instance, filename):
path = 'benchmarkLogs/'
name = str(uuid.uuid4().hex) + '.log'
return os.path.join(path, name)

class Picture(models.Model):
"""This is a small demo using just two fields. The slug field is really not
necessary, but makes the code simpler. ImageField depends on PIL or
pillow (where Pillow is easily installable in a virtualenv. If you have
problems installing pillow, use a more generic FileField instead.

"""
file = models.FileField(upload_to="pictures")
file = models.FileField(upload_to=unique_file_name)
slug = models.SlugField(max_length=50, blank=True)

def __unicode__(self):
Expand Down
Loading