Skip to content

Commit d15f9e3

Browse files
committed
Fixed slider and initial db conection
1 parent 61700f0 commit d15f9e3

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Assuming you're on debian like OS
2121

2222
```bash
2323
sudo apt-get update && sudo apt-get upgrade
24-
sudo apt-get install python-dev python-pip
24+
sudo apt-get install python-dev python-pip libpq-dev
2525
sudo pip install virtualenv virtualenvwrapper requests[security]
2626

2727
source /usr/local/bin/virtualenvwrapper.sh
@@ -32,7 +32,8 @@ now, go to project folder and then run
3232

3333
```bash
3434
cd webpage
35-
pip install -r requirements-dev.txt
35+
pip install -r requirements.txt
36+
source /usr/local/bin/virtualenvwrapper.sh
3637
workon network_lab
3738
./manage.py runserver
3839
```
@@ -56,8 +57,15 @@ If you're not familiar with django model system, take a look
5657

5758
If you want to make changes to models, and reflex in database, please do
5859
```
59-
./manage.py makemigrations appname
60-
./manage.py migrate
60+
rm db.sqlite3
61+
python manage.py makemigrations
62+
python manage.py migrate
63+
```
64+
65+
### Loading data
66+
67+
```
68+
./manage.py loaddata db2.json
6169
```
6270

6371
Enjoy Coding!

webpage/applications/index/templates/index/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h3>Events</h3>
127127
<div class="container" data-animation="true" data-animation-type="fadeInUp">
128128
<h2 class="content-title">Team</h2>
129129
<!-- begin carousel -->
130-
<div class="carousel testimonials slide" data-ride="carousel" id="testimonials">
130+
<div class="carousel testimonials slide" data-ride="carousel" id="testimonials2">
131131
<!-- begin carousel-inner -->
132132
<div class="carousel-inner text-center">
133133
{% for paired in paired_members %}
@@ -186,9 +186,9 @@ <h3 class="name">{{ member.name }}</h3>
186186
<ol class="carousel-indicators">
187187
{% for paired in paired_members %}
188188
{% if forloop.first %}
189-
<li data-target="#testimonials" data-slide-to="0" class="active"></li>
189+
<li data-target="#testimonials2" data-slide-to="0" class="active"></li>
190190
{% else %}
191-
<li data-target="#testimonials" data-slide-to="{{ forloop.counter0 }}" class=""></li>
191+
<li data-target="#testimonials2" data-slide-to="{{ forloop.counter0 }}"></li>
192192
{% endif %}
193193
{% endfor %}
194194
</ol>

webpage/page/settings.py

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -92,39 +92,28 @@
9292
# Database
9393
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
9494

95-
# SQLITE = {
96-
# 'default': {
97-
# 'ENGINE': 'django.db.backends.sqlite3',
98-
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
99-
# }
100-
# }
101-
102-
# try:
103-
# POSTGRES = {
104-
# 'default': {
105-
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
106-
# 'NAME': os.environ['DB_NAME'],
107-
# 'USER': os.environ['DB_USER'],
108-
# 'PASSWORD': os.environ['DB_PASS'],
109-
# 'HOST': os.environ['DB_SERVICE'],
110-
# 'PORT': os.environ['DB_PORT']
111-
# }
112-
# }
113-
# except KeyError:
114-
# POSTGRES = None
115-
116-
# DATABASES = POSTGRES if PRODUCTION else SQLITE
117-
118-
DATABASES = {
95+
SQLITE = {
96+
'default': {
97+
'ENGINE': 'django.db.backends.sqlite3',
98+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
99+
}
100+
}
101+
102+
try:
103+
POSTGRES = {
119104
'default': {
120105
'ENGINE': 'django.db.backends.postgresql_psycopg2',
121-
'NAME': 'lascilab',
122-
'USER': 'lascilab',
123-
'PASSWORD': 'lascilab',
124-
'HOST': '172.18.02',
125-
'PORT': '5432'
106+
'NAME': os.environ['DB_NAME'],
107+
'USER': os.environ['DB_USER'],
108+
'PASSWORD': os.environ['DB_PASS'],
109+
'HOST': os.environ['DB_SERVICE'],
110+
'PORT': os.environ['DB_PORT']
126111
}
127112
}
113+
except KeyError:
114+
POSTGRES = None
115+
116+
DATABASES = SQLITE #POSTGRES if PRODUCTION else SQLITE
128117

129118

130119
# Password validation

0 commit comments

Comments
 (0)