Diff
30 Oct 2009
 
 
 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# HG changeset patch
# User Alexander Solovyov <piranha@piranha.org.ua>
# Date 1256908459 -7200
# Node ID db9415c0f8c1a1132db3f78c39473dd7dc1fa919
# Parent 7bb6e617eb95e3b3344ae5acd8b77b5eab5dca56
add defaults, remove usage of md5
diff --git a/src/shopium/application.py b/src/shopium/application.py
--- a/src/shopium/application.py
+++ b/src/shopium/application.py
@@ -234,7 +234,7 @@ def make_app(config):
from shopium.session import InMemorySessionStore
from werkzeug.contrib.cache import NullCache, SimpleCache, MemcachedCache
- cache_type = config.get('cache_type').lower().strip()
+ cache_type = config.get('cache_type', 'none').lower().strip()
if cache_type == 'none':
cache = NullCache()
elif cache_type == 'simple':
@@ -250,16 +250,20 @@ def make_app(config):
# werkzeug.setLevel(logging.INFO)
# import locale
# locale.setlocale(locale.LC_ALL, 'uk_UA.utf-8')
-
- return ShopiumApplication(config['db_uri'],
- config['amqp_uri'],
+
+ return ShopiumApplication(config['db_uri'],
+ config.get('amqp_uri',
+ 'amqp://guest:guest@localhost:5672/'),
InMemorySessionStore(),
cache,
- base_domain=config['base_domain'],
+ base_domain=config['base_domain'],
media_hosts=config.as_list('media_hosts'),
- static_root=config['static_root'],
- storage_root=config['storage_root'],
- admin_root=config['admin_root'],
+ static_root=config.get('static_root',
+ '$BASE_PATH/static'),
+ storage_root=config.get('storage_root',
+ '$BASE_PATH/storage'),
+ admin_root=config.get('admin_root',
+ '$BASE_PATH/admin'),
secret_key=config['secret_key'],
debug=debug)
diff --git a/src/shopium/shop/models.py b/src/shopium/shop/models.py
--- a/src/shopium/shop/models.py
+++ b/src/shopium/shop/models.py
@@ -8,7 +8,7 @@ from sqlalchemy.orm.collections import c
attribute_mapped_collection
from sqlalchemy.ext.associationproxy import association_proxy
from shopium.themes.models import ShopTheme
-import md5
+import hashlib
import datetime
import marshal
@@ -94,7 +94,7 @@ class Staff(BaseModel):
self.password = self._hash_password(pwd)
def _hash_password(self, pwd):
- return md5.new(application.secret_key + pwd.encode('utf-8')).hexdigest()
+ return hashlib.md5(application.secret_key + pwd.encode('utf-8')).hexdigest()
def __repr__(self):
return u'Staff(%r, %r, %r, %r)' % (self.id, self.email, self.first_name, self.last_name)
diff --git a/webshops.ini.sample b/webshops.ini.sample
--- a/webshops.ini.sample
+++ b/webshops.ini.sample
@@ -3,6 +3,7 @@ db_uri=postgres://shopium:shopium@localh
base_domain=dev.shopium.in.ua:5000
secret_key=232fd930-7786-4373-9622-a27c66598703
debug=True
+media_hosts=
[testing]
db_uri=postgres://shopium:shopium@localhost/shopium