Skip to content

Commit e1d2640

Browse files
authored
Merge pull request #81 from LaurierCS/minor_changes_v1
Minor changes v1
2 parents bf6aae6 + 7d2cf3b commit e1d2640

File tree

7 files changed

+59
-25
lines changed

7 files changed

+59
-25
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Django = "==3.1.5"
6262
ipython_genutils = "==0.2.0"
6363
Pillow = "==8.3.2"
6464
Pygments = "==2.9.0"
65+
python-dotenv = "*"
6566

6667
[dev-packages]
6768

Pipfile.lock

Lines changed: 43 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Wampus/settings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414
import environ
1515
import django_heroku
1616
from pathlib import Path
17+
from dotenv import load_dotenv, find_dotenv
1718

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

21-
2222
# Quick-start development settings - unsuitable for production
2323
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
2424

2525
# SECURITY WARNING: keep the secret key used in production secret!
26-
SECRET_KEY = 'django-insecure-socapu5gn7i#(=9k1#aby#&65j@z0)e@1#)8=1@6-2^7gp!(l4'
26+
load_dotenv(find_dotenv())
27+
SECRET_KEY = os.environ['SECRET_KEY']
2728

2829
# SECURITY WARNING: don't run with debug turned on in production!
29-
DEBUG = True
30+
DEBUG = False
3031

3132
ALLOWED_HOSTS = []
3233
ALLOWED_HOSTS = ['127.0.0.1', '0.0.0.0', 'techunt.herokuapp.com', ]

Wampus/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
urlpatterns = [
2424
path('admin/', admin.site.urls), # Do Not Remove
25-
path('', views.homepage_view),
25+
path('', views.landing_view),
2626
path('login/', views.login_view),
27+
path('home/', views.homepage_view),
2728
path('search/', views.search_projects_view, name='search-projects'),
2829
path('logout/', views.logout_view),
2930
path('register/', views.register_view),
@@ -32,8 +33,7 @@
3233
path('profile/', views.profilepage_view),
3334
path('about-us/', views.aboutus_view),
3435
path('create-project/', views.createproject_view),
35-
path('edit-profile/', views.editprofile_view),
36-
path('landing/', views.landing_view)
36+
path('edit-profile/', views.editprofile_view)
3737
]
3838

3939
"""

app/templates/landing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="landingBackground">
2323
<img style="width: 250px; margin: 2% 0 0 4%;" src="../static/images/Logo.png">
2424
<div class="landingInfo">
25-
<h1 style="font-size:xx-large;font-family: Lora;color: #FFFFFF;font-style: italic;">A CATCHY SENTENCE HERE</h1>
25+
<h1 style="font-size:xx-large;font-family: Lora;color: #FFFFFF;">Welcome!</h1>
2626
<a style="font-size:large;font-family: Karla;color: #868686;font-weight: lighter;">
2727
Tech Hunt gives you chance to connect with the people worldwide, to collaborate on projects they have created and/or you have created, in a quick and simple way. Find the right projects and find the right people.
2828
</a>

app/views.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def login_view(request):
1414

1515
# If the user is already logged in, redirect to homepage
1616
if request.user.is_authenticated:
17-
return redirect('/')
17+
return redirect('/homepage/')
1818

1919
# Get user input from the login form
2020
if request.method == 'POST':
@@ -27,7 +27,7 @@ def login_view(request):
2727
# If the user is authenticated, log them in
2828
if user is not None:
2929
login(request, user)
30-
return redirect('/')
30+
return redirect('/homepage/')
3131

3232
else: # If the user is not authenticated, show an error message
3333
messages.error(request, 'Invalid username or password')
@@ -49,7 +49,7 @@ def register_view(request):
4949
if form.is_valid():
5050
user = form.save() # If the form is valid, save the user
5151
login(request, user) # Log the user in
52-
return redirect('/') # Redirect to homepage
52+
return redirect('/homepage/') # Redirect to homepage
5353

5454
context = {'form': form }
5555

@@ -86,7 +86,7 @@ def search_projects_view(request):
8686
profile = Profile.objects.get(user=user) # Get the user's profile
8787

8888
if request.method == "GET":
89-
return redirect('/')
89+
return redirect('/homepage/')
9090

9191
if request.method == "POST":
9292
search_value = request.POST['search_value']
@@ -209,7 +209,7 @@ def deleteproject_view(request, project_id):
209209
project.delete()
210210
return redirect('/profile')
211211
else:
212-
return redirect('/')
212+
return redirect('/homepage/')
213213

214214
template_name = 'delete-project.html'
215215

@@ -257,18 +257,7 @@ def editprofile_view(request):
257257
return render(request, template_name, context)
258258

259259
def landing_view(request):
260-
object1 = """Some object queried from the Database,
261-
maybe a project or set of project objects"""
262-
263-
context = {
264-
# You place objects in here that you want to bring
265-
# to the front end. You do it just by adding them
266-
# to this dictionary commonly called context -
267-
# simply store key and value pairs
268-
# For example:
269-
'object1': object1
270-
}
271260

272261
template_name = 'landing.html'
273262

274-
return render(request, template_name, context)
263+
return render(request, template_name)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ urllib3==1.26.2
5656
wcwidth==0.2.5
5757
whitenoise==5.2.0
5858
wrapt==1.12.1
59+
python-dotenv==0.19.2

0 commit comments

Comments
 (0)