Skip to content

Commit 083c7d1

Browse files
authored
Merge pull request #151 from MicroPyramid/dev
enhancements
2 parents aed0065 + 4ed938c commit 083c7d1

File tree

8 files changed

+68
-166
lines changed

8 files changed

+68
-166
lines changed

ENV.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
21
# Environment variables guidelines
32

3+
- All environment variables defined below and their usage.
4+
- Kindly add below environment variables to your local development with appropriate key/value accordingly.
45

56
## Common keys
67

78
DEBUG=True/False
8-
SECRET_KEY="kaljoi uJFVK356"
9-
HTML_MINIFY=False
10-
ENV_TYPE="DEV/PROD"
11-
DEFAULT_FROM_EMAIL=''
12-
CONTACT_NUMBER=''
13-
PEEL_URL=""
9+
SECRET_KEY=""
10+
HTML_MINIFY=True/False
11+
ENV_TYPE="DEV" or "PROD"
12+
DEFAULT_FROM_EMAIL='PeelJobs <[email protected]>'
13+
CONTACT_NUMBER='850 009 9499'
14+
PEEL_URL="http://peeljobs.com/"
1415
CACHE_BACKEND = "memcached://127.0.0.1:11211/"
1516
MINIFIED_URL=''
1617

@@ -23,8 +24,7 @@ CELERY_BROKER_URL='redis://localhost:6379/1'
2324

2425
GOOGLE_CLIENT_ID=""
2526
GOOGLE_CLIENT_SECRET=""
26-
GOOGLE_LOGIN_HOST='http://localhost:8000/'
27-
GOOGLE_MAPS_API_KEY=""
27+
GOOGLE_LOGIN_HOST='http://localhost:8000'
2828
## Elasticsearch keys
2929

3030
HAYSTACKURL='http://127.0.0.1:9200/'

Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ sorl-thumbnail = "==12.9.0"
2424
twython = "==3.9.1"
2525
dj-rest-auth = "==2.2.5"
2626
pyjwt = "==2.5.0"
27+
pytz = "==2025.1"
2728
djangorestframework = "==3.15.2"
2829
djangorestframework-simplejwt = "==5.5.0"
2930
sentry-sdk = "==2.22.0"

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ pip-check -H # to see upgradable packages
3838
Following are the setup instruction for ubuntu 20.04.
3939

4040
```bash
41-
sudo apt install git postgresql python3 python3-dev python3-virtualenv build-essential ruby ruby-dev gem redis-server memcached redis-tools -y
42-
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
41+
sudo apt install git postgresql python3 python3-dev python3-virtualenv build-essential ruby ruby-dev gem redis-server memcached redis-tools virtualenv apt-transport-https ca-certificates curl software-properties-common gcc g++ make -y
42+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
4343
sudo apt-get install -y nodejs
44-
sudo apt-get install node-less
44+
sudo npm install -g less
4545
```
4646

4747
### Install and configure sass and less compilers
@@ -69,7 +69,18 @@ add the following to your path
6969
##### Install requirements
7070

7171
```bash
72+
cp env.md .env
73+
sed -i 's/^SECRET_KEY=.*/SECRET_KEY="'$(openssl rand -base64 50 | tr -d '\n' | tr -d '=')'"/' .env
7274
pipenv install -d
75+
python manage.py migrate
76+
python manage.py loaddata industries
77+
python manage.py loaddata qualification
78+
python manage.py loaddata skills
79+
python manage.py loaddata countries
80+
python manage.py loaddata states
81+
python manage.py loaddata cities
82+
python manage.py update_index
83+
python manage.py createsuperuser
7384
```
7485

7586
For env variables, refer to env.md in source directory and you need to create a .env file to keep all env variables with their respective values.

