Skip to content

Commit

Permalink
Update deployment workflow and form validation
Browse files Browse the repository at this point in the history
- Add informative echo statements to deployment script for better logging
- Modify login URL in QuizApp to use trailing slash
- Add required attribute to contact and profile form inputs
- Mark required fields with asterisk (*) in HTML templates
  • Loading branch information
NagiPragalathan committed Feb 9, 2025
1 parent 0f78d2c commit 036d321
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 11 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,35 @@ jobs:
run: |
ssh -o StrictHostKeyChecking=no root@147.93.102.113 << 'EOF'
cd /var/www/Community_Management # Navigate to your Django project directory
echo "Starting deployment..."
# Kill any process using port 80 (development server port)
fuser -k 80/tcp || true # Ignore error if port isn't in use
echo "Killed any processes using port 80"
# Set up virtual environment
python3 -m venv venv
source venv/bin/activate # Activate virtual environment
# Pull the latest code from GitHub
git pull origin main
echo "Pulled latest code from GitHub"
# Install the dependencies from the updated code
pip install -r requirements.txt
# Run database migrations
python manage.py migrate
echo "Ran database migrations"
# Run the Django development server in the background (not recommended for production)
nohup python manage.py runserver 0.0.0.0:80 > server.log 2>&1 &
echo "Started Django development server"
EOF
Binary file modified QuizApp/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file modified QuizApp/__pycache__/urls.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion QuizApp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
path('enter_otp', enter_otp, name='enter_otp'),
# path('signup/<str:mail>', signup, name='signup'),
path('signup', signup, name='signup'),
path('login', user_login, name='login'),
path('login/', user_login, name='login'),
path('change_password', change_password, name='change_password'),
path('forgot_password', forgot_password, name='forgot_password'),
path('logout', logout_view, name='logout'),
Expand Down
Binary file modified base/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file modified base/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file modified base/form/__pycache__/forms.cpython-312.pyc
Binary file not shown.
Binary file modified base/templatetags/__pycache__/djtemp.cpython-312.pyc
Binary file not shown.
Binary file modified base/views/__pycache__/common.cpython-312.pyc
Binary file not shown.
Binary file modified base/views/__pycache__/connections.cpython-312.pyc
Binary file not shown.
8 changes: 4 additions & 4 deletions templates/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">Contact
</div>

<div class="sm:col-span-2">
<label for="email" class="block text-sm font-medium leading-6 text-gray-900">Email address</label>
<label for="email" class="block text-sm font-medium leading-6 text-gray-900">Email address *</label>
<div class="mt-2">
<input type="email" name="email" id="email" autocomplete="email" required class="block w-full rounded-lg border-0 px-4 py-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm">
<input required type="email" name="email" id="email" autocomplete="email" required class="block w-full rounded-lg border-0 px-4 py-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm">
</div>
</div>

<div class="sm:col-span-2">
<label for="phone-number" class="block text-sm font-medium leading-6 text-gray-900">Phone number</label>
<label for="phone-number" class="block text-sm font-medium leading-6 text-gray-900">Phone number *</label>
<div class="mt-2">
<input type="tel" name="phone_number" id="phone-number" autocomplete="tel" class="block w-full rounded-lg border-0 px-4 py-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm">
<input required type="tel" name="phone_number" id="phone-number" autocomplete="tel" class="block w-full rounded-lg border-0 px-4 py-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm">
</div>
</div>

Expand Down
15 changes: 9 additions & 6 deletions templates/custom_admin/chapter/profile/profile_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,16 @@ <h2 class="text-2xl font-bold text-gray-900">{% if profile %}Edit{% else %}Creat
</div>

<div>
<label for="first_name" class="block text-sm font-medium text-gray-700">First Name</label>
<input type="text" id="first_name" name="first_name" class="mt-2 px-4 py-3 focus:ring-blue-500 focus:border-blue-500 block w-full shadow-sm sm:text-sm border-2 border-gray-200 rounded-lg" value="{% if profile %}{{ profile.first_name }}{% endif %}">
<label for="first_name" class="block text-sm font-medium text-gray-700">First Name *</label>
<input required type="text" id="first_name" name="first_name" class="mt-2 px-4 py-3 focus:ring-blue-500 focus:border-blue-500 block w-full shadow-sm sm:text-sm border-2 border-gray-200 rounded-lg" value="{% if profile %}{{ profile.first_name }}{% endif %}">

</div>


<div>
<label for="last_name" class="block text-sm font-medium text-gray-700">Last Name</label>
<input type="text" id="last_name" name="last_name" class="mt-2 px-4 py-3 focus:ring-blue-500 focus:border-blue-500 block w-full shadow-sm sm:text-sm border-2 border-gray-200 rounded-lg" value="{% if profile %}{{ profile.last_name }}{% endif %}">
<label for="last_name" class="block text-sm font-medium text-gray-700">Last Name *</label>
<input required type="text" id="last_name" name="last_name" class="mt-2 px-4 py-3 focus:ring-blue-500 focus:border-blue-500 block w-full shadow-sm sm:text-sm border-2 border-gray-200 rounded-lg" value="{% if profile %}{{ profile.last_name }}{% endif %}">

</div>

<div>
Expand Down Expand Up @@ -128,8 +131,8 @@ <h2 class="text-2xl font-bold text-gray-900">{% if profile %}Edit{% else %}Creat
</div>

<div>
<label for="membership_status" class="block text-sm font-medium text-gray-700">Membership Status</label>
<select id="membership_status" name="membership_status" class="mt-2 block w-full px-4 py-3 text-base border-2 border-gray-200 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-lg">
<label for="membership_status" class="block text-sm font-medium text-gray-700">Membership Status *</label>
<select required id="membership_status" name="membership_status" class="mt-2 block w-full px-4 py-3 text-base border-2 border-gray-200 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-lg">
<option value="Active" {% if profile and profile.membership_status == 'Active' %}selected{% endif %}>Active</option>
<option value="Not Active" {% if profile and profile.membership_status == 'Not Active' %}selected{% endif %}>Not Active</option>
</select>
Expand Down

0 comments on commit 036d321

Please sign in to comment.