Skip to content

Commit

Permalink
Merge pull request #1 from systers/new-malaria-components
Browse files Browse the repository at this point in the history
New malaria components
  • Loading branch information
rosariorobinson committed Jul 3, 2014
2 parents 6c1992b + 8e59aa8 commit c11406b
Show file tree
Hide file tree
Showing 66 changed files with 11,029 additions and 0 deletions.
Binary file added docs/SoftwareDesignDocument.pdf
Binary file not shown.
Empty file added infohub/__init__.py
Empty file.
Binary file added infohub/__init__.pyc
Binary file not shown.
101 changes: 101 additions & 0 deletions infohub/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#Version : Phython/Django 2.7.6, PostgreSQL 9.3.4
#Author : Vaibhavi Desai
#Github username : desaivaibhavi
#email : ranihaileydesai@gmail.com

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '@0kjw@u5rv7mf!s2j8ix7lq@n%w&v$6p8ku%8hkmmxxj$w44ys'

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

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['localhost','192.168.33.10','192.168.33.10:8000']


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'webhub',
'rest_framework',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'infohub.urls'

WSGI_APPLICATION = 'infohub.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'rani',
'HOST': '0.0.0.0',
'PORT': '5432',
}
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'America/Chicago'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
MEDIA_ROOT='/vagrant/submit/media/propics/'
STATIC_URL = '/static/'
STATIC_ROOT = ''

# Additional locations of static files
STATICFILES_DIRS = (
'/vagrant/submit/media/propics/',
'/vagrant/submit/app-web-server/ui/bootstrap/fonts',
'lol',
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)


REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',),
'PAGINATE_BY': 10
}
Binary file added infohub/settings.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions infohub/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#Version : Phython/Django 2.7.6, PostgreSQL 9.3.4
#Author : Vaibhavi Desai
#Github username : desaivaibhavi
#email : ranihaileydesai@gmail.com

from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Examples:
# url(r'^$', 'infohub.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),

url(r'^admin/', include(admin.site.urls)),
url(r'^', include('webhub.urls')),



)
Binary file added infohub/urls.pyc
Binary file not shown.
10 changes: 10 additions & 0 deletions infohub/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Version : Phython/Django 2.7.6, PostgreSQL 9.3.4
#Author : Vaibhavi Desai
#Github username : desaivaibhavi
#email : ranihaileydesai@gmail.com

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "infohub.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Binary file added infohub/wsgi.pyc
Binary file not shown.
18 changes: 18 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#Version : Phython/Django 2.7.6, PostgreSQL 9.3.4
#Author : Vaibhavi Desai
#Github username : desaivaibhavi
#email : ranihaileydesai@gmail.com

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "infohub.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)



1 change: 1 addition & 0 deletions paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cpspath='/home/rani/gsoc/DevEnvironments/pc-web/submit/'
Binary file added paths.pyc
Binary file not shown.
37 changes: 37 additions & 0 deletions readmeForCode
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Readme file :

Details about the folders

infohub : contains the python environment setup, it contains 4 files - init.py, settings.py, urls.py and wsgi.py
settings.py has the main configuration settings like dependencies, database, timezone etc.

ui : contains the ui page templates of the site, it conains the html,css, js page templates with applied jinja integration. Also, I have used bootstrap for responsiveness and better UI design.

webhub : contains the python-django backend of the site, it conains 7 files - init.py, admin.py, checker.py, models.py, tests.py, urls.py and views.py
admin.py contains the models that are to be added in the admin panel
checker.py has a check function that redirects the user to the home page depending upon his current status (i.e. login/logout)
models.py has all the information about the models we are going to have in the database
urls.py has the urls of the pages created connected with the respective views
views.py has all the views, ie function to call different views and render the respective values from the backend

manage.py : is the file that is used to run the application


Guidelines to run the application :

I had to reinstall postgres and python on the VM provided. Also, I had to install python-psycopg2 and jinja on the VM. Make sure the internet is working as I have used some online resources right now.

To run the application,
1. Start the VM. Install the mentioned dependencies if required
2. Go to the directory which has manage.py file
3. Syncing with the database : run the following command from the terminal
python manage.py syncdb
4. You might be asked to create a super user. Create one.
5. Runnning the server : run the following command from the terminal
python manage.py runserver 0.0.0.0:8000
6. Open the web-browser and go to http://192.168.33.10:8000/admin. Log in (with the superuser credentials).
7. You will have to create one user from the admin panel.Create one user and add it to the new pcuser. Log out.
8. Now go to http://192.168.33.10:8000/. Login with the credential of the pcuser that you created from the admin panel.
9. Done !


37 changes: 37 additions & 0 deletions readmeForCode~
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Readme file :

Details about the folders

infohub : contains the python environment setup, it contains 4 files - init.py, settings.py, urls.py and wsgi.py
settings.py has the main configuration settings like dependencies, database, timezone etc.

ui : contains the ui page templates of the site, it conains the html,css, js page templates with applied jinja integration. Also, I have used bootstrap for responsiveness and better UI design.

webhub : contains the python-django backend of the site, it conains 7 files - init.py, admin.py, checker.py, models.py, tests.py, urls.py and views.py
admin.py contains the models that are to be added in the admin panel
checker.py has a check function that redirects the user to the home page depending upon his current status (i.e. login/logout)
models.py has all the information about the models we are going to have in the database
urls.py has the urls of the pages created connected with the respective views
views.py has all the views, ie function to call different views and render the respective values from the backend

manage.py : is the file that is used to run the application


Guidelines to run the application :

I had to reinstall postgres and python on the VM provided. Also, I had to install python-psycopg2 and jinja on the VM. Make sure the internet is working as I have used some online resources right now.

To run the application,
1. Start the VM. Install the mentioned dependencies if required
2. Go to the directory which has manage.py file
3. Syncing with the database : run the following command from the terminal
python manage.py syncdb
4. You might be asked to create a super user. Create one.
5. Runnning the server : run the following command from the terminal
python manage.py runserver 0.0.0.0:8000
6. Open the web-browser and go to http://192.168.33.10:8000/admin. Log in (with the superuser credentials).
7. You will have to create one user from the admin panel.Create one user and add it to the new pcuser. Log out.
8. Now go to http://192.168.33.10:8000/. Login with the credential of the pcuser that you created from the admin panel.
9. Done !


23 changes: 23 additions & 0 deletions ui/aboutPC.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
Version : Phython/Django 2.7.6, PostgreSQL 9.3.4
Author : Vaibhavi Desai
Github username : desaivaibhavi
email : ranihaileydesai@gmail.com
-->

<!-- page for about us -->
<html>
<head>
<title> About PC </title>
</head>
<body>
{% include "header.html" %}
<br><br><br><br><br><br><center>
<p>Here the information about PC would be shown</p></center>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
{% include "footer.html" %}

</body>
</html>

Loading

0 comments on commit c11406b

Please sign in to comment.