On Sat, Jan 15, 2011 at 10:48 AM, Victor Hooi <victorh...@gmail.com> wrote: > heya, > I'm just wondering whether you are allowed to use hyphens in Django > app/project names? > When I try to create either an app or a project with hyphens in the name, I > get an error: > > Error: 'django-library' is not a valid app name. Please use only numbers, > letters and underscores. > > However, I know of several other apps which seem to have hyphens in their > name. > https://bitbucket.org/ubernostrum/django-registration > https://github.com/django-extensions/django-extensions > https://github.com/jezdez/django-staticfiles
You need to differentiate between the name of the *project* and the name of the *module*. Taking django-regsitration as an example -- the *project* is named 'django-registration'. When you install that project into your PYTHONPATH, it is installed as the *module* named 'registration'. A hyphen isn't legal when used in a package name -- hence the restriction in startapp. startapp creates a module that needs to be imported, so it needs to restrict to legal Python module names. However, when you distribute your app as a packaged Python module, you can wrap it in whatever package name you want -- and in this context, hyphens are legal. The "django-" prefix is fairly common, allowing you to differentiate 'django-registration' from other web framework registration modules. However, it isn't a mandated standard or anything like that. > In fact, if you look at Django Pluggables (did they get renamed to Django > Packages?), Django Packages and Django Pluggables are different projects. I'm not sure what happened to Django Pluggables. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.