pinax / pinax Goto Github PK
View Code? Open in Web Editor NEWa Django-based platform for rapidly developing websites
Home Page: http://pinaxproject.com/pinax/
a Django-based platform for rapidly developing websites
Home Page: http://pinaxproject.com/pinax/
Unlike monolithic open source projects like Django or Python, Pinax is collection of separately developed components with complex dependency relationships. In many respects, it's more akin to something like Ubuntu than a project like Django.
I'm proposing we do (potentially time-based) releases of "Pinax distributions", so there'd be (to borrow from Ubuntu's numbering) a "Pinax 16.4" which would just be a certain combination of apps, themes, and starter projects.
This would enable us to have a support policy, a minimum bar for documentation and localization, etc that just applies at the "distribution" level, not the individual app level.
Work could freely happen on apps, themes, and starter projects at any time but there'd be some documented process and timeline (TBD) to snapshot particular versions of each of these components to become a versioned Pinax distribution.
The commit notifications list seems dead for some time:
https://groups.google.com/forum/?fromgroups#!forum/pinax-updates
It is very hard to stay on top of being as responsive as we'd like when there are 60+ repos full of issues and pull requests. Yes, some are more active than others, but all issues and pull requests should receive the same level of attention and response.
We can do better but need some tooling to help things not fall between the cracks.
Part of helping us being responsive, I propose we track different metrics of responsiveness and publicly display them. In addition, displaying metrics over time will be useful in seeing how we are improving.
I envision the landing page being aggregate metrics with one or two levels of drill down (e.g. click on the "# of open issues without a response" metric to see a list of issues across all of Pinax that you can then easily click on to go see the details on GitHub).
Metrics worth tracking (as a strawman proposal):
These can be a grid of decent sized divs to be "stat boxes" of a sort.
Then we can also reveal a time-series graph showing how these metrics have performed on a monthly basis over the past 12-24 months, by clicking on each stat box. Clicking on a details link for any stat box dealing with issues or pull requests should show a table listing those issues or pull requests with GitHub links to their details.
We could host this dashboard at something like http://dashboard.pinaxproject.com/
Hi. I've been through the blog and the docs and can't find a reference for a good place to have a discussion on Pinax projects. Have I missed something or maybe we could reference a place to discuss or ask about Pinax projects
Greetings,
I'm new to pinax
and I think it's awesome. The following report could be a result of me not knowing what I'm doing. But if it's a bug, then I wanted to give as detailed report as possible.
What happened
Followed instructions to start new starter project. I've tried with several starters, eg, documents
, wiki
, account
, etc.
This works fine, eg, pinax start --dev documents mysite
completes and I can start server and view site.
All subsequent use of the pinax
command fails with the following trace:
Traceback (most recent call last):
File "/home/nick/dev/virtenvs/pindocs/bin/pinax", line 9, in <module>
load_entry_point('pinax-cli==0.4', 'console_scripts', 'pinax')()
File "/home/nick/dev/virtenvs/pindocs/local/lib/python2.7/site-packages/pkg_resources.py", line 353, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/nick/dev/virtenvs/pindocs/local/lib/python2.7/site-packages/pkg_resources.py", line 2321, in load_entry_point
return ep.load()
File "/home/nick/dev/virtenvs/pindocs/local/lib/python2.7/site-packages/pkg_resources.py", line 2053, in load
raise ImportError("%r has no %r attribute" % (entry,attr))
ImportError: <module 'pinax' from '/home/nick/dev/virtenvs/pindocs/local/lib/python2.7/site-packages/pinax/__init__.pyc'> has no 'main' attribute
What should've happened
I would expect the pinax
command to still work, eg, be able to list projects with pinax projects
.
Steps to reproduce
Versions: Ubuntu 14.04, Python 2.7.6, virtualenv 1.11.4, pinax 0.4:
lssitepackages | grep pinax_cli
pinax_cli-0.4-py2.7.egg-info
These are the steps I used to get the trace:
mkvirtualenv mysite
pip install pinax-cli
pinax start account mysite
cd mysite
chmod +x manage.py
pip install -r requirements.txt
./manage.py migrate
./manage.py loaddata sites
./manage.py runserver
Server is running, site visible at http://localhost:8000
.
Now run pinax projects
. Error should appear.
While on the zero
project everything runs smooth, on basic
setup there are failing tests right after initializing the project. It's kind of hard to be sure in your project when there are lots of fails and errors in the tests, right?
$ python manage.py test
Creating test database for alias 'default'...
...................................................................................................F....................................................................................................................................................................E............EEE..EEE.EE...FE.............................................................F....
======================================================================
ERROR: test_authenticated_password_change_view (pinax.apps.account.tests.test_change_password.ChangePasswordTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pinax/apps/account/tests/test_change_password.py", line 43, in test_authenticated_password_change_view
response = self.client.post(reverse("acct_login"), data)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
return self.request(**r)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pinax/apps/account/views.py", line 73, in login
fallback_url = reverse(settings.LOGIN_REDIRECT_URLNAME)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 391, in reverse
*args, **kwargs)))
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 337, in reverse
"arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'what_next' with arguments '()' and keyword arguments '{}' not found.
======================================================================
ERROR: testRecoverAccountBadUsername (django_openid.tests.auth_tests.AccountRecoveryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 132, in testRecoverAccountBadUsername
response = self.client.get('/openid/recover/')
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 439, in get
response = super(Client, self).get(path, data=data, **extra)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 241, in get
return self.request(**r)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 136, in get_response
response = response.render()
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 97, in render
self._set_content(self.rendered_content)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 73, in rendered_content
template = self.resolve_template(self.template_name)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 51, in resolve_template
return loader.get_template(template)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 157, in get_template
template, origin = find_template(template_name)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: django_openid/recover.html
======================================================================
ERROR: testRecoverAccountByUsername (django_openid.tests.auth_tests.AccountRecoveryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 147, in testRecoverAccountByUsername
'recover': 'noopenids'
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
return self.request(**r)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/consumer.py", line 157, in __call__
return router(request, path_override = rest_of_url)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 67, in __call__
return self.handle(request, path_override)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 64, in handle
return callback(request, *callback_args, **callback_kwargs)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/auth.py", line 307, in do_recover
self.send_recovery_email(request, user)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/auth.py", line 391, in send_recovery_email
'theuser': user,
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
ERROR: testLoginWithPassword (django_openid.tests.auth_tests.AuthTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 58, in testLoginWithPassword
'password': 'incorrect-password',
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
return self.request(**r)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 136, in get_response
response = response.render()
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 97, in render
self._set_content(self.rendered_content)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 73, in rendered_content
template = self.resolve_template(self.template_name)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 51, in resolve_template
return loader.get_template(template)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 157, in get_template
template, origin = find_template(template_name)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: django_openid/login_plus_password.html
======================================================================
ERROR: testLoginCancel (django_openid.tests.consumer_tests.ConsumerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 83, in testLoginCancel
openid_consumer.request_cancelled_message in response.content
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
ERROR: testLoginDiscoverFail (django_openid.tests.consumer_tests.ConsumerTest)
E.g. the user enters an invalid URL
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 42, in testLoginDiscoverFail
self.assert_(openid_consumer.openid_invalid_message in str(response))
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/http/__init__.py", line 515, in __str__
+ '\n\n' + self.content
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
ERROR: testLoginFailure (django_openid.tests.consumer_tests.ConsumerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 95, in testLoginFailure
self.assert_('Failure: ' in response.content)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
ERROR: testLoginSetupNeeded (django_openid.tests.consumer_tests.ConsumerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 106, in testLoginSetupNeeded
self.assert_(openid_consumer.setup_needed_message in response.content)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
ERROR: testLoginSuccess (django_openid.tests.consumer_tests.ConsumerTest)
Simulate a successful login
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 55, in testLoginSuccess
'You logged in as http://simonwillison.net/' in response.content
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
ERROR: testRegisterWithPassword (django_openid.tests.auth_tests.RegistrationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 95, in testRegisterWithPassword
'password2': 'password',
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
return self.request(**r)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/consumer.py", line 157, in __call__
return router(request, path_override = rest_of_url)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 67, in __call__
return self.handle(request, path_override)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 64, in handle
return callback(request, *callback_args, **callback_kwargs)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/registration.py", line 155, in do_register
return self.confirm_email_step(request, user)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/registration.py", line 182, in confirm_email_step
self.send_confirm_email(request, user)
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/registration.py", line 202, in send_confirm_email
'newuser': user,
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.
======================================================================
FAIL: test_shortcut_view (django.contrib.contenttypes.tests.ContentTypesTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/contrib/contenttypes/tests.py", line 70, in test_shortcut_view
response._headers.get("location")[1])
AssertionError: u'http://example.com/users/john/' != 'http://example.com/profiles/profile/john/'
======================================================================
FAIL: testInvalidRegistrationWithPassword (django_openid.tests.auth_tests.RegistrationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 84, in testInvalidRegistrationWithPassword
'User with this Username already exists' in str(response)
AssertionError: False is not true
======================================================================
FAIL: tests (pagination)
Doctest: pagination.tests
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/_doctest.py", line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for pagination.tests
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 0, in tests
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 65, in pagination.tests
Failed example:
t.render(Context({'var': range(21), 'request': HttpRequest()}))
Expected:
u'\n\n<div class="pagination">...
Got:
u'\n\n\n<div class="pagination">\n <ul>\n \n <li class="prev disabled"><a>\u2190 Previous</a></li>\n \n \n \n <li class="active"><a href="?page=1">1</a></li>\n \n \n \n <li class=""><a href="?page=2">2</a></li>\n \n \n \n <li class=""><a href="?page=3">3</a></li>\n \n \n \n <li class=""><a href="?page=4">4</a></li>\n \n \n \n <li class="disabled"><a href="#">\u2026</a></li>\n \n \n \n <li class=""><a href="?page=8">8</a></li>\n \n \n \n <li class=""><a href="?page=9">9</a></li>\n \n \n \n <li class=""><a href="?page=10">10</a></li>\n \n \n \n <li class=""><a href="?page=11">11</a></li>\n \n \n \n <li class="next"><a href="?page=2">Next \u2192</a></li>\n \n </ul>\n</div>\n'
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 69, in pagination.tests
Failed example:
t.render(Context({'var': range(21), 'request': HttpRequest()}))
Expected:
u'\n\n<div class="pagination">...
Got:
u'\n\n\n<div class="pagination">\n <ul>\n \n <li class="prev disabled"><a>\u2190 Previous</a></li>\n \n \n \n <li class="active"><a href="?page=1">1</a></li>\n \n \n \n <li class=""><a href="?page=2">2</a></li>\n \n \n \n <li class="next"><a href="?page=2">Next \u2192</a></li>\n \n </ul>\n</div>\n'
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 72, in pagination.tests
Failed example:
t.render(Context({'var': range(21), 'request': HttpRequest()}))
Expected:
u'\n\n<div class="pagination">...
Got:
u'\n\n\n<div class="pagination">\n <ul>\n \n <li class="prev disabled"><a>\u2190 Previous</a></li>\n \n \n \n <li class="active"><a href="?page=1">1</a></li>\n \n \n \n <li class=""><a href="?page=2">2</a></li>\n \n \n \n <li class="next"><a href="?page=2">Next \u2192</a></li>\n \n </ul>\n</div>\n'
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 75, in pagination.tests
Failed example:
t.render(Context({'var': range(21), 'by': 20, 'request': HttpRequest()}))
Expected:
u'\n\n<div class="pagination">...
Got:
u'\n\n\n<div class="pagination">\n <ul>\n \n <li class="prev disabled"><a>\u2190 Previous</a></li>\n \n \n \n <li class="active"><a href="?page=1">1</a></li>\n \n \n \n <li class=""><a href="?page=2">2</a></li>\n \n \n \n <li class="next"><a href="?page=2">Next \u2192</a></li>\n \n </ul>\n</div>\n'
----------------------------------------------------------------------
Ran 359 tests in 11.712s
FAILED (failures=3, errors=10)
Destroying test database for alias 'default'...
The dashboard should include:
http://pinaxproject.com/pinax/pinax_starter_projects/#install-django-and-start-project
says to pip install pinax
Surely this is meant to be pip install pinax-cli
For instance, if you wanted to add a Wiki to the Account starter project.
I'm opening this issue to begin a discussion of the standard/default staticfiles build process for pinax. It is a subject worth discussing and reaching consensus on.
I have used django-pipeline
for a few years and have only recently begun working with webpack. I have yet to find any advantages to using webpack over pipeline and I am interested to hear from webpack users what those may be. I'll list my experiences (from a pipeline user perspective) to start the discussion.
static
folder, but Webpack cannot find static files that are bundled this way (particularly external apps installed in site-packages
but also for internal apps as well). This is a limitation of webpack perforing its static builds outside of the django.contrib.staticfiles
ecosystem. The pinax build process hasn't worked around this limitation of webpack yet..DEBUG
mode. With webpack, npm run watch
must be running in another terminal process. On the project I am using webpack with there is a delay between saving and when the compilation is complete. The delay is noticeable, a few seconds and I have to wait until I can refresh to see the changes. Probably the speed could be improved with webpack if it didn't minimize and compress locally.STATICFILES_STORAGE
.collectstatic
to build the files for production, webpack uses npm build media
.1.3
to 1.4
and the current version is 1.5.5
. It may simply be my lack of use with webpack, but I struggled getting started because It wasn't clear to me what the recommended way to use it was.settings.py
and with the addition of django-bower
, js dependencies may also be listed in settings.py. There is more configuration code to maintain for webpack. A pipeline configuration looks like this::BOWER_PATH = "/usr/lib/node_modules/bower/bin/bower"
BOWER_COMPONENTS_ROOT = "bower_components"
BOWER_INSTALLED_APPS = [
"bootstrap#3.3.4",
"font-awesome#4.4.0",
"html5shiv", # always the latest
"jquery#2.1.4",
]
PIPELINE_ENABLED = True
PIPELINE_SASS_BINARY = "sassc"
STATICFILES_STORAGE = "pipeline.storage.PipelineCachedStorage"
PIPELINE_COMPILERS = (
"pipeline.compilers.less.LessCompiler",
"pipeline.compilers.coffee.CoffeeScriptCompiler",
"pipeline.compilers.sass.SASSCompiler",
)
PIPELINE_CSS_COMPRESSOR = "pipeline.compressors.cssmin.CSSMinCompressor"
PIPELINE_JS_COMPRESSOR = "pipeline.compressors.uglifyjs.UglifyJSCompressor"
PIPELINE_CSS = {
"styles": {
"source_filenames": (
"bootstrap/less/bootstrap.less",
"font-awesome/less/font-awesome.less",
"less/mysite.less",
),
"output_filename": "styles.css",
},
}
PIPELINE_JS = {
"scripts": {
"source_filenames": (
"jquery/dist/jquery.js",
"jquery-file-upload/js/vendor/jquery.ui.widget.js",
"jquery-file-upload/js/jquery.iframe-transport.js",
"jquery-file-upload/js/jquery.fileupload.js",
"django_summernote/summernote.min.js",
"js/mysite.js",
),
"output_filename": "scripts.js",
},
}
webpack like this:
package.json
{
"repository": {
"type": "git",
"url": "https://github.com/myorg/myproject.git"
},
"scripts": {
"build": "./node_modules/.bin/webpack --config=static/webpack.config.js -p",
"watch": "./node_modules/.bin/webpack --config=static/webpack.config.js -w"
},
"dependencies": {
"bootstrap": "^3.3.5",
"css-loader": "^0.15.6",
"font-awesome": "^4.4.0",
"jquery": "^2.1.4",
"less": "^2.5.1",
"less-loader": "^2.2.0",
"webpack": "^1.10.5"
}
}
webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var path = require("path");
var webpack = require("webpack");
var projectTemplatesRoot = "../../mysite/templates/";
module.exports = {
cache: true,
context: path.resolve(__dirname, "src"),
entry: {
app: "./js/main.js"
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "js/site.js?[hash]",
publicPath: "/site_media/static"
},
module: {
loaders: [
{
test: /\.(gif|png|ico|jpg|svg)$/,
include: [
path.resolve(__dirname, "src/images")
],
loader: "file-loader?name=/images/[name].[ext]"
},
{ test: /\.less$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader") },
{
test: /\.(woff|woff2|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
include: [
path.resolve(__dirname, "src/fonts"),
path.resolve(__dirname, "../node_modules")
],
loader: "file-loader?name=/fonts/[name].[ext]?[hash]"
},
{ test: /\.jsx?$/, loader: "babel-loader", query: {compact: false} },
]
},
resolve: {
extensions: ["", ".js", ".jsx"],
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new ExtractTextPlugin("css/site.css?[hash]"),
new HtmlWebpackPlugin({
filename: projectTemplatesRoot + "_styles.html",
templateContent: function(templateParams, compilation) {
var link = "";
for (var css in templateParams.htmlWebpackPlugin.files.css) {
link += "<link href='" + templateParams.htmlWebpackPlugin.files.css[css] + "' rel='stylesheet' />\n"
}
return link;
}
}),
new HtmlWebpackPlugin({
filename: projectTemplatesRoot + "_scripts.html",
templateContent: function(templateParams, compilation) {
var script = "";
for (var js in templateParams.htmlWebpackPlugin.files.js) {
script += "<script src='" + templateParams.htmlWebpackPlugin.files.js[js] + "'></script>\n"
}
return script;
}
})
]
};
main.js
require("../less/site.less");
window.jQuery = window.$ = require("jquery");
require("bootstrap");
require("./theme");
\\ site js follows
An advantage that webpack may have is that it could be more easily discarded in favor of another solution. In python some options are django-pipeline
or django-compressor
and in javascript options include webpack
, browserify
and grunt/gulp
. Maybe the solution is for pinax to support both the js way and the python way.
Having a pinax
command line utility will help users more easily get started with Pinax starter projects, allow for better discovery, and enable us to provide a richer bootstrapping experience.
There could very well be many commands, but initially, we'll focus on just a single command and that is starting a project:
pip install pinax
pinax projects start account
or:
pip install pinax
pinax projects start
Then you get a list of available projects with a short one line description and the ability to pick one.
The project registry should be JSON or YAML hosted either in the pinax/pinax
repo or the pinax/pinax-starter-projects
repo and start initially with the following format:
{
"zero": {
"url": "https://github.com/pinax/pinax-starter-projects/zipball/zero",
"args": "-n webpack.config.js",
},
"account": {
"url": "https://github.com/pinax/pinax-starter-projects/zipball/account",
"args": "-n webpack.config.js",
},
}
We can eventually add more things like a requirements
dict to each project, other variables to setup, etc. that extend the Django project template feature.
Originally reported at https://www.pythonanywhere.com/forums/topic/9094/
Traceback (most recent call last):
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/bin/pinax", line 11, in <module>
sys.exit(main())
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/core.py", line 680, in main
rv = self.invoke(ctx)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/decorators.py", line 63, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/pcli.py", line 98, in start
start_project(projects[project], name, dev)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/pcli.py", line 35, in start_project
call_command("startproject", name, **kwargs)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 130, in c
all_command
return command.execute(*args, **defaults)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/core/management/commands/startproject.py", line 34, in handle
super(Command, self).handle('project', project_name, target, **options)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/core/management/templates.py", line 126, in handle
base_subdir)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/core/management/templates.py", line 213, in handle_template
return self.extract(absolute_path)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/core/management/templates.py", line 314, in extract
archive.extract(filename, tempdir)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/utils/archive.py", line 49, in extract
with Archive(path) as archive:
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/utils/archive.py", line 58, in __init__
self._archive = self._archive_cls(file)(file)
File "/home/username/.virtualenvs/tmp-9e86ffb6d8936815/local/lib/python2.7/site-packages/django/utils/archive.py", line 137, in __init__
self._archive = tarfile.open(file)
File "/usr/lib/python2.7/tarfile.py", line 1665, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
May be due to the limitations of a PythonAnywhere free account, the most likely of which is the Internet access being restricted to a whitelist -- does the pinax start account command try to access any external sites (that aren't on that list)?
The quick start doesn't even mention anything about npm install
. While it may not be the place for showing customization of the starter project, it would be good to get people up and running with a single build of the static files.
STATICFILES_DIR has os.path.join(PACKAGE_ROOT, "static").
PACKAGE_ROOT is project_name/project_name.
Why is there project_name/static directory in the default template ?
explicitly say we use slack and hereβs how you join, here are the docs, here is the blog, here we are on twitter, etc
(Using Virtualenv, Python2.6) I got this error while installting:
Traceback (most recent call last):
File "manage.py", line 8, in
startup.run()
File "/var/lib/stickshift/525592544382ec622f0000a5/app-root/data/641659/juga_site/juga_site/startup.py", line 20, in run
autoload(["receivers"])
File "/var/lib/stickshift/525592544382ec622f0000a5/app-root/data/641659/juga_site/juga_site/startup.py", line 13, in autoload
import_module("{}.{}".format(app, submodule))
ValueError: zero length field name in format
So far the Quick Start section in our Pinax documentation only shows how you can create a new project based on pinax-project-account. Pinax projects are just Django projects and Pinax apps are just Django apps so you can add any Django app or any Pinax app to a Pinax starter project. We think it would be nice to show our users how to add one or two Pinax apps to their project after they got pinax-project-account
up and running with the help of our Quick Start.
We'd like to give someone who has never contributed to open source before a chance to tackle this task in order to make their first OSS contribution. If you have contributed to open source before, please let someone else take this one. Below you can find some guidelines and instructions on what you need to do:
pinax-project-account
(what apps it consists of etc.) and how you can add apps to a Pinax project (or really any Django project).pinax/pinax
repository in your text editor, then open the docs
folder, and finally open the quick_start.md
file.mkdocs serve
into your terminal. Make sure you cd'd
into the folder in which you copied your forked repository first. Then type 127.0.0.1:8000/
into your browser and you should see the Pinax documentation including the changes you made. Awesome!One of us will then review your pull request and if everything looks great we will merge it (you will receive an email notification from GitHub). If you need to make additional changes, we will comment on your pull request and help you figure out the next steps. Don't worry, this is totally normal and doesn't mean that your pull request isn't awesome. Sometimes it just happens that a few things need to be tweaked.
If you have any questions or need help, comment on this issue and mention me @ossanna16 (I will receive a notification this way). One of us will then reply and help you. It's even better if you would join our Pinax Slack channel (it's free). Someone is always there to help and answer any questions. If you'd like to reach me personally mention me @anna in our Pinax project Slack channel. Please remember that there are no stupid questions. We want to help you succeed and want to help you make your first open source contribution. π
New user, initial first impressions...
pip install pinax-cli
pinax start account mysite
loads django-1.11.4
cd mysite
pip install -r requirements.txt
uninstalls django-1.11.4 and installs v1.9.8
My solution was to unpin them, but that may not be a production solution for you.
FWIW, and this is strictly just my opinion, worth every cent you paid for it....
Doing strict pip freeze
pinning is often suboptimal -- we should take advantage of semantic versioning to pick up the latest "fix" release of a package that will still maintain the API we're relying on.
For example given django's promises: django>=1.11.4,<1.12
or django>=1.11.4,<2.0
is almost always going to do the right thing for the user.
I think the most generally useful thing for this script to do is show, for each repo, how many open issues and pull requests are in each Milestone (or don't have a Milestone). That way we can see, for example, how many issues haven't been triaged, how many are blocking a distribution, etc.
We have had pinax-theme-bootstrap
for quite sometime now, only recently separating out the vendored statics. These leaves a few bits and pieces but mostly just a set of templates, mostly using bootstrap class names.
I'd like to propose we start a pinax-theme
project that does the following:
pinax-theme-bootstrap
packages on https://www.npmjs.com/ that contain the LESS/SASS that maps our semantic markup to bootstrap rulespinax-theme-bootstrap
npmjs package should also contain any specific rules and js that are now shipped as part of the Python pinax-theme-bootstrap
packagebase.html
template so as to ship with alternate layout optionsThis should make it eas(y|ier) to create npmjs packages for Bootstrap 4, Foundation and any other framework. In addition, we can layer in additional npmjs themes for adding more style on top of default style from the framework.
We should document our release process.
Does Pinax app support Python 3.x.
Can one use higher versions of django like 1.5 or 1.6beta with Pinax apps.
Right now the Quick Start in the Pinax documentation and the README of this repository still show the "manual" way of starting Pinax starter projects. Since there's now an easier way to do that with the Pinax Command Line (pinax-cli) both of these documents need to be updated. We'd like to give someone who has never contributed to open source before a chance to tackle this task in order to make their first OSS contribution. If you have contributed to open source before, please let someone else take this one. Below you can find some guidelines and instructions on what you need to do:
pinax-cli
to install pinax-project-blog
.pinax/pinax
repository in your text editor and update the "Getting Started" section in the README.md
file with the new pinax-cli
way of starting projects. Don't forget to save your changes. Please note that we use Markdown syntax for our documentation.docs
folder of the pinax/pinax
repository and create a new file (right click "New File") named quick_start_manual.md
.quick_start.md
file, copy the content, and paste it into your new quick_start_manual.md
file. At the very top of the file you should change the title "Quick Start" to "Quick Start Manual", then save the file.quick_start.md
file and update the file the same way you updated the README.md
file earlier to showcase the new pinax-cli
way of starting projects.pinax-cli
way so you should add one sentence to the document letting people know that if they are interested in learning about the manual way of installing a Pinax project, they should visit the "Quick Start Manual" page of the documentation. It would be good if you would link to this page from the quick_start.md
page. Don't forget to save your changes.mkdocs.yml
and add the following line - ["quick_start_manual.md", "Introduction", "Quick Start Manual"]
right underneath this line - ["quick_start.md", "Introduction", "Quick Start"]
. Save your changes.index.md
file and add the following line * [Quick Start Manaual](quick_start_manual.md)
right underneath the following line * [Quick Start](quick_start.md)
. Don't forget to save your changes.mkdocs serve
into your terminal. Make sure you cd'd
into the folder in which you copied your forked repository first. Then type 127.0.0.1:8000/
into your browser and you should see the Pinax documentation including the changes you made. Awesome!One of us will then review your pull request and if everything looks great we will merge it (you will receive an email notification from GitHub). If you need to make additional changes, we will comment on your pull request and help you figure out the next steps. Don't worry, this is totally normal and doesn't mean that your pull request isn't awesome. Sometimes it just happens that a few things need to be tweaked.
If you have any questions or need help, comment on this issue and mention me @ossanna16 (I will receive a notification this way). One of us will then reply and help you. It's even better if you would join our Pinax Slack channel (it's free). Someone is always there to help and answer any questions. If you'd like to reach me personally mention me @anna in our Pinax project Slack channel. Please remember that there are no stupid questions. We want to help you succeed and want to help you make your first open source contribution. π
Hi,
I'm very interested in the project and while I was testing it I has a problem when I wanted to make a pinax zero new app
The code error
(pinax)amisca@amisca-laptop pinax$ pinax start zero mysite
Traceback (most recent call last):
File "/home/amisca/Envs/pinax/bin/pinax", line 9, in <module>
load_entry_point('pinax-cli==0.4', 'console_scripts', 'pinax')()
File "/home/amisca/Envs/pinax/local/lib/python2.7/site-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/amisca/Envs/pinax/local/lib/python2.7/site-packages/pkg_resources.py", line 2431, in load_entry_point
return ep.load()
File "/home/amisca/Envs/pinax/local/lib/python2.7/site-packages/pkg_resources.py", line 2152, in load
raise ImportError("%r has no %r attribute" % (entry, attr))
ImportError: <module 'pinax' from '/home/amisca/Envs/pinax/local/lib/python2.7/site-packages/pinax/__init__.pyc'> has no 'main' attribute
My pip freeze:
Django==1.9.1
argparse==1.2.1
click==5.1
django-appconf==1.0.1
django-bootstrap-form==3.2
django-user-accounts==1.3.1
jsonfield==1.0.3
metron==1.3.7
pinax-cli==0.4
pinax-eventlog==1.1.1
pinax-theme-bootstrap==7.2.0
pytz==2015.7
requests==2.7.0
six==1.10.0
wsgiref==0.1.2
how to start a project with authorization and authentication just done through google apps
Hey,
I've tried to use pinax with a custom-made base project using this command inside my virtualenv :
$ pinax-admin setup_project -b ../path/to/custom/project newprojectname
Ending with this exception :
Traceback (most recent call last):
File "/home/vash/workspace/test/droid/droidware/ortodellacultura/bin/pinax-admin", line 8, in <module>
load_entry_point('Pinax==0.9b1.dev10', 'console_scripts', 'pinax-admin')()
File "/home/vash/workspace/test/droid/droidware/ortodellacultura/lib/python2.6/site-packages/pinax/core/management/__init__.py", line 105, in execute_from_command_line
runner.execute()
File "/home/vash/workspace/test/droid/droidware/ortodellacultura/lib/python2.6/site-packages/pinax/core/management/__init__.py", line 94, in execute
self.loader.load(command).run_from_argv(argv)
File "/home/vash/workspace/test/droid/droidware/ortodellacultura/lib/python2.6/site-packages/pinax/core/management/base.py", line 45, in run_from_argv
self.handle(*args, **options.__dict__)
File "/home/vash/workspace/test/droid/droidware/ortodellacultura/lib/python2.6/site-packages/pinax/core/management/commands/setup_project.py", line 66, in handle
self.setup_project(args[0], options["base"], options)
File "/home/vash/workspace/test/droid/droidware/ortodellacultura/lib/python2.6/site-packages/pinax/core/management/commands/setup_project.py", line 130, in setup_project
installer = ProjectInstaller(source, destination, project_name, user_project_name)
UnboundLocalError: local variable 'source' referenced before assignment
So I managed to get pinax working using :
# pinax/core/management/commands/setup_project.py (lines 112-127)
# check the base value (we could later be much smarter about it and
# allow repos and such)
if base in [p.replace("_project", "") for p in self.project_list()]:
project_name = "%s_project" % base
source = os.path.join(PROJECTS_DIR, project_name)
else:
if not os.path.exists(base):
raise CommandError(
"Project template does not exist the given "
"path: %s" % base
)
else:
project_name = os.path.basename(base)
source = base #just add this line
installer = ProjectInstaller(source, destination, project_name, user_project_name)
Basically in this particular case the source
variable was not passed to the ProjectInstaller()
method
A upvote, downvote and karma system like reddit and Stackoverflow.
A per model upvote, downvote like pinax-likes.
And per user Karma of the sum of total upvotes and downvotes a user has
People building forums with upvotes and downvotes, commenting system with upvotes and downvotes, Stack Overflow, reddit, hackernews etc clones can use these
Maybe optional options for adding additional karma for things like badges
But I don't know if it's better to keep upvotes and downvotes as a separate app instead of having upvotes and downvotes in the karma app
Maybe have #pinax-UpvotesandDownvotes app and then a #pinax-karma which intergrates the #pinax-UpvotesandDownvotes and adds karma points to users
I think #pinax-likes and #pinax-ratings can be modified to add up and downvotes
Update URLs to use namespaces
Five changes must be made.
<model>_<action>
name pattern.reverse()
, redirect()
, and {% url ... %}
.project_name/urls.py
to use the namespace.tests/urls.py
to include the namespace:Here is an example of messages/urls.py:
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^thread/(?P<pk>\d+)/delete/$", views.ThreadDeleteView.as_view(),
name="thread_delete"),
...
]
New URL reference example:
reverse("pinax_messages:thread_delete", pk=thread_id)
Project tests/urls.py example:
from django.conf.urls import include, url
urlpatterns = [
url(r"^", include("pinax.messages.urls", namespace="pinax_messages")),
]
Update views from function-based to Django generic Class-Based-Views (CBV)
In some cases this requires updating form inheritance to use forms.ModelForm
.
Make generic CBV-based class names consistent
Let's make our Pinax view class names consistent across apps using the following convention:
class <model name><action>View():
For example, use class AnnouncementCreateView()
. Do not use CreateAnnouncement
or AnnouncementCreate
.
Explicitly specify view templates
If a view uses Django's generic class-based views and requires a template, specify the template explicitly because Django's template loader will use an incorrect path.
For instance, pinax-messages needs a "thread_confirm_delete.html" template. If you do not specify the template path in views.ThreadDeleteView()
, the template loader attempts to find pinax_messages/thread_confirm_delete.html
by default. This does not work; the path you should explicitly use is pinax/messages/thread_confirm_delete.html
.
Update testing and Travis CI configuration
Both .travis.yml
and tox.ini
should only include Django versions 1.8, 1.9, and master.
Relocate templates
Move template files out of app "templates" directory to pinax-theme-bootstrap
.
Rename templatetags file(s)
Templatetag files should follow the naming convention, pinax_<appname>_tags.py
. For instance, pinax_testimonials_tags.py
.
Create initial migration
Create an initial migration if the application has concrete models and no "migrations" directory with 0001_initial.py
.
just a lightweight demo of how to set up DSP for subscription-based sites
We should leverage Google Hangouts to host a monthly time to take 30-60 minutes and cover some aspect of Pinax with a live audience that can interrupt and ask questions and contribute to the conversation.
We should record these so we can post them on the Pinax blog.
I propose the 3rd Thursday of every month at Noon US/Central time, for lack of a better recurring calendar time.
@ossanna16 had mentioned using Google Hangout on Air and https://tlk.io for help chat.
starting with just {% load bootstrap %}
then {{ form|bootstrap }}
Ok, this is a small issue, but quite annoying. I was writing a bash script to diff the current requirements files and "pip freeze" output, the full script is as follow:
diff <(cat requirements/base.txt requirements/project.txt | egrep -v "^#|^--|^$" | sort) <(pip freeze|sort)
One of the diff is this:
6c8
< django_compressor==1.1.2
---
> django-compressor==1.1.2
that is, django_compressor's entry in pinax's requirements/base.txt is not the same as what pip freeze's outputs.
This should be quick to fix wouldn't it?
webpack
docs say to do both, npm install webpack -g
and have it in your package.json
for local install referencing as a lib.
This causes pip to warn about it, and exposes users to potential MITM attacks. It would be good to offer TLS, and ideally require it.
Hi, where is pinax source code and why the development seems stop at 0.9a2?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.