README.md 5.08 KB
Newer Older
Tyler Hallada's avatar
Tyler Hallada committed
1
2
#What's Open#

Tyler Hallada's avatar
Tyler Hallada committed
3
4
Simple Django site displaying which dining locations are currently open on 
George Mason University's campus.
Tyler Hallada's avatar
Tyler Hallada committed
5
6
7

##Contributing##

Tyler Hallada's avatar
Tyler Hallada committed
8
9
10
11
What's Open is still in it's very early stages and needs all the help it can
get. Even if you don't feel like you can be helpful with the heavily technical
aspects, we definitely need designers and technical writers.

12
13
14
There are many things that can be done with this project (see the "To Do" 
section), but sometimes it's the small things that count, so don't be afraid of 
contributing just for a spelling mistake.
Tyler Hallada's avatar
Tyler Hallada committed
15
16
17
18
19
20
21

If you need help at all please contact me (Tyler). I want people to
contribute, so if you are struggling, or just want to learn, then I am willing
to help.

###Set Up###

Tyler Hallada's avatar
Tyler Hallada committed
22
23
24
25
To get started, you'll need the following installed:
* [Python 2.7](http://www.python.org/download/)
* [Django 1.4 or later](https://www.djangoproject.com/download/)
* [Git](http://git-scm.com/book/en/Getting-Started-Installing-Git)
Tyler Hallada's avatar
Tyler Hallada committed
26
27
28
* [virtualenv](http://www.virtualenv.org/en/latest/index.html#installation) 
  (to install you will need either 
  [pip](http://www.pip-installer.org/en/latest/installing.html) or 
Tyler Hallada's avatar
Tyler Hallada committed
29
  easyinstall, which is bundled with 
Tyler Hallada's avatar
Tyler Hallada committed
30
  [setuptools](http://pypi.python.org/pypi/setuptools)
Tyler Hallada's avatar
Tyler Hallada committed
31

Tyler Hallada's avatar
Tyler Hallada committed
32
33
Then type the following commands in your terminal (if you're on Windows, 
[Cygwin](http://www.cygwin.com/) is recommended).
Tyler Hallada's avatar
Tyler Hallada committed
34

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
NOTE: While git.gmu.edu is not functioning correctly, What's Open will be using
my repository at https://github.com/thallada/whats-open So, if you want to
push code I'll have to add you as a collaborator to the repository manually. 
Please let me know you're github username and I can add you. In the future, when
git.gmu.edu is working, you will be able to contribute to the project as long
as you're in the SRCT group.

You don't need a github account to preform a `git clone`, but you should get
one if you plan on actually modifying code. [Github's Set-Up
Page](https://help.github.com/articles/set-up-git) should help with that. It's
also a good idea to set up your [ssh keys to be used by
github](https://help.github.com/articles/generating-ssh-keys) at this time so
you won't have to keep typing in your password when you push to a github
repository.

Tyler Hallada's avatar
Tyler Hallada committed
50
```bash
51
git clone https://github.com/thallada/whats-open.git
Tyler Hallada's avatar
Tyler Hallada committed
52
53
54
55
56
cd whats-open/
virtualenv venv --distribute
source venv/bin/activate
pip install -r requirements.txt
python manage.py syncdb
57
python manage.py migrate website
Tyler Hallada's avatar
Tyler Hallada committed
58
59
```

Tyler Hallada's avatar
Tyler Hallada committed
60
61
###Testing the Site Locally###

Tyler Hallada's avatar
Tyler Hallada committed
62
63
64
Now that everything is set-up you can run the server on your computer.

```bash
Tyler Hallada's avatar
Tyler Hallada committed
65
python manage.py runserver --settings=whats_open.local_settings
Tyler Hallada's avatar
Tyler Hallada committed
66
67
```

Tyler Hallada's avatar
Tyler Hallada committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Go to http://127.0.0.1/ in your browser and you should see the website. 
Though, there won't be any restaurants showing. You will need to add them to 
the database. Go to http://127.0.0.1/admin/ to add new Restaurant and Schedule 
objects to your database.

###Modifying and Deploying Code###

With the means of testing the website, you can really start contributing.

If you're new to Django and don't know where to start, I highly recommend
giving the [tutorial](https://docs.djangoproject.com/en/dev/intro/tutorial01/)
a try. However, it leaves out a lot of important things, so remember, Google is
your friend. If you can't figure it out there, ask me.

If you followed the steps in "Set Up" above, once you actually make changes it
should be easy to push them to the git repository.

There are many ways to use git, and this is one example:

```
git commit -a
git push origin master
```

92
93
94
If you're having trouble pushing to my github repository please see the note 
in "Set-Up" about how to set up github so you can do that.

Tyler Hallada's avatar
Tyler Hallada committed
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Some more helpful links on how to use Git:
* [Git Reference](http://gitref.org/)
* [OpenHatch's Training Mission](https://openhatch.org/missions/git)
* [Visual Git
  Reference](http://marklodato.github.com/visual-git-guide/index-en.html)
* [Git For Ages 4 And
  Up](http://blip.tv/open-source-developers-conference/git-for-ages-4-and-up-4460524)


###Pedantic Technical Details###

Notice that `whats_open.local_settings` was specified as the settings file when
running the site locally. This settings file, located under the `whats_open`
folder as `local_settings.py`, is identical to the `settings.py` except for a
few things that allow you to run the site locally, like using an sqlite
database instead of the PostgresSQL one used for production currently.

Tyler Hallada's avatar
Tyler Hallada committed
112
However, it is possible to run the site locally using the PostgresSQL database
Tyler Hallada's avatar
Tyler Hallada committed
113
114
115
and normal `settings.py` file. The most sane way of doing this requires that the 
heroku-toolbelt installed and that you have access to the heroku site as a 
contributor, so see me if you desire this.
Tyler Hallada's avatar
Tyler Hallada committed
116
117
118
119
120
121
122
123
124
125
126
127

###To Do###
* Get all restaurants displaying correct open times on the page. AKA. make
  extensive tests.
* Add a Typeahead search box at the top to quickly filter out restaurants.
* Sort by location view
* Get a decent UI
* Add times until opening/closing for restaurants that are close, and exact
  times for those that aren't.
* Add yellow close-to-closing condition.
* Possible: Make page refresh, or more preferably have the data refresh. For
  example, with AJAX calls.
128
* Possible: Make an API?