dashboard/urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
subscribers,
6363
view_subscribers,
6464
search_summary,
65-
applicants_mail,
65+
# applicants_mail,
6666
removing_duplicate_companies,
6767
reports,
6868
new_company,
@@ -286,7 +286,7 @@
286286
search_summary,
287287
name="search_summary",
288288
),
289-
url(r"^applicants-mails/", applicants_mail, name="applicants_mail"),
289+
# url(r"^applicants-mails/", applicants_mail, name="applicants_mail"),
290290
url(
291291
r"^update-company-jobposts/",
292292
removing_duplicate_companies,

dashboard/views.py

+39-39
Original file line numberDiff line numberDiff line change
@@ -3735,45 +3735,45 @@ def edit_company(request, company_id):
37353735
return render(request, "dashboard/company/new_company.html", {"company": company})
37363736

37373737

3738-
@permission_required("activity_edit", "activity_view")
3739-
def applicants_mail(request):
3740-
current_date = datetime.strptime(str(datetime.now().date()), "%Y-%m-%d").strftime(
3741-
"%Y-%m-%d"
3742-
)
3743-
3744-
all_mail_applicants = list(db.users.find({"date": current_date}))
3745-
3746-
items_per_page = 100
3747-
3748-
no_pages = int(math.ceil(float(len(all_mail_applicants)) / items_per_page))
3749-
page = request.POST.get("page")
3750-
if page and bool(re.search(r"[0-9]", page)) and int(page) > 0:
3751-
if int(page) > (no_pages + 2):
3752-
return HttpResponseRedirect(reverse("dashboard:applicants"))
3753-
page = int(page)
3754-
else:
3755-
page = 1
3756-
3757-
all_mail_applicants = all_mail_applicants[
3758-
(page - 1) * items_per_page : page * items_per_page
3759-
]
3760-
prev_page, previous_page, aft_page, after_page = get_prev_after_pages_count(
3761-
page, no_pages
3762-
)
3763-
3764-
return render(
3765-
request,
3766-
"dashboard/all_mail_applicants.html",
3767-
{
3768-
"all_mail_applicants": all_mail_applicants,
3769-
"aft_page": aft_page,
3770-
"after_page": after_page,
3771-
"prev_page": prev_page,
3772-
"previous_page": previous_page,
3773-
"current_page": page,
3774-
"last_page": no_pages,
3775-
},
3776-
)
3738+
# @permission_required("activity_edit", "activity_view")
3739+
# def applicants_mail(request):
3740+
# current_date = datetime.strptime(str(datetime.now().date()), "%Y-%m-%d").strftime(
3741+
# "%Y-%m-%d"
3742+
# )
3743+
3744+
# all_mail_applicants = list(db.users.find({"date": current_date}))
3745+
3746+
# items_per_page = 100
3747+
3748+
# no_pages = int(math.ceil(float(len(all_mail_applicants)) / items_per_page))
3749+
# page = request.POST.get("page")
3750+
# if page and bool(re.search(r"[0-9]", page)) and int(page) > 0:
3751+
# if int(page) > (no_pages + 2):
3752+
# return HttpResponseRedirect(reverse("dashboard:applicants"))
3753+
# page = int(page)
3754+
# else:
3755+
# page = 1
3756+
3757+
# all_mail_applicants = all_mail_applicants[
3758+
# (page - 1) * items_per_page : page * items_per_page
3759+
# ]
3760+
# prev_page, previous_page, aft_page, after_page = get_prev_after_pages_count(
3761+
# page, no_pages
3762+
# )
3763+
3764+
# return render(
3765+
# request,
3766+
# "dashboard/all_mail_applicants.html",
3767+
# {
3768+
# "all_mail_applicants": all_mail_applicants,
3769+
# "aft_page": aft_page,
3770+
# "after_page": after_page,
3771+
# "prev_page": prev_page,
3772+
# "previous_page": previous_page,
3773+
# "current_page": page,
3774+
# "last_page": no_pages,
3775+
# },
3776+
# )
37773777

37783778

37793779
def edit_job_title(request, post_id):

env.md

-103
This file was deleted.

jobsp/context_processors.py

-7
This file was deleted.

templates/dashboard/base.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,15 @@
121121
</ul>
122122
</li>
123123
<li {% if request.session.url_id == 'subscribers' %}class="active_menu"{% endif %}><a href="{% url "dashboard:subscribers" %}" class="menu_item"><i class="fa fa-bell"></i><span>Subscribe</span></a></li>
124+
{% comment %}
124125
<li {% if request.session.url_id == 'subscribers' %}class="active_menu"{% endif %}>
125126
<a><i class="fa fa-share"></i><span>Sent Mails</span></a>
126127
<ul class="sub_list">
127128
<li><a href="{% url "dashboard:applicants_mail" %}" class="menu_item"><i class='fa fa-caret-right'></i>Today's Mails</a></li>
128129
</ul>
129130
</li>
131+
{% endcomment %}
132+
130133
<li><a><i class="fa fa-medkit"></i><span>Duplicates</span></a>
131134
<ul class="sub_list">
132135
<li><a href="{% url 'dashboard:removing_duplicate_companies' %}" class="menu_item"><i class='fa fa-caret-right'></i>Company Jobposts</a></li>
@@ -191,9 +194,6 @@
191194
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js" integrity="sha512-2ImtlRlf2VVmiGZsjm9bEyhjGW4dU7B6TNwh/hx/iSByxNENtj3WVE6o/9Lj4TJeVXPi4bnOIMXFIJJAeufa0A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
192195
<!-- Select2 -->
193196
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
194-
195-
<!-- <script src="https://maps.googleapis.com/maps/api/js?key={{ GOOGLE_MAPS_API_KEY }}&libraries=places&sensor=false"
196-
type="text/javascript"></script> -->
197197
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
198198

199199
{% compress js %}

0 commit comments

Comments
 (0)