Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to deployment and a bug fix for latest Django #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
dist/
django_js_utils.egg-info/
2 changes: 1 addition & 1 deletion django_js_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Version string following PEP 386
# http://www.python.org/dev/peps/pep-0386/
__version__ = "0.1"
__version__ = "0.1-aio"
10 changes: 7 additions & 3 deletions django_js_utils/management/commands/js_urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import sys
import re
from django.core.exceptions import ImproperlyConfigured
from types import ModuleType

from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.core.management.base import BaseCommand
from django.utils import simplejson
import json
from django.utils.datastructures import SortedDict
from django.conf import settings

Expand All @@ -30,7 +31,7 @@ def handle(self, *args, **options):
#output to the file
urls_file = open(URLS_JS_GENERATED_FILE, "w")
urls_file.write("dutils.conf.urls = ")
simplejson.dump(js_patterns, urls_file)
json.dump(js_patterns, urls_file)
print "Done generating Javascript urls file %s" % URLS_JS_GENERATED_FILE

@staticmethod
Expand All @@ -43,6 +44,9 @@ def handle_url_module(js_patterns, module_name, prefix=""):
__import__(module_name)
root_urls = sys.modules[module_name]
patterns = root_urls.urlpatterns
elif isinstance(module_name, ModuleType):
root_urls = module_name
patterns = root_urls.urlpatterns
else:
root_urls = module_name
patterns = root_urls
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def find_version(*file_paths):
# maintainer_email='',
# url='',
packages=find_packages(),
package_data={'django_js_utils': ['static/js/*.js']},
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
Expand All @@ -45,4 +46,4 @@ def find_version(*file_paths):
# install_requires=[
#
# ],
)
)