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

added counter #26

Open
wants to merge 146 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
d5edb37
CSCTN Porting
bubbaandy89 Dec 6, 2022
decea77
Autoformatting and dep updates
bubbaandy89 Dec 6, 2022
6bf91b6
Deleting bad file
bubbaandy89 Dec 6, 2022
ba87646
Fixing bad type hint imports
bubbaandy89 Dec 6, 2022
9600199
Add welcome email on register
bubbaandy89 Dec 6, 2022
d92998a
Working to integrate event manager
bubbaandy89 Dec 22, 2022
9cde73a
Integrating events management
bubbaandy89 Dec 29, 2022
0366e4e
Add Image posting and more user fields
bubbaandy89 Dec 29, 2022
65e8a35
Fix home page permissions bug
bubbaandy89 Dec 31, 2022
37d2f64
Update events blocklist
bubbaandy89 Jan 2, 2023
279d2b1
add event_poster to modal
bubbaandy89 Jan 2, 2023
f733ad8
Add image uploading for events
bubbaandy89 Jan 2, 2023
c68a9d4
Fix newevent on navbar
bubbaandy89 Jan 2, 2023
3ed2643
email admins on new user creation
bubbaandy89 Jan 2, 2023
fea7436
disable oauth links for now
bubbaandy89 Jan 2, 2023
2e7dfe3
Add email template for admins email
bubbaandy89 Jan 2, 2023
33c665d
Update about page
bubbaandy89 Jan 2, 2023
9e64abd
Secure all views
bubbaandy89 Jan 2, 2023
7e4b452
Create helper func to check usr verified
bubbaandy89 Jan 2, 2023
f6bf42f
Initial participation implementation
bubbaandy89 Jan 2, 2023
792619d
fix post.image bug
bubbaandy89 Jan 2, 2023
845b05a
auto-submit on image upload
bubbaandy89 Jan 2, 2023
9331bc9
Fix event deletion
bubbaandy89 Jan 2, 2023
5a7a800
Fix missing datetimepicker
bubbaandy89 Jan 2, 2023
f43d661
Allow longer event descriptions
bubbaandy89 Jan 2, 2023
50b5932
Require login everywhere
bubbaandy89 Jan 2, 2023
abdee4b
Fix socials link display
bubbaandy89 Jan 2, 2023
2d3eaf1
Disable missed oauth links
bubbaandy89 Jan 2, 2023
93e7986
Log file uploads for posts
bubbaandy89 Jan 3, 2023
0f800f9
remove extra decorators
bubbaandy89 Jan 3, 2023
b8a24d8
Login required everywhere
bubbaandy89 Jan 3, 2023
9ce03f5
Fix images being huge
bubbaandy89 Jan 3, 2023
dd781d3
Fix images being huge on feeds
bubbaandy89 Jan 3, 2023
0874918
Make allevent staff only in prep for nuke
bubbaandy89 Jan 3, 2023
ecd2beb
Fix Post Deleting
bubbaandy89 Jan 3, 2023
bbd03f2
Point to explore instead of allevents
bubbaandy89 Jan 3, 2023
1e701d5
add gunicorn debug level logging
bubbaandy89 Jan 3, 2023
9dd10a0
Fix chat functionality
bubbaandy89 Jan 3, 2023
07cf51a
Updates to new user creation
bubbaandy89 Jan 3, 2023
9eca52f
clean up unused objs
bubbaandy89 Jan 3, 2023
58cc9af
redirect to profile edit page
bubbaandy89 Jan 3, 2023
46eeee7
Updating about and root page
bubbaandy89 Jan 3, 2023
c4cb927
Update site style colors
bubbaandy89 Jan 3, 2023
7d32a64
Set staticfiles in right place
bubbaandy89 Jan 4, 2023
251f8df
Fix event participation feedback
bubbaandy89 Jan 4, 2023
b33a4ad
redirect to profile only if not verified
bubbaandy89 Jan 4, 2023
d4864b8
Integrate custom first page
bubbaandy89 Jan 4, 2023
9614fff
Fix enter link
bubbaandy89 Jan 4, 2023
dc2e7d1
Fix first page not displaying
bubbaandy89 Jan 4, 2023
1d7e612
Allow starting chat from chats page
bubbaandy89 Jan 4, 2023
54c4e89
Update about.html
SpitfireTN Jan 4, 2023
f929467
Merge pull request #4 from SpitfireTN/patch-1
bubbaandy89 Jan 4, 2023
3442ba6
Update about.html
SpitfireTN Jan 5, 2023
48b976a
Fix timezone in participant view
bubbaandy89 Jan 5, 2023
04ffa90
Set image sizes to fluid
bubbaandy89 Jan 5, 2023
95d9268
Update Horizontal Rule Color
bubbaandy89 Jan 5, 2023
309d594
Images open fullsize when clicked
bubbaandy89 Jan 5, 2023
2aadbc4
Images clickable on home
bubbaandy89 Jan 5, 2023
d6a1d2c
Merge pull request #5 from SpitfireTN/patch-3
bubbaandy89 Jan 5, 2023
d5741c7
Mark notifications read or unread
bubbaandy89 Jan 5, 2023
da84666
Merge branch 'main' of https://github.com/bubbaandy89/Django_Social_N…
bubbaandy89 Jan 5, 2023
8523518
Adding Notifications count badge
bubbaandy89 Jan 5, 2023
9fa11e9
Bugfix for notifications count
bubbaandy89 Jan 5, 2023
6e71023
Fix participation buttons
bubbaandy89 Jan 5, 2023
0ef11e5
Hide participation button for unverified
bubbaandy89 Jan 5, 2023
3bc97ce
add event description to explore page
bubbaandy89 Jan 5, 2023
c4aed8f
Fixing verbiage
bubbaandy89 Jan 5, 2023
edc8aae
Use fluid images for posters
bubbaandy89 Jan 5, 2023
73dce34
Add more details to users column
bubbaandy89 Jan 6, 2023
20bf3f5
Set loglevel to info for gunicorn
bubbaandy89 Jan 6, 2023
a51fbfb
Add link to members list
bubbaandy89 Jan 6, 2023
bb88dfa
Add notifications count for chats
bubbaandy89 Jan 6, 2023
67e96d7
Add profiles and events to searchables
bubbaandy89 Jan 6, 2023
fef6a12
Fix exception when no chats
bubbaandy89 Jan 6, 2023
5666d1c
Adding new default img
bubbaandy89 Jan 6, 2023
c3a1d18
Moving image upload to last field
bubbaandy89 Jan 6, 2023
70acb24
Update login.html
SpitfireTN Jan 7, 2023
5f6960e
Update login.html
SpitfireTN Jan 7, 2023
bfa36fe
Update register.html
SpitfireTN Jan 7, 2023
ab543fd
Update first.html
SpitfireTN Jan 7, 2023
bc732b3
Update forms.py
SpitfireTN Jan 7, 2023
fa1f66b
Fix user id participating bug
bubbaandy89 Jan 8, 2023
c37c108
Merge branch 'main' of https://github.com/bubbaandy89/Django_Social_N…
bubbaandy89 Jan 8, 2023
9ffba96
fixing icontains bugs
bubbaandy89 Jan 9, 2023
1a239a9
Move event tables to seperate file
bubbaandy89 Jan 9, 2023
7b55b11
Show participants count in dashboard
bubbaandy89 Jan 9, 2023
e4db3ee
Rework profiles list a bit
bubbaandy89 Jan 9, 2023
9828ebb
Add detail to participant list
bubbaandy89 Jan 9, 2023
c5f9c36
Adjust formatting on explore events page
bubbaandy89 Jan 9, 2023
bad3d54
events dashboard table formatting
bubbaandy89 Jan 9, 2023
11f6d51
Add users count to members page
bubbaandy89 Jan 9, 2023
1d3ded6
Change pagination button color
bubbaandy89 Jan 9, 2023
012fa79
Paginate User Profile List
bubbaandy89 Jan 9, 2023
3ee8096
Fix user count for pagination
bubbaandy89 Jan 9, 2023
a50ea6e
Require unique email addresses
bubbaandy89 Jan 9, 2023
5e87ec1
Create ban/block list for emails
bubbaandy89 Jan 9, 2023
ed35061
Expire session when user closes browser
bubbaandy89 Jan 12, 2023
28c772e
Fix Password Reset functionality
bubbaandy89 Jan 12, 2023
87004df
Add comment/like to post feed inline
bubbaandy89 Jan 12, 2023
5b59cf3
Improve comment like/reply
bubbaandy89 Jan 13, 2023
b2fa8d4
Fix display of block in admin
bubbaandy89 Jan 13, 2023
f24a1c7
Add Shoutbox to Chats
bubbaandy89 Jan 17, 2023
6c54b5a
Fix shoutbox joining
bubbaandy89 Jan 17, 2023
3eae963
bugfix for shoutbox staff lookup
bubbaandy89 Jan 17, 2023
169e578
Shoutbox rendering improvements
bubbaandy89 Jan 17, 2023
e9157e9
Explicit elif for receiver msg
bubbaandy89 Jan 17, 2023
00bab3e
Auto scroll on new msg
bubbaandy89 Jan 17, 2023
bcb07c1
scroll to bottom of shoutbox on load
bubbaandy89 Jan 17, 2023
6e87cb7
Update about.html
SpitfireTN Jan 28, 2023
a902635
Update login.html
SpitfireTN Jan 29, 2023
b1b6727
Normalize user param in shoutbox
bubbaandy89 Jan 31, 2023
79245b7
add django-imagekit to deps
bubbaandy89 Jan 31, 2023
f909c99
Further lock down unverified routes
bubbaandy89 Jan 31, 2023
64e359d
Removing unused import
bubbaandy89 Jan 31, 2023
e4dccac
Further lockdown of unverified
bubbaandy89 Jan 31, 2023
570664c
Fixing bad super calls
bubbaandy89 Jan 31, 2023
3e47cad
Fix 500 error on view participants
bubbaandy89 Feb 1, 2023
667794b
Update chat admin formatting
bubbaandy89 Feb 16, 2023
e903240
Add Admins to settings
bubbaandy89 Feb 19, 2023
07bffa2
Fix for users profile throwing 500 on edit
bubbaandy89 Feb 20, 2023
8a3b4ae
Update requirements for image protect
bubbaandy89 Mar 1, 2023
425071e
Adding multi-images to posts
bubbaandy89 Mar 1, 2023
cb9328c
Slight change to images model name
bubbaandy89 Mar 1, 2023
e63589d
Update about.html
SpitfireTN Apr 19, 2023
698741b
Update about.html
SpitfireTN Apr 19, 2023
7727ae5
Add helper method for image perm
bubbaandy89 Jul 22, 2023
80d6b7e
Authorize users to see post images
bubbaandy89 Jul 22, 2023
abae56f
Add admin portal link to navbar
bubbaandy89 Jul 22, 2023
e3facc0
bump psycopg2 MV
bubbaandy89 Sep 17, 2023
c99a0a3
switch to binary version of psycopg2
bubbaandy89 Sep 17, 2023
90c4af2
Update Pillow to 9.3.0
bubbaandy89 Sep 17, 2023
97a723e
Update install steps
bubbaandy89 Sep 17, 2023
34a0453
bump cffi to 1.15.1
bubbaandy89 Sep 17, 2023
c044c51
bump certifi to 2022.12.7
bubbaandy89 Sep 17, 2023
bad0025
Update Django and Daphne versions
bubbaandy89 Sep 17, 2023
1d93d65
more documentation updates
bubbaandy89 Sep 17, 2023
25d350f
update dotenv version
bubbaandy89 Sep 17, 2023
0c4ced7
config updates
bubbaandy89 Sep 17, 2023
92c6a00
centralize user verification check
bubbaandy89 Sep 17, 2023
0974b6a
update loggers for debug
bubbaandy89 Sep 17, 2023
b05b699
Dependency updates
bubbaandy89 Dec 2, 2023
59cb4fc
Remove STATICFILES_DIRS
bubbaandy89 Dec 2, 2023
226ed06
Update Setup Documentation
bubbaandy89 Dec 2, 2023
b5eb4d6
Add custom exception handlers
bubbaandy89 Dec 2, 2023
07f15dd
handle img failures
bubbaandy89 Dec 2, 2023
08f2c74
type hint correction
bubbaandy89 Mar 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@ dmypy.json

