Skip to content

Commit

Permalink
final site with OTP, improved UI, mailing, forums
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketnavin committed Dec 22, 2016
1 parent adce94b commit 6cfa4f4
Show file tree
Hide file tree
Showing 265 changed files with 11,302 additions and 921 deletions.
3 changes: 2 additions & 1 deletion .idea/butler.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

682 changes: 357 additions & 325 deletions .idea/workspace.xml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions butler/.idea/butler.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions butler/.idea/dictionaries/sanket_navin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions butler/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions butler/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions butler/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

711 changes: 711 additions & 0 deletions butler/.idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified butler/__init__.pyc
Binary file not shown.
15 changes: 14 additions & 1 deletion butler/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
# Application definition

INSTALLED_APPS = [
'furnitures.apps.FurnituresConfig',
'forums.apps.ForumsConfig',
'homeservices.apps.HomeservicesConfig',
'restaurants.apps.RestaurantsConfig',
'houseonrent.apps.HouseonrentConfig',
'home.apps.HomeConfig',
Expand Down Expand Up @@ -123,4 +126,14 @@
STATIC_URL = '/static/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
MEDIA_URL = '/media/'

EMAIL_USE_TLS = True

EMAIL_HOST = 'smtp.gmail.com'

EMAIL_HOST_USER = '[email protected]'

EMAIL_HOST_PASSWORD = 'butler123'

EMAIL_PORT = 587
Binary file modified butler/settings.pyc
Binary file not shown.
6 changes: 5 additions & 1 deletion butler/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^home/', include('home.urls')),
url(r'^', include('home.urls')),
url(r'^houseonrent/', include('houseonrent.urls')),
url(r'^restaurants/', include('restaurants.urls')),
url(r'^forums/', include('forums.urls')),
url(r'^homeservices/', include('homeservices.urls')),
url(r'^furnitures/', include('furnitures.urls')),


]

Expand Down
Binary file modified butler/urls.pyc
Binary file not shown.
Binary file modified butler/wsgi.pyc
Binary file not shown.
Binary file modified db.sqlite3
Binary file not shown.
Empty file added forums/__init__.py
Empty file.
Binary file added forums/__init__.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions forums/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.contrib import admin

# Register your models here.
from forums.models import Post,Topic

admin.site.register(Post)
admin.site.register(Topic)
Binary file added forums/admin.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions forums/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import unicode_literals

from django.apps import AppConfig


class ForumsConfig(AppConfig):
name = 'forums'
Binary file added forums/apps.pyc
Binary file not shown.
32 changes: 32 additions & 0 deletions forums/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-09-29 17:43
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Topic',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.TextField(max_length=1000)),
('category', models.TextField(max_length=100)),
('no_of_posts', models.IntegerField()),
('created_time', models.DateTimeField(blank=True, default=datetime.datetime.now)),
('last_updated_time', models.DateTimeField(blank=True)),
('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
Binary file added forums/migrations/0001_initial.pyc
Binary file not shown.
39 changes: 39 additions & 0 deletions forums/migrations/0002_auto_20161005_1330.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-10-05 13:30
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('forums', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('msg', models.TextField(max_length=10000)),
],
),
migrations.RemoveField(
model_name='topic',
name='last_updated_time',
),
migrations.AddField(
model_name='post',
name='topic',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forums.Topic'),
),
migrations.AddField(
model_name='post',
name='user',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
Binary file added forums/migrations/0002_auto_20161005_1330.pyc
Binary file not shown.
20 changes: 20 additions & 0 deletions forums/migrations/0003_auto_20161006_0651.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-10-06 01:21
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forums', '0002_auto_20161005_1330'),
]

operations = [
migrations.AlterField(
model_name='topic',
name='no_of_posts',
field=models.IntegerField(default=0),
),
]
Binary file added forums/migrations/0003_auto_20161006_0651.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions forums/migrations/0004_post_created_time.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-10-06 01:33
from __future__ import unicode_literals

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forums', '0003_auto_20161006_0651'),
]

operations = [
migrations.AddField(
model_name='post',
name='created_time',
field=models.DateTimeField(blank=True, default=datetime.datetime.now),
),
]
Binary file added forums/migrations/0004_post_created_time.pyc
Binary file not shown.
Empty file added forums/migrations/__init__.py
Empty file.
Binary file added forums/migrations/__init__.pyc
Binary file not shown.
26 changes: 26 additions & 0 deletions forums/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from __future__ import unicode_literals

from django.db import models
from datetime import datetime
from django.contrib.auth.models import User


class Topic(models.Model):
user = models.ForeignKey(User, default=1)
title = models.TextField(max_length=1000)
category = models.TextField(max_length=100)
no_of_posts = models.IntegerField(default=0)
created_time = models.DateTimeField(default=datetime.now, blank=True)

def __str__(self):
return self.title


class Post(models.Model):
user = models.ForeignKey(User, default=1, on_delete=models.CASCADE)
topic = models.ForeignKey(Topic, on_delete=models.CASCADE)
msg = models.TextField(max_length=10000)
created_time = models.DateTimeField(default=datetime.now, blank=True)

def __str__(self):
return self.topic + '-' + self.user.username
Binary file added forums/models.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions forums/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
21 changes: 21 additions & 0 deletions forums/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from django.conf.urls import url, include
from . import views

app_name = 'forums'


urlpatterns = [

# /forums/
url(r'^$', views.index, name='index'),

# /forums/add_topic/
url(r'^add_topic/$', views.add_topic, name='add_topic'),

# /forums/add_topic/
url(r'^add_topic/$', views.add_topic, name='add_topic'),

# /forums/add_post/
url(r'^(?P<pk>[0-9]+)/add_topic/$', views.add_post, name='add_post'),

]
Binary file added forums/urls.pyc
Binary file not shown.
39 changes: 39 additions & 0 deletions forums/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from django.shortcuts import render, get_object_or_404
from .models import Post, Topic


# Create your views here.

def index(request):
topics = Topic.objects.all()
if request.user.is_authenticated():
base = "home/base_logged_in.html"
else:
base = "home/base_visitor.html"
context = {'base_template': base,
'topics': topics}
return render(request, 'forums/forum.html', context)


def add_topic(request):
topic = request.POST['topic']
category = request.POST['category']
a = Topic()
a.title = topic
a.category = category
a.user = request.user
a.save()
return index(request)


def add_post(request, pk):
post = request.POST['post']
topic = get_object_or_404(Topic, pk=pk)
a = Post()
a.user = request.user
a.topic = topic
a.msg = post
a.save()
topic.no_of_posts += 1
topic.save()
return index(request)
Binary file added forums/views.pyc
Binary file not shown.
Empty file added furnitures/__init__.py
Empty file.
Binary file added furnitures/__init__.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions furnitures/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.contrib import admin
from .models import Furniture, Picture, BookmarkFurniture

admin.site.register(Furniture)
admin.site.register(Picture)
admin.site.register(BookmarkFurniture)

Binary file added furnitures/admin.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions furnitures/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import unicode_literals

from django.apps import AppConfig


class FurnituresConfig(AppConfig):
name = 'furnitures'
Binary file added furnitures/apps.pyc
Binary file not shown.
Loading

0 comments on commit 6cfa4f4

Please sign in to comment.