Django basic project with common functionality included - django

Does someone know any basic open source Django project with follow common applications installed:
Native Registration with templates.
Open auth registration.
Basic templates created.
Twitter Bootstrap included
Main page with menu app.
Maybe some other common things.
Something that you can start with, and jump to your special functionality and design right away.
The only project that I'm aware of is django-skel
But it seemed does not include all the really common things.
Pinax looks like drooped support from django-1.3 version.

django-skel is meant as sane configuration for Django projects which clears up a lot of configuration you need to do to when you start a project.
Now it looks like what you are looking for falls closer to the Pinax ball park.
That being said this wont take you long to setup yourself and you wont have to deal with the legacy of something like pinax albiet it gets you started really quick. They have a bunch of reusable apps that you could string together to get your desire result.

Sorry for disturbing without proper research, but here is something I just found and it seems totally awesome:
$ mkvirtualenv mysite
$ pip install Django==1.4.1
$ django-admin.py startproject --template=https://github.com/pinax/pinax-project-account/zipball/master mysite
$ cd mysite
$ pip install -r requirements.txt
$ python manage.py syncdb && python manage.py runserver

Related

django site urls whose are not under site-packages

Lets assume you have a django website svn directory which is not under site-packages.
Whenever i run:
mysyper_dir/whatever_module/manage.py runserver 0.0.0.0:8888
and then connect, I realize that my request are still handled by the python files in:
....../site-packages/whatever_module/
while I can see the prints of
mysyper_dir/whatever_module/setting.py
from my server console.
is there a way to tell django that, every "non-framework" files it will ever need are in the "mysyper_dir/whatever_module" directory ?
Neither of these are Django specific (Python actually already handles this) but there's a couple of things you could do. You could set the environment variable PYTHONPATH, or you could add directories to sys.path. You can find more about where modules are located here.
If you are looking to have things just apply to Django, then adding to sys.path might be your best bet. You could try something weird like modifying manage.py and adding command line arguments after the #!/usr/bin/env python but that's uncharted territory for me.

heroku django tutorial not working?

I'm trying to work through the "Getting Started with Django" heroku tutorial. Things are working when I run the framework locally with foreman, but when I try to run it on Heroku, it is failing when trying to find the settings module.
In a nutshell, I've done...
chris#xi:~: mkdir hero
chris#xi:~: cd hero
chris#xi:~/hero: django-startproject ku .
and then I create and edit the files per the instructions. Perhaps I have gotten something wrong?
in ~/hero, I created my Procfile and requirements.txt, as well as the ku directory that was created by django-admin
in ~/hero/ku I have settings.py and wsgi.py (created by django-admin and edited by me)
any idea what I'm not doing correctly?
found it after much trial end error. It turns out that I had an old .gitignore file in my home directory that ignored settings.py. Once I added settings.py to the project and re-pushed, everything started working.
I don't like putting settings.py into git because it contains machine-specific information, as well as security information. But I guess I will leave it for now, and when I have to do it for real, I can use the heroku config:set command to set up things like database users and passwords, or paths to DJANGO_SETTINGS_FILE, etc.

Django command without Django application?

Is there any way I can add a custom Django command which doesn't need an underlying application or project to work (pretty much like startapp or startproject)?
$ django-admin.py startveryniceproject projectname
One way I can imagine this could be accomplished would be to copy a startveryniceproject.py into django.core.management.commands, but does that really sound "clean"?

Installing Pinax, where is my deployment folder?

I'm trying to set up Pinax and I'm new to everything involved (Django, Pinax, webservers, etc). I'm following http://pinax.readthedocs.org/en/latest/gettingstarted.html
When I generate a project using:
(mysite-env)$ pinax-admin setup_project -b basic mysite
The directory structure I get is:
apps __init__.py manage.py settings.pyc urls.py
dev.db __init__.pyc requirements static urls.pyc
fixtures locale settings.py templates wsgi.py
Which as far as I can tell is missing the deployment folder (when you compare to the directory structure shown here : http://pinax.readthedocs.org/en/latest/starterprojects.html). It doesn't seem to be effecting anything yet, but it makes me nervous. What is going on and is the fact I'm missing the deployment folder going to cause problems in the future?
I'm running Ubuntu and using python 2.7. I had the same behaviour with Windows 7, python 2.6
Thanks!
The new Django versions have made the old pinax pretty much useless. Now Django supports project templates and Pinax is separated into several smaller projects regarding starter projects (such as pinax-project-account) and apps (such as django-user-account).
The current way to use pinax is to choose a starter project, and then running something like:
$ django-admin.py startproject --template=https://github.com/pinax/pinax-project-account/zipball/master <project_name>
and then install requirements:
$ pip install -r requirements.txt
This will create a new Django project using the starter-project as a template, which already includes a few apps (like django-user-account) and templates (with bootstrap!). The project is ready to run, and already includes a bunch of functionality (like user registration, login and management).
Also, Django has changed the project directory structure a bit, so now it doesn't really look like that anymore.

Is there a way to add custom django-admin.py commands that work outside of projects?

I'm trying to write a custom command that works outside of Django projects. I was thinking I could follow the coding patterns of Django's own such commands (e.g., startproject), include my command in an app and install it.
Alas, it seems django cannot see this command, as perhaps it doesn't scan site-packages for custom commands.
Is there a way to make this work or am I sadly correct?
UPDATE: I should note that the goal I was trying to accomplish (writing a command that starts projects based on custom templates) is supported in the coming 1.4 release of Django: https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-startproject (see the --template option).
Based on this code from django.core.management, it does appear that django only searches for project-less commands in its own packages, and will then only find command by scanning INSTALLED_APPS, which means a project is required.
You can use a custom manage.py.
You do need a project. A project is, although, nothing more than a python package with a settings.py (and maybe a urls.py file)
So you could just create a project, with whatever commands you want, and in your setup script include a binary script that is nothing more than a manage.py in disguise.
I use it to have a manage.py in the bin path of a virtualenv, but you can call it something else and have that "django" project installed in your system python.
I don't quite understand from your post, for what purpose do You want to write such command using Django's manage.py. But suppose you want (as I was) to run some script, that works with Django models, for example. You cannot run such script without setting Django environment.
I do the following:
put my code in script.py
manage.py shell
execfile('script.py')
Maybe, this helps.