# Pyre type checker
.pyre/
media/post_images/*
media/thumbnails/*
static/*
protected/*
5 changes: 4 additions & 1 deletion .test.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ EMAIL_USER=your_email
EMAIL_PASS=your_email_password
EMAIL_PORT=587
AGORA_APP_ID=
AGORA_APP_CERTIFICATE=
AGORA_APP_CERTIFICATE=
LOGS_DIR_NAME=logs
DEBUG_LOG_FILE_NAME=debug.log
DAPHNE_LOG_FILE_NAME=daphne.log
Empty file added EventManager/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions EventManager/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for EventManager project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'EventManager.settings')

application = get_asgi_application()
145 changes: 145 additions & 0 deletions EventManager/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
"""
Django settings for EventManager project.

Generated by 'django-admin startproject' using Django 3.1.4.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""

import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ""

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
"Home.apps.HomeConfig",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"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 = "EventManager.urls"

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(BASE_DIR, "templates")],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]

WSGI_APPLICATION = "EventManager.wsgi.application"


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

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}


# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]


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

LANGUAGE_CODE = "en-us"

TIME_ZONE = "America/New_York"

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = "/static/"
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
STATIC_ROOT = os.path.join(BASE_DIR, "assets")

PASSWORD_HASHERS = [
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
"django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
"django.contrib.auth.hashers.Argon2PasswordHasher",
]

# EMAIL_HOST = "smtp.gmail.com"

# EMAIL_USE_TLS = True

# EMAIL_PORT = 587

# change these fields for enabling email feature
# EMAIL_HOST_USER = ""
# EMAIL_HOST_PASSWORD = ""

# change these fields for enabling phone messages feature
# TWILIO_ACCOUNT_SID = ""
# TWILIO_AUTH_TOKEN = ""
# TWILIO_NUMBER = ""
25 changes: 25 additions & 0 deletions EventManager/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""EventManager URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path

app_name = "eventmanager"

urlpatterns = [
path("", include("events.urls"), name="eventmanager-root"),
path("..", include("myproject.urls", namespace="dsn"), name="dsn-root"),
path("admin/", admin.site.urls),
]
16 changes: 16 additions & 0 deletions EventManager/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for EventManager project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'EventManager.settings')

application = get_wsgi_application()
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ A social media web-application with Django.
<li>Chats using websockets</li>
<li>Video Calls</li>

## Demo (Not up-to-date)


https://user-images.githubusercontent.com/64803043/118666705-02735600-b811-11eb-80f9-445bbe6e55c9.mp4


<a href="./demo/demo1.mp4">Video Link</a>

## Adding env variables

- Add env variables to ".test.env" and rename it to ".env"
Expand All @@ -33,13 +25,14 @@ https://user-images.githubusercontent.com/64803043/118666705-02735600-b811-11eb-
## Installation

```bash
$ sudo apt-get install build-essential autoconf libtool libffi-dev pkg-config python3-dev python3-setuptools python3-testresources
$ python -m venv venv
$ source venv/Scripts/activate
$ source venv/bin/activate
(venv) pip install -r requirements.txt
(venv) cd Django_Social_Network_App
(venv) python manage.py makemigrations
(venv) python manage.py migrate
(venv) python manage.py createsuperuser
(venv) python manage.py collectstatic
(venv) python manage.py runserver
```

Expand Down
4 changes: 3 additions & 1 deletion blog/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.contrib import admin
from .models import Comment, Post

from .models import Comment, Images, Post

admin.site.register(Post)
admin.site.register(Comment)
admin.site.register(Images)
3 changes: 2 additions & 1 deletion blog/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.apps import AppConfig


class BlogConfig(AppConfig):
name = 'blog'
name: str = "blog"
39 changes: 35 additions & 4 deletions blog/forms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
import logging

from django import forms
from django.forms import fields, widgets
from .models import Post, Comment

from .models import Comment, Images, Post # noqa: F401


class CreateUpdatePostForm(forms.ModelForm):
images = forms.ImageField(widget=forms.FileInput(attrs={"multiple": True}), required=False)

class Meta:
model = Post
exclude = ["date_posted", "date_updated", "author", "likes", "saves", "image"]

def post(self, request, *args, **kwargs):
logging.debug(f"{dir(request)}")
form_class = self.get_form_class()
form = self.get_form(form_class)
images = request.FILES.getlist("images")
if form.is_valid():
for image in images:
Images.objects.create(post=form.instance.post.pk, image=image)
return self.form_valid(form)
else:
return self.form_invalid(form)


class CommentForm(forms.ModelForm):
body = forms.CharField(widget=forms.Textarea(attrs={'class':'form-control custom-txt','cols':'40','rows':'3'}), label='')
body: forms.CharField = forms.CharField(
widget=forms.Textarea(
attrs={"class": "form-control custom-txt", "cols": "40", "rows": "3"}
),
label="",
)

class Meta:
model = Comment
fields = ['body',]
fields: list[str] = [
"body",
]