Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Upgraded to Django 1.4.2 and changed to the new project structure. #1

Merged
merged 4 commits into from

2 participants

@klynton

I've updated all of the references to the modules and the web apps functions as before I made changes. (I did change the port in line 16 of the settings.py file to 8091 instead of the 8098. Every request was a "connection refused" error without that change.

klynton added some commits
@klynton klynton Updating to Django 1.4.2's new project structure and fixing imports f…
…or new structure.
ef0e927
@klynton klynton Fixed other references to the apps directly instead of through the pr…
…oject. Updated the port in settings.py to 8091 (8098 doesn't seem to work when following the fast-track instructions).
6b8267c
@klynton klynton Adding the new project directory. 53babd4
django_riak.py
@@ -9,7 +9,7 @@
class SessionStore(SessionBase):
def __init__(self, session_key=None):
- RIAK_PORT = getattr(settings, 'RIAK_PORT', 8087)
+ RIAK_PORT = getattr(settings, 'RIAK_PORT', 8091)
@seancribbs Owner

This port will be wrong if using PBC (even if you're using a devrel locally).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@klynton

@seancribbs Sorry about that, spent the last weekend moving and then with the holiday I got a minute to do this. :)

@seancribbs
Owner

Cool. Sorry for the delay on merging, I got stuck doing C drivers for Erlang this past week.

@seancribbs seancribbs merged commit d226693 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 13, 2012
  1. @klynton
  2. @klynton

    Fixed other references to the apps directly instead of through the pr…

    klynton authored
    …oject. Updated the port in settings.py to 8091 (8098 doesn't seem to work when following the fast-track instructions).
  3. @klynton
Commits on Nov 25, 2012
  1. @klynton
This page is out of date. Refresh to see the latest.
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()
Something went wrong with that request. Please try again.