Issues with NAME_LENGTH (and perhaps basic byteflow installation)

1 view
Skip to first unread message

David Michael Penningotn

unread,
Jan 17, 2010, 9:21:29 PM1/17/10
to byteflow-users, mi...@pennington.net
Hi,

I recently found byteflow and built a config that uses postgres after
some initial mis-steps...

One problem I haven't been able to solve is that the blog models in
the latest HG repo require NAME_LENGTH from byteflow/settings.py... in
most cases I've been able to solve for dependencies by adding lines
like this
in my root views.py / urls.py...

## views.py
sys.path.append('/home/django/mikepenn/byteflow')
sys.path.append('/home/django/mikepenn/byteflow/apps')
sys.path.append('/home/django/mikepenn/byteflow/compat')
import byteflow.settings
import byteflow.apps.blog.views

## urls.py
(r'^blog/', include('byteflow.urls')),

However, I haven't been able to force django to find byteflow/
settings.py and use it for NAME_LENGTH in byteflow/apps/blog/models.py

This is the full traceback from django... any thoughts on a better way
to do the installation?

------ traceback
Environment:

Request Method: GET
Request URL: http://new.pennington.net/mysite.fcgi/blog/
Django Version: 1.1.2 pre-alpha SVN-12223
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'byteflow',
'byteflow.apps.blog']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/opt/django-release/django/core/handlers/base.py" in
get_response
90. request.path_info)
File "/opt/django-release/django/core/urlresolvers.py" in resolve
220. for pattern in self.url_patterns:
File "/opt/django-release/django/core/urlresolvers.py" in
_get_url_patterns
249. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "/opt/django-release/django/core/urlresolvers.py" in
_get_urlconf_module
244. self._urlconf_module = import_module
(self.urlconf_name)
File "/opt/django-release/django/utils/importlib.py" in import_module
35. __import__(name)
File "/home/django/mikepenn/../mikepenn/urls.py" in <module>
3. from mikepenn.views import *
File "/home/django/mikepenn/../mikepenn/views.py" in <module>
13. import byteflow.apps.blog.views
File "/home/django/mikepenn/byteflow/apps/blog/views.py" in <module>
24. from blog.models import Post
File "/home/django/mikepenn/byteflow/apps/blog/models.py" in <module>
28. class Post(models.Model):
File "/home/django/mikepenn/byteflow/apps/blog/models.py" in Post
31. name = models.CharField(_(u'Name'),
max_length=settings.NAME_LENGTH)
File "/opt/django-release/django/utils/functional.py" in __getattr__
276. return getattr(self._wrapped, name)

Exception Type: AttributeError at /blog/
Exception Value: 'Settings' object has no attribute 'NAME_LENGTH'

David Michael Penningotn

unread,
Jan 20, 2010, 4:41:00 PM1/20/10
to byteflow-users
Bump... surely someone has input on this problem...

Should I bother trying to install byteflow as an application? If it
is designed to be an app, what is the recommended means to integrate
into the existing urls.py and views.py?

Thoughts?
\m

David Michael Pennington

unread,
Jan 21, 2010, 3:58:30 AM1/21/10
to byteflow-users
[RESOLVED]
Posting resolution to save someone else the trouble... According to
piranha in Apr 2009, byteflow is a django project, not an
application...

http://pydanny.blogspot.com/2009/04/show-me-your-open-source-django-blog.html?showComment=1239378000000#c6679917601479329564

Piranha's contention that this is a project conflicts with blog
entries such as this one... however, piranha is the author.
http://richard.esplins.org/siwi/2009/09/05/transititioning-to-byteflow/

What confuses me is why consider byteflow as a project and then
default the blog location as http://hostname.foo/blog/? The most
reasonable way of deploying byteflow is as a virtual host under nginx
/ apache / lighttpd, such as http://blog.hostname.foo/... if you are
already selecting on blog.hostname.foo, it seems redundant to append
/blog/ on the end, no?

Cheers,
\m

> --
> You received this message because you are subscribed to the Google Groups "byteflow-users" group.
> To post to this group, send email to byteflo...@googlegroups.com.
> To unsubscribe from this group, send email to byteflow-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/byteflow-users?hl=en.
>
>
>
>

Yuri Baburov

unread,
Jan 21, 2010, 1:59:25 PM1/21/10
to byteflo...@googlegroups.com
Hi David,

it's set to /blog/ because it uses /about/ and etc. as static pages.

IIRC, it's clearly written in settings.py what to do if you want to change
URLs layout.

Here's lines from my version:

# Root urlconf component for all blog urls
BLOG_URLCONF_ROOT = 'blog/' # Don't forget that there must be no leading '/'
# Meaningful values:
# - 'blog.views.process_root_request': will redirect to
BLOG_URLCONF_ROOT
# - 'blog.views.post_list': will display list of posts
# - 'life.views.life_index': will display list of your life flow,
# requires enabled 'life' application
URL_ROOT_HANDLER = 'blog.views.process_root_request'

Please don't be confused.

There's also urls_local.py for your additional urls, and
settings_local.py for your additional apps.

> What confuses me is why consider byteflow as a project and then
> default the blog location as http://hostname.foo/blog/?  The most
> reasonable way of deploying byteflow is as a virtual host under nginx
> / apache / lighttpd, such as http://blog.hostname.foo/... if you are
> already selecting on blog.hostname.foo, it seems redundant to append
> /blog/ on the end, no?

--
Best regards, Yuri V. Baburov, ICQ# 99934676, Skype: yuri.baburov,
MSN: bu...@live.com

Reply all
Reply to author
Forward
0 new messages