Commit 10e1587b authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Merge branch 'issuedev'

parents 101cd40f 2826e405
# ROOMLIST
Roomlist is a secure, privacy-oriented service for Mason studens to find their on-campus neighbors.
Roomlist is a secure, privacy-oriented service for Mason students to find their on-campus neighbors.
## On Contributing
RoomList welcomes all the help it can get. Even if you don't feel like you can be helpful the more technical aspects, we definitely need designers, technical writers, and testers.
Roomlist welcomes all the help it can get. Even if you don't feel like you can be helpful the more technical aspects, we definitely need designers, technical writers, and testers.
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 a small spelling mistake.
......@@ -16,12 +16,10 @@ Please visit the [SRCT Wiki](http://wiki.srct.gmu.edu/) for more information on
## Setting everything up for development
These instructions are for Ubuntu and Debian, or related Linux distributions. (If you'd like to help write the instructions for Mac's OSX, please do!)
These instructions are for Ubuntu and Debian, or related Linux distributions. (If you'd like to help write the instructions for Mac OSX, please do!)
### Prerequisities
### Package Installation
First, install python, pip, and git on your system. Python is the programming language used for Django, the web framework used by Roomlist. 'Pip' is the python package manager. Git is the version control system used for SRCT projects.
Open a terminal and run the following commands.
......@@ -34,13 +32,7 @@ This retrieves links to the most up-to-date and secure versions of your packages
you install python and git.
We're using Postgres for our database, so run
`sudo apt-get install postgresql postgresql-contrib python-psycopg2`.
### Copying Down the Source Code
Now, we're going to copy down a copy of the roomlist codebase from git.gmu.edu, the SRCT code respository.
Now, we're going to clone down a copy of the Roomlist codebase from git.gmu.edu, the SRCT code respository.
Configure your ssh keys by following the directions at git.gmu.edu/help/ssh/README.
......@@ -48,9 +40,19 @@ Now, on your computer, navigate to the directory in which you want to download t
`git clone git@git.gmu.edu:srct/roomlist.git`
### Package Installation
Next, install these packages from the standard repositories
`$ sudo apt-get install libldap2-dev mysql-server mysql-client libmysqlclient-dev python-mysqldb libsasl2-dev libjpeg-dev redis-server`
If prompted to install additional required packages, install those as well.
When prompted to set your mysql password, it's advisable to set it as the same as your normal superuser password.
### The Virtual Environment
Virtual environments are used to keep separate project packages from the main computer, so you can use different versions of packacages across different projects and also ease deployment server setup.
Virtual environments are used to keep separate project packages from the main computer, so you can use different versions of packages across different projects and also ease deployment server setup.
It's often recommended to create a special directory to store all of your virtual environments together, but some prefer keeping their virtual environment in the top level of their project's director. If you choose the latter, make sure to keep the virtual environment folders out of version control.
......@@ -64,55 +66,59 @@ to install virtualenv system-wide, and then run
in your virtual environment directory to create your virtual environment. Activate it by typing
`source roomlist/vin/activate`
`source roomlist/bin/activate`
If you ever need to exit your virtual environment, simply run
`deactivate`
Now, the packages you need to install for roomlist are in in the top level of the project's directory structure. Run
Now, the packages you need to install for Roomlist are in in the top level of the project's directory structure. Run
`pip install -r requirements.txt`
to in install all of the packages needed for the project.
Next, run `python manage.py makemigrations`, `python manage.py migrate`, then `python manage.py runserver`.
### Creating the Database
To set up the PostgreSQL database, open a terminal and type in the following commands:
Roomlist is configured for using a mysql database, (though you can change this in config.py)
By default, the database is called 'roomlist' in the configurations, and the user, 'roommate'.
First, we must install some dependencies for PostgreSQL.
Load up the mysql shell by running
``$ sudo apt-get install libpq-dev python-dev``
``mysql -u root -p``
Next, we need to install PostgreSQL.
and putting in your mysql password.
``$ sudo apt-get install postgresql postgresql-contrib``
Create the database by running
Now, we need to become the postgres user, create our database, and create our user.
``CREATE DATABASE roomlist;``
``$ sudo su - postgres``
``$ createdb roomlist``
You can choose a different name for your database. Double check your database was created
Choose your username, and execute the next command without the quotes.
``SHOW DATABASES;``
``$ createuser -P "your_username"``
Though you can use an existing user to access this database, here's how to create a new user and give them the necessary permissions to your newly created database.
You'll then be prompted to twice enter your password. Choose a strong passphrase for production. For local development, password strength is less important.
``CREATE USER 'roommate'@'localhost' IDENTIFIED BY 'password';``
For local development, password strength is less important, but use a strong passphrase for deployment. You can choose a different username.
Finally, we need to enter the PostgreSQL command line interface to grant permissions.
``GRANT ALL ON roomlist.* TO 'roommate'@'localhost';``
This allows your database user to create all the tables it needs on the bookshare database. (Each model in each app's models.py is a separate table, and each attribute a column, and each instance a row.)
``$ psql``
``postgres=# GRANT ALL PRIVILEGES ON DATABASE roomlist TO django;``
``GRANT ALL ON test_roomlist.* TO 'roommate'@'localhost';`` ``FLUSH PRIVILEGES;``
When running test cases, django creates a test database so your 'real' database doesn't get screwed up. This database is called 'test_' + whatever your normal database is named. Note that for permissions it doesn't matter that this database hasn't yet been created.
Your PostgreSQL database should now be set up to work with the Roomlist project.
The .\* is to grant access all tables in the database, and 'flush privileges' reloads privileges to ensure that your user is ready to go.
Type ``\q`` and hit enter to exit the PostgreSQL shell.
Exit the mysql shell by typing `exit`.
Copy the secret.py.template and config.py.template to secret.py and config.py respectively. For each, follow the comment instruction provided in each file.
Now, to configure your newly created database with the project settings, copy the secret.py.template in settings/ to secret.py. Follow the comment instructions provided in each file to set your secret key and database info.
Run `python manage.py syncdb` to set up the empty database tables. When you're prompted, say 'y' to setting up the superuser, but use your mason username and full mason email address (@masonlive.gmu.edu) for the account. This is because we use Mason's Central Authentication for our user signin, and your admin account needs to manage your CAS account.
Run `python manage.py makemigrations` and `python manage.py migrate` to configure something called 'migrations', which allow you to make changes to the tables in your database without screwing up existing information.
Then run `python manage.py createsuperuser` to create an admin account, using the same username and email as you'll access through CAS.
Finally, run `python manage.py syncdb` to set up all the tables in your empty database.
## Starting up the test server
......@@ -122,6 +128,10 @@ With your virtual environment active, run
Head over to localhost:8000 and see the site!
### Notes on Cacheing
Roomlist's urls are set to be cached for periods of time set so that ordinary user experience will not be impacted, but a substantial load will be lifted from a deployment server. However, this can be annoying when you're making and want to check small changes rapidly on development. You can edit the respective apps' urls.py files and remove the cacheing configurations, but make sure that you do not include such edits in any pushes!
## Deployment
### Docker
......@@ -130,7 +140,7 @@ For server deployment, not for most local work
## To-do
The list of to-do items is kept track of on the gitlab roomlist issues page. https://git.gmu.edu/srct/roomlist/issues
The list of to-do items is kept track of on the gitlab Roomlist issues page. https://git.gmu.edu/srct/roomlist/issues
Each issue includes details about the bugs and features, and links to documentation and tutorials to help with fixing that specific issue.
......
......@@ -15,9 +15,9 @@ django-model-utils==2.2
django-randomslugfield==0.3.0
flake8==2.4.0
mccabe==0.3
MySQL-python==1.2.5
oauthlib==0.7.2
pep8==1.5.7
psycopg2==2.5.4
pyflakes==0.8.1
python-openid==2.2.5
requests==2.5.1
......
{% extends 'layouts/base.html' %} {% block title %} SRCT RoomList | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock %} {% load socialaccount %} {% block content %}
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock %} {% load socialaccount %} {% block content %}
<!-- gravatar_url student.user.email 175 %} -->
{% get_social_accounts student.user as accounts %}
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList | Majors | {{ major.name }} {% endblock title %}
{% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %}
{% block content %}
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList | Majors {% endblock title %}
{% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %}
{% block content %}
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock %}
{% block title %} SRCT Roomlist | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock %}
{% block reminder %}
{% endblock %}
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList | New Student Setup {% endblock %}
{% block title %} SRCT Roomlist | New Student Setup {% endblock %}
{% block reminder %}
{% endblock %}
......@@ -20,7 +20,7 @@
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title text-center"><strong>Welcome, {{ student.user.first_name }}!</strong></h1>
<h1 class="panel-title text-center"><strong>Welcome, {{ student.user.first_name }}!</strong></h1>
</div>
<div class="panel-body">
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList | Student Major {% endblock %}
{% block title %} SRCT Roomlist | Student Major {% endblock %}
{% block reminder %}
{% endblock %}
......
......@@ -7,7 +7,7 @@ from housing.models import Building, Room
def index(request):
return HttpResponse("Hello, world. You're at the RoomList index.")
return HttpResponse("Hello, world. You're at the Roomlist index.")
def buildings_list(request):
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList &bull; {{ building.name }} {% endblock %}
{% block title %} SRCT Roomlist &bull; {{ building.name }} {% endblock %}
{% block content %}
<div class="page-header" id="banner">
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList &bull; {{ floor.building.name }} {{ floor.number }}{% endblock %}
{% block title %} SRCT Roomlist &bull; {{ floor.building.name }} {{ floor.number }}{% endblock %}
{% block content %}
{% load humanize %}
......
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList &bull; {{ room.floor.building.name }} {{ room.number }}{% endblock %}
{% block title %} SRCT Roomlist &bull; {{ room.floor.building.name }} {{ room.number }}{% endblock %}
{% block content %}
<div class="page-header" id="banner">
......
{% extends 'layouts/base.html' %}
{% block title %}
SRCT RoomList &bull; Homepage
{% endblock %}
{% block title %} SRCT RoomList &bull; {{ room.floor.building.name }} {{ room.number }} {% endblock title %}
{% block content %}
<div class="page-header" id="banner">
......@@ -24,7 +24,7 @@ SRCT RoomList &bull; Homepage
</div>
<br />
<div class="row">
{% endif %}
{% endif %}
{% endfor %}
</div>
......@@ -41,7 +41,7 @@ SRCT RoomList &bull; Homepage
</div>
<br />
<div class="row">
{% endif %}
{% endif %}
{% endfor %}
</div>
......@@ -51,4 +51,4 @@ SRCT RoomList &bull; Homepage
<div class="row">
</div>
{% endblock %}
{% endblock %}
\ No newline at end of file
......@@ -17,3 +17,6 @@ PIWIK_DOMAIN_PATH = 'piwik.example.com'
# set piwik server site id (piwik can track multiple websites)
PIWIK_SITE_ID = '4'
# If you want to change the database engine you are free to do so here.
DB_ENGINE = 'django.db.backends.mysql'
......@@ -111,7 +111,7 @@ SECRET_KEY = secret.SECRET_KEY
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': config.DB_ENGINE,
'NAME': secret.DB_NAME,
'USER': secret.DB_USER,
'PASSWORD': secret.DB_PASSWORD,
......@@ -167,5 +167,3 @@ HAYSTACK_CONNECTIONS = {
# The RealtimeSignalProcessor allows for objects to indexed as soon as
# they are created -- in real time.
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
......@@ -10,7 +10,7 @@ SRCT Roomlist &bull; About
<div class="row">
<div class="col-lg-12 license">
<div class="jumbotron jumboabout">
<h1>About RoomList</h1>
<h1>About Roomlist</h1>
</div>
<a href="https://creativecommons.org/licenses/by-nc/2.0/" target="_blank"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc/2.0/80x15.png" title="'Campus Dorms East side of Campus' by Flickr user cgs_gmu2005 is licensed under a Creative Commons Attribution-NonCommerical 2.0 General License."></a>
</div>
......@@ -22,7 +22,7 @@ SRCT Roomlist &bull; About
<div class="row">
<div class="col-md-4">
<h2>What is RoomList?</h2>
<h2>What is Roomlist?</h2>
<p>
Roomlist is a privacy-focused software tool to allow Mason students to
safely and securely share their housing information, aiding the educational
......@@ -36,9 +36,9 @@ SRCT Roomlist &bull; About
</div>
<div class="col-md-4">
<h2>Who uses RoomList?</h2>
<h2>Who uses Roomlist?</h2>
<p>
RoomList is available only to current students and faculty at George Mason
Roomlist is available only to current students and faculty at George Mason
University with full active user accounts. Users must log in with their Mason
credentials.
</p>
......@@ -54,7 +54,7 @@ SRCT Roomlist &bull; About
Members of the
<a href="//srct.gmu.edu">Student-Run Computing and Technology</a> registered
student organization at <a href="//gmu.edu">George Mason University</a>
are the clever, talented student developers behind RoomList.
are the clever, talented student developers behind Roomlist.
</p>
<p>
We are a group of creative people that like making software and
......
{% extends 'layouts/base.html' %} {% block title %} SRCT RoomList &bull; Homepage {% endblock %} {% block content %}
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist &bull; Homepage {% endblock %} {% block content %}
<div class="container container-padding">
<div class="row">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment