Problem with admin

2012-01-31 Thread Kolbe
Hi guys, I created a new app and within that app, I also specified a
new admin.py file. Is that how the admin portion for that app is
managed?

Anyway, after I created my models and syncdb, then run server, I have
been unable to access the admin gui.

I keep getting this error below, but I don't understand it because I
did not edit the admin template files? Am I handling the admin
wrongly? What is the norm for handling multiple apps in the admin?

TemplateSyntaxError at /admin/
Caught IndentationError while rendering: unindent does not match any
outer indentation level (views.py, line 25)
Request Method: GET
Request URL:http://localhost:8000/admin/
Django Version: 1.3
Exception Type: TemplateSyntaxError
Exception Value:
Caught IndentationError while rendering: unindent does not match any
outer indentation level (views.py, line 25)
Exception Location: /Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/django/utils/importlib.py in
import_module, line 35
Python Executable:  /Library/Frameworks/Python.framework/Versions/2.7/
Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.1
Python Path:
['/Users/max/Documents/Python/djproj3',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/setuptools-0.6c11-py2.7.egg',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-
darwin',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-
mac',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-
mac/lib-scriptpackages',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-
tk',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-
old',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-
dynload',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages',
 '/Library/Python/2.7/site-packages']
Server time:Wed, 1 Feb 2012 03:50:29 +0800
Template error

In template /Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/contrib/admin/templates/admin/
base.html, error at line 31
Caught IndentationError while rendering: unindent does not match any
outer indentation level (views.py, line 25)

-- 
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.



CSS reference to Media folder

2012-02-15 Thread Kolbe
Hi all,

I have a .css file in the /static/ folder where I keep all my styles.

Now when I want to refer to images that I use in my CSS that are
stored in the /media/ folder, how do I reference that?


e.g. background-image:url('gradient2.png');

gradient2.png is stored in ~/media/ and my css is in ~/static/

Is there a way to define the path to gradient2.png?

Cheers!
Max

-- 
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.



Re: CSS reference to Media folder

2012-02-16 Thread Kolbe
Thanks guys for the valuable recommendations.

I tried this one before > background-image: url(/media/images/base/
gradient2.png)

Didn't work then, will give it a try later.

*am loving django.

Cheers!
Max

On Feb 16, 5:54 pm, MikeKJ  wrote:
> background-image: url(/media/images/base/gradient2.png)
>
> eg
>
> On Feb 15, 12:37 pm, Kolbe  wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > I have a .css file in the /static/ folder where I keep all my styles.
>
> > Now when I want to refer to images that I use in my CSS that are
> > stored in the /media/ folder, how do I reference that?
>
> > e.g. background-image:url('gradient2.png');
>
> > gradient2.png is stored in ~/media/ and my css is in ~/static/
>
> > Is there a way to define the path to gradient2.png?
>
> > Cheers!
> > Max

-- 
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.



Any Singaporean Django developers out there?

2012-02-25 Thread Kolbe
It's like Django is nonexistent in Singapore!

-- 
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.



Re: django + TinyMce

2012-08-20 Thread Kolbe
Here's a good reference.

http://www.hackedexistence.com/project/django/video4-tinymce.html

On Monday, August 20, 2012 2:36:22 PM UTC+8, Владислав Иванов wrote:
>
> Hello! I am a novice. I want to install TinyMce on Django. I tried a lot 
> of lessons posted on the Internet, nothing. 3 days can not adjust. Please 
> tell me a link to a detailed and clear tutorial
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/H76sl7cJu_oJ.
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.



Re: send_mail on MAC OS X 10.7

2012-10-03 Thread Kolbe
did you start the sendmail program?

On Tuesday, October 2, 2012 8:45:38 AM UTC+8, Cheng wrote:
>
> Hi,
>
> I am new to django.
>
> I am following The Definitive Guide to Django SECOND EDITION by Adrian 
> Holovaty and Jacob Kaplan -Moss and I cannot get the contact form to send 
> mail. First the eg did not work at all until I added the @csrf-exempt 
> decorator. Keeps getting Error 61 Connection Failure after that. 
>
> Would be grateful if someone can help.
>
> Thanks,
> Cheng
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jxyunyZbPr8J.
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.



Need some help with MySQL and on OSX

2011-06-05 Thread Kolbe
Anyone have any good documentation on getting django with MySQL on OSX
out there?

Cheers!
Kolbe

-- 
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.



Re: Need some help with MySQL and on OSX

2011-06-06 Thread Kolbe
Thanks for the feedback guys. Been using mamp for awhile for other
frameworks (cake), but I still prefer python for scripting at the end
of the day.

Had a few issues with MySQLdb installation. 1st time using django and
it doesn't seem so str8 forward to deploy?

Will work on the recommendations and keep some documentation
throughout the process.

Cheers!

On Jun 6, 1:33 pm, Andy Dustman  wrote:
> Everyone complains, but no one submits patches.
>
> On Mon, Jun 6, 2011 at 12:54 PM, scot.hac...@gmail.com
>
>
>
>
>
>  wrote:
> >> On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote:
>
> >> > Anyone have any good documentation on getting django with MySQL on OSX
> >> > out there?
>
> > It really is amazing how difficult this still is. I've written two
> > guides on this - one for pre-Leopard, one for post-Leopard:
>
> >http://birdhouse.org/blog/2009/02/21/python-mysql-connections-on-mac-os/
> >http://birdhouse.org/blog/2009/09/27/python-mysql-connections-and-sno...
>
> > HTH,
> > ./s
>
> > --
> > 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 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Question the answers

-- 
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.



[gripe] Pain on OSX

2011-07-28 Thread Kolbe
Is it just me, or is it that painful just to get Django running on
OSX?

During development, I had problems with Mysql_db. More or less got
that solved, and been reading postgre is more or less the preferred
choice? Anyway, for most of development, I've been just using sqlite.

Now I have problems with Apache - trying to install mod_wsgi and I
need to first download developer tools to get gcc and etc...

Then there's the problem of a good hosting provider. You'd probably
just want a hosting provider to have the server all ready and all
you'd need to do is upload the files and off you go!

*gripe*

-- 
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.



Re: Pain on OSX

2011-07-28 Thread Kolbe
lol.

what's your recommended build for OSX though if I were to use django?

On Jul 28, 9:41 pm, Shawn Milochik  wrote:
> I've never had a problem with Django on OS X. I have had problems with
> psycopg2 due to the default Python that comes with OS X, but if you
> recompile Python you're fine. I don't use MySQL or Apache.
>
> In any case, it sounds like your complaints have nothing to do with OS
> X. Having said that, various annoyances with OS X have made me switch
> completely to Ubuntu full-time.

-- 
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.



Re: Pain on OSX

2011-07-28 Thread Kolbe
thanks for the pointers guys! really really helpful

On Jul 28, 11:05 pm, Andre Terra  wrote:
> Not to mention SQLite's 'Database is locked' issue.. I too recommend
> postgres.
>
> Cheers,
> AT
>
> On Thu, Jul 28, 2011 at 11:55 AM, william ratcliff <
>
>
>
>
>
>
>
> william.ratcl...@gmail.com> wrote:
> > I also recommend the enterprisedb distribution.   I don't recall rebuilding
> > python for snow lion, but it's been awhile...I have also noticed that
> > sqllite does not enforce all constraints, so it's good to start with
> > postgres sooner rather than later...I can't help you with apache...
>
> > William
>
> > On Thu, Jul 28, 2011 at 10:38 AM, Shawn Milochik wrote:
>
> >> On Thu, Jul 28, 2011 at 10:08 AM, Kolbe 
> >> wrote:
> >> > lol.
>
> >> > what's your recommended build for OSX though if I were to use django?
>
> >> I don't know what you mean by 'build,' but my standard setup was
> >> compiling my own Python (requires installing XCode) and using
> >> PostgreSQL (using the EnterpriseDB installer).
>
> >> Then a virtualenv for each project with --no-site-packages used.
>
> >> That's pretty much it. I use Postgres instead of sqlite because sqlite
> >> doesn't enforce all the constraints so, for example, unique_together
> >> isn't enforced. When you go to production you'll get errors you missed
> >> in development. If you use sqlite in production as well then you'll
> >> miss the errors completely and end up with different data than you
> >> expected.
>
> >> The only "trick" to it was compiling psycopg2 (the Postgres driver for
> >> Python). It only works with 32-bit Python, so you'll have to compile
> >> Python as 32-bit instead of the default 64 that comes with OS X.
> >> Here's a blog post I wrote about how to take care of that.
> >>http://shawnmilo.blogspot.com/2009/11/psycopg2-on-snow-leopard.html
>
> >> --
> >> 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.
>
> >  --
> > 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.

-- 
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.



manage.py setting sys.path wrong

2007-03-29 Thread Lukas Kolbe

Hi!

I have a problem I came across for a while now.

To start the fcgi-instance, I use manage.py as follows:

su -c "DJANGO_DB_NAME=dbname DJANGO_DB_PASS=dbpass \
  DJANGO_DB_USER=dbuser DJANGO_SECRET_KEY=secret \
  /srv/vhosts/myhost/site/manage.py runfcgi daemonize=false \
  socket=/srv/sockets/django-einfachkaffee.de.socket" \
  webuser

I need the environment variables because they get used in site.settings.

manage.py sets sys.path as follows:


['/srv/vhosts/myhost/site', '/usr/lib/python24.zip',
'/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages/PIL',
'/var/lib/python-support/python2.4']

while the first element clearly should be /srv/vhosts/myhost/,
not /srv/vhosts/myhost/site. Consequently, manage.py does do nothing but
spit an error - 

EnvironmentError: Could not import settings 'site.settings' (Is it on
sys.path? Does it have syntax errors?): No module named settings

Of course, because settings.py lives in /srv/vhosts/myhost/site/,
not /srv/vhosts/myhost/site/site!

Is there anything I can do about it?

Kind regards,
Lukas



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: manage.py setting sys.path wrong

2007-03-29 Thread Lukas Kolbe

> On Thu, Mar 29, 2007 at 02:26:32PM +0200, Lukas Kolbe wrote:
> > 
> > Hi!
> > 
> > I have a problem I came across for a while now.
> > 
> > To start the fcgi-instance, I use manage.py as follows:
> > 
> > su -c "DJANGO_DB_NAME=dbname DJANGO_DB_PASS=dbpass \
> >   DJANGO_DB_USER=dbuser DJANGO_SECRET_KEY=secret \
> >   /srv/vhosts/myhost/site/manage.py runfcgi daemonize=false \
> >   socket=/srv/sockets/django-einfachkaffee.de.socket" \
> >   webuser
> > 

> Try...
> 
>  su -c "PYTHONPATH=/srv/vhosts/mysite/site \
>DJANGO_DB_NAME=dbname DJANGO_DB_PASS=dbpass \
>DJANGO_DB_USER=dbuser DJANGO_SECRET_KEY=secret \
>/srv/vhosts/myhost/site/manage.py runfcgi daemonize=false \
>socket=/srv/sockets/django-einfachkaffee.de.socket" \
>webuser

I tried. If I set PYTHONPATH to /srv/vhosts/mysite, I get:

Traceback (most recent call last):
  File "/srv/vhosts/mysite/site/manage.py", line 2, in ?
from django.core.management import execute_manager
ImportError: No module named django.core.management

If I set PYTHONPATH to /srv/vhosts/mysite/site, I get the same error as
if I don't set PYTHONPATH.


> Cheers,

Thanks,
Lukas



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: manage.py setting sys.path wrong

2007-03-29 Thread Lukas Kolbe

Am Donnerstag, den 29.03.2007, 23:54 +1000 schrieb Malcolm Tredinnick:

Okay okay, you got me there. I wondered if I missed anything and looked
again at the django tutorial (which I didn't to for quite a while), and
what's there? Yes, from tutorial number 1:

> 
> You’ll need to avoid naming projects after built-in Python or Django
> components. In particular, this means you should avoid using names
> like django (which will conflict with Django itself) or site (which
> conflicts with a built-in Python package).
> 

Okay. I renamed my project from "site" to another name ... and voila,
everything works as expected.


> What is actually raising this error? Inside Django, we only do "import
> settings" everywhere, as far as I can see -- we intentionally don't use
> the project directory name (because it need not exist). For example,
> manage.py only has "import settings" in it's code.

I don't know exactly where this error happens. On my old server, i used
the "site"-name a lot, but did crazy things with PYTHONPATH to make that
working IIRC, and I didn't want to do these things again.

> So is this error being raised from somewhere in your own code or inside
> Django's code? I realise that the error message itself is coming from
> django.conf, because I recognise the text, but I'm interested in what is
> trying to use that name to do the import (rather than just "settings").
> 
> By default, manage.py only adds the directory containing manage.py to
> the Python path, so what you are seeing here as your path is expected
> behaviour. 


Okay, thanks for the explanation, makes complete sense to me!


> Otherwise, the solution is probably to set PYTHONPATH to include both
> your project directory and the location of the Django source (from a
> later message in this thread, it looks like your Django source is not
> installed inside /usr/lib/python*/site-packages -- true?).

It is in /usr/local/lib/python2.4/site-packages, which - in debian -
gets added to the pythonpath.

> Regards,
> Malcolm

Thanks for taking the time!

-- 
Lukas



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---