Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from klynton/master

Upgraded to Django 1.4.2 and changed to the new project structure.
  • Loading branch information...
commit d22669394f455c83ce4fd23a90f8b44733d97842 2 parents a2df1f1 + 6ee2882
@seancribbs seancribbs authored
Showing with 32 additions and 39 deletions.
  1. +1 −1  README.md
  2. +1 −1  django_riak.py
  3. +7 −15 manage.py
  4. +1 −1  requirements.txt
  5. 0  {users → riagi}/__init__.py
  6. 0  { → riagi}/forms.py
  7. 0  { → riagi}/images/__init__.py
  8. +1 −1  { → riagi}/images/forms.py
  9. 0  {users → riagi/images}/models.py
  10. +2 −2 { → riagi}/images/services.py
  11. 0  {users → riagi/images}/tests.py
  12. +1 −1  { → riagi}/images/urls.py
  13. +3 −3 { → riagi}/images/views.py
  14. +5 −4 { → riagi}/settings.py
  15. 0  { → riagi}/static/css/application.css
  16. 0  { → riagi}/static/css/screen.css
  17. 0  { → riagi}/static/ender.js
  18. 0  { → riagi}/static/images/riagi.png
  19. 0  { → riagi}/templates/500.html
  20. 0  { → riagi}/templates/home.html
  21. 0  { → riagi}/templates/images/index.html
  22. 0  { → riagi}/templates/images/mine.html
  23. 0  { → riagi}/templates/images/show.html
  24. 0  { → riagi}/templates/layout.html
  25. 0  { → riagi}/templates/users/login.html
  26. 0  { → riagi}/templates/users/signup.html
  27. +3 −3 { → riagi}/urls.py
  28. 0  { → riagi/users}/__init__.py
  29. +1 −1  { → riagi}/users/forms.py
  30. 0  {images → riagi/users}/models.py
  31. 0  { → riagi}/users/service.py
  32. 0  {images → riagi/users}/tests.py
  33. +1 −1  { → riagi}/users/urls.py
  34. +2 −2 { → riagi}/users/views.py
  35. +2 −2 { → riagi}/views.py
  36. +1 −1  { → riagi}/wsgi.py
View
2  README.md
@@ -9,7 +9,7 @@ thumbnails, image metadata, user profiles, and sessions.
The needed packages are listed in `requirements.txt`, but briefly,
they are:
-* Django 1.3
+* Django 1.4.2
* Python Imaging Library (PIL)
* Riak Python Client (`riak`)
* shortuuid
View
2  django_riak.py
@@ -31,7 +31,7 @@ def load(self):
def create(self):
while True:
- self.session_key = self._get_new_session_key()
+ self._session_key = self._get_new_session_key()
try:
self.save(must_create=True)
except CreateError:
View
22 manage.py
@@ -1,18 +1,10 @@
#!/usr/bin/env python
-from django.core.management import execute_manager
-import imp
-try:
- imp.find_module('settings') # Assumed to be in the same directory.
-except ImportError:
- import sys
- sys.stderr.write(
- "Error: Can't find the file 'settings.py' in the directory"
- + "containing %r. It appears you've customized things.\n"
- + "You'll have to run django-admin.py, passing it your "
- + "settings module.\n" % __file__)
- sys.exit(1)
-
-import settings
+import os
+import sys
if __name__ == "__main__":
- execute_manager(settings)
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "riagi.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)
View
2  requirements.txt
@@ -1,4 +1,4 @@
-Django==1.3
+Django==1.4.2
riak==1.5.1
PIL==1.1.7
shortuuid
View
0  users/__init__.py → riagi/__init__.py
File renamed without changes
View
0  forms.py → riagi/forms.py
File renamed without changes
View
0  images/__init__.py → riagi/images/__init__.py
File renamed without changes
View
2  images/forms.py → riagi/images/forms.py
@@ -1,5 +1,5 @@
from django import forms
-from images.services import ImageService
+from riagi.images.services import ImageService
class UploadForm(forms.Form):
View
0  users/models.py → riagi/images/models.py
File renamed without changes
View
4 images/services.py → riagi/images/services.py
@@ -108,8 +108,8 @@ def find(self, image_id, thumb=False):
return None
def find_all(self, user):
- images = self.riak.search(settings.RIAK_METADATA_BUCKET,
- "user:%s" % user).map(MAP_DOCID).run()
+ images = self.riak.search(settings.RIAK_METADATA_BUCKET,
+ "user:%s" % user).map(MAP_DOCID).run()
return images
def create_unique_key(self, length=6):
View
0  users/tests.py → riagi/images/tests.py
File renamed without changes
View
2  images/urls.py → riagi/images/urls.py
@@ -1,6 +1,6 @@
from django.conf.urls.defaults import patterns, url
-urlpatterns = patterns('images.views',
+urlpatterns = patterns('riagi.images.views',
url(r'^upload$', 'upload'),
url(r'^(?P<image_id>[a-zA-Z0-9]{5,6})$', 'show'),
url(r'^(?P<image_id>[a-zA-Z0-9]{5,6})\.[a-z]{3}$', 'fetch'),
View
6 images/views.py → riagi/images/views.py
@@ -2,9 +2,9 @@
from django.shortcuts import render_to_response, redirect, render
from django.template import RequestContext
-from images.forms import UploadForm
-from images.services import ImageService, ImageError
-from users.service import UserService
+from riagi.images.forms import UploadForm
+from riagi.images.services import ImageService, ImageError
+from riagi.users.service import UserService
def upload(request):
View
9 settings.py → riagi/settings.py
@@ -4,6 +4,7 @@
import pwd
import os
+
# Django settings for riagi project.
if pwd.getpwuid(os.getuid())[0] == "dotcloud":
@@ -12,7 +13,7 @@
DEBUG = False
else:
RIAK_HOST = "127.0.0.1"
- RIAK_PORT = "8098"
+ RIAK_PORT = "8087"
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -65,7 +66,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
)
-ROOT_URLCONF = 'urls'
+ROOT_URLCONF = 'riagi.urls'
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), "templates")
@@ -78,8 +79,8 @@
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
- 'images',
- 'users'
+ 'riagi.images',
+ 'riagi.users'
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
View
0  static/css/application.css → riagi/static/css/application.css
File renamed without changes
View
0  static/css/screen.css → riagi/static/css/screen.css
File renamed without changes
View
0  static/ender.js → riagi/static/ender.js
File renamed without changes
View
0  static/images/riagi.png → riagi/static/images/riagi.png
File renamed without changes
View
0  templates/500.html → riagi/templates/500.html
File renamed without changes
View
0  templates/home.html → riagi/templates/home.html
File renamed without changes
View
0  templates/images/index.html → riagi/templates/images/index.html
File renamed without changes
View
0  templates/images/mine.html → riagi/templates/images/mine.html
File renamed without changes
View
0  templates/images/show.html → riagi/templates/images/show.html
File renamed without changes
View
0  templates/layout.html → riagi/templates/layout.html
File renamed without changes
View
0  templates/users/login.html → riagi/templates/users/login.html
File renamed without changes
View
0  templates/users/signup.html → riagi/templates/users/signup.html
File renamed without changes
View
6 urls.py → riagi/urls.py
@@ -5,7 +5,7 @@
# admin.autodiscover()
urlpatterns = patterns('',
- url(r'^$', 'views.home'),
- url(r'^(images|i)/', include('images.urls')),
- url(r'^users/', include('users.urls'))
+ url(r'^$', 'riagi.views.home'),
+ url(r'^(images|i)/', include('riagi.images.urls')),
+ url(r'^users/', include('riagi.users.urls'))
)
View
0  __init__.py → riagi/users/__init__.py
File renamed without changes
View
2  users/forms.py → riagi/users/forms.py
@@ -2,7 +2,7 @@
from django import forms
from django.forms.util import ErrorList
-from users.service import UserService
+from riagi.users.service import UserService
class DivErrorList(ErrorList):
View
0  images/models.py → riagi/users/models.py
File renamed without changes
View
0  users/service.py → riagi/users/service.py
File renamed without changes
View
0  images/tests.py → riagi/users/tests.py
File renamed without changes
View
2  users/urls.py → riagi/users/urls.py
@@ -1,6 +1,6 @@
from django.conf.urls.defaults import patterns, url
-urlpatterns = patterns('users.views',
+urlpatterns = patterns('riagi.users.views',
url(r'^signup$', 'signup'),
url(r'^logout$', 'logout'),
url(r'^login$', 'login'),
View
4 users/views.py → riagi/users/views.py
@@ -2,8 +2,8 @@
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
-from users.forms import SignupForm, LoginForm
-from users.forms import DivErrorList
+from riagi.users.forms import SignupForm, LoginForm
+from riagi.users.forms import DivErrorList
def signup(request):
View
4 views.py → riagi/views.py
@@ -2,8 +2,8 @@
from django.shortcuts import render
from django.template import RequestContext
-from users.service import UserService
-from images.forms import UploadForm
+from riagi.users.service import UserService
+from riagi.images.forms import UploadForm
def home(request):
View
2  wsgi.py → riagi/wsgi.py
@@ -1,6 +1,6 @@
import os
-os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+os.environ['DJANGO_SETTINGS_MODULE'] = 'riagi.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

0 comments on commit d226693

Please sign in to comment.
Something went wrong with that request. Please try again.