Re: Responsive design

2013-09-28 Thread Jasvir Singh
On Thu, Sep 26, 2013 at 1:48 PM, Jasvir Singh  wrote:
> Could anyone please tell me, how to make responsive design
> in django?
Thanks everyone.
Please give me links of some responsive website made in django.

-- 

Jasvir Singh Grewal
Blog:http://jasvirsinghgrewal91.wordpress.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: custom if tag

2013-09-28 Thread Vibhu Rishi
Hi Alagappan,

The assignment_tag worked perfectly for me !

Thanks!
Vibhu


On Tue, Sep 24, 2013 at 1:01 AM, Alagappan  wrote:

> You can implement has_applied as a filter instead of a template tag.
> https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters
> Haven't check it, but something like {% if user|has_applied_filter:
> opening %} should essentially work out for your case.
>
>
> Another alternative could be use of assignment 
> tags.
> From documentation "This function works the same way as 
> simple_tag,
> except that it stores the tag’s result in a specified context variable
> instead of directly outputting it.".
>
> Regards,
> Alagappan R
>
> Twitter: @_alagappan 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Static files configuration

2013-09-28 Thread Jason S
Thanks Tom, 
I ran the command python manage.py collectstatic and it copied across new 
static content i've added to [project]/static/ which is my STATIC_ROOT. But 
still no css for the admin pages.

Also thanks, I do have to set those up and figure them out, I've seen a few 
tuts for them so will look at that next.

On Saturday, 28 September 2013 13:58:15 UTC-10, Thomas wrote:
>
>
> On 2013-09-28, at 4:21 PM, Jason S  wrote:
>
> Thanks Tom,
> I had a pretty painful install experience over a few weeks and had sudo'd 
> a command I shouldn't have when doing the GAE install. 
> After that experience i'd thought it'd be a pain to sort it out but i've 
> just chown'd the project directory and the /tmp/dev_appserver.searchindexes 
> (after making a backup) and its fine.
>
> Also your right I have recently added django.contrib.staticfiles to my 
> INSTALLED_APPS list, so that may well be it.
>
> So i'm able to start the dev server as a standard user now and have my 
> static content for my project served from [project]/templates/static/ but 
> managed to break the admin css in the process.
>
>
> I'm pretty sure mine is getting picked up after running "python manage.py 
> collect_static" since that css lives somewhere in your installed python 
> code.
>
> btw, if you aren't using virtualenv and pip for python packages I would 
> highly recommend that you spend a few minutes to get that going.
>
> - Tom
>
>
> INFO:root:"GET / HTTP/1.1" 200 -
> INFO:root:"GET /static/css/base.css HTTP/1.1" 200 -
> INFO:root:"GET /static/img/MainBanner.png HTTP/1.1" 200 -
> INFO:root:"GET /admin HTTP/1.1" 301 -
> INFO:root:"GET /admin/ HTTP/1.1" 200 -
> INFO:root:"GET /admin/css/base.css HTTP/1.1" 404 -
> INFO:root:"GET /admin/css/dashboard.css HTTP/1.1" 404 -
> INFO:root:"GET /admin HTTP/1.1" 301 -
> INFO:root:"GET /admin/ HTTP/1.1" 200 -
> INFO:root:"GET /admin/css/base.css HTTP/1.1" 404 -
> INFO:root:"GET /admin/css/dashboard.css HTTP/1.1" 404 -
>
> I've put the base.css file everywhere in the hopes of finding a location 
> that the admin module will pick it up from, but have just made a mess 
> can you advise where I should expect the admin module to pick up it's CSS? 
> Once i've gotten the admin CSS working and confirmed the dev site's static 
> content is still working, i'll clean all of the directories with CSS that 
> aren't needed in the myapp directory and can start trying to make something!
>
> ./django-1.4/django/contrib/admin/static/admin/admin/css/base.css
> ./django-1.4/django/contrib/admin/static/admin/css/base.css
> ./myapp/admin/admin/css/base.css
> ./myapp/admin/css/base.css
> ./myapp/templates/admin/css/base.css
> ./myapp/templates/static/css/base.css
> ./myapp/blogtut/static/css/base.css
> ./myapp/css/base.css
> ./myapp/static/admin/admin/css/base.css
> ./myapp/static/admin/css/base.css
> ./myapp/static/css/base.css
> ./django-testapp/admin/admin/admin/css/base.css
> ./django-testapp/templates/admin/admin/css/base.css
>
>
>
>
> On Saturday, 28 September 2013 13:03:07 UTC-10, Thomas wrote:
>>
>>
>> On 2013-09-28, at 3:27 PM, Jason S  wrote: 
>>
>> > I can now access my CSS file and i've confirmed it's location by 
>> changing its name and confirming the dev server can't see it any more.after 
>> I change the file name. 
>> > 
>> > The directory its finding it is under [project]/templates/static/css 
>> > Sorry, no idea why its working but I suspect its permissions based as 
>> i'm running udo python manage.py runserver 0.0.0.0:8080 
>> > I think the dev server is only accessing files owned by root? It 
>> doesn't sound right though. 
>>
>> Is there another reason you are running as root? I've been doing all 
>> development with my normal user account and have seen no issues at all. If 
>> you do have permissions problems those should go away if everything is 
>> owned by you rather than root. 
>>
>> And you may have enabled django.contrib.staticfiles in your 
>> INSTALLED_APPS. I think that helps to find files when you are running the 
>> development server. There is a nice chapter in the Django docs on serving 
>> static files. 
>>
>> hth 
>>
>> - Tom 
>>
>>
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> Tom Lockhart
> tlockh...@gmail.com 
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.

Re: Static files configuration

2013-09-28 Thread Tom Lockhart

On 2013-09-28, at 4:58 PM, Tom Lockhart  wrote:

> 
> On 2013-09-28, at 4:21 PM, Jason S  wrote:
> 
>> Thanks Tom,
>> I had a pretty painful install experience over a few weeks and had sudo'd a 
>> command I shouldn't have when doing the GAE install. 
>> After that experience i'd thought it'd be a pain to sort it out but i've 
>> just chown'd the project directory and the /tmp/dev_appserver.searchindexes 
>> (after making a backup) and its fine.
>> 
>> Also your right I have recently added django.contrib.staticfiles to my 
>> INSTALLED_APPS list, so that may well be it.
>> 
>> So i'm able to start the dev server as a standard user now and have my 
>> static content for my project served from [project]/templates/static/ but 
>> managed to break the admin css in the process.
> 
> I'm pretty sure mine is getting picked up after running "python manage.py 
> collect_static" since that css lives somewhere in your installed python code.

Whoops. There is no underscore in the command. Sorry about that.

- Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Static files configuration

2013-09-28 Thread Tom Lockhart

On 2013-09-28, at 4:21 PM, Jason S  wrote:

> Thanks Tom,
> I had a pretty painful install experience over a few weeks and had sudo'd a 
> command I shouldn't have when doing the GAE install. 
> After that experience i'd thought it'd be a pain to sort it out but i've just 
> chown'd the project directory and the /tmp/dev_appserver.searchindexes (after 
> making a backup) and its fine.
> 
> Also your right I have recently added django.contrib.staticfiles to my 
> INSTALLED_APPS list, so that may well be it.
> 
> So i'm able to start the dev server as a standard user now and have my static 
> content for my project served from [project]/templates/static/ but managed to 
> break the admin css in the process.

I'm pretty sure mine is getting picked up after running "python manage.py 
collect_static" since that css lives somewhere in your installed python code.

btw, if you aren't using virtualenv and pip for python packages I would highly 
recommend that you spend a few minutes to get that going.

- Tom

> 
> INFO:root:"GET / HTTP/1.1" 200 -
> INFO:root:"GET /static/css/base.css HTTP/1.1" 200 -
> INFO:root:"GET /static/img/MainBanner.png HTTP/1.1" 200 -
> INFO:root:"GET /admin HTTP/1.1" 301 -
> INFO:root:"GET /admin/ HTTP/1.1" 200 -
> INFO:root:"GET /admin/css/base.css HTTP/1.1" 404 -
> INFO:root:"GET /admin/css/dashboard.css HTTP/1.1" 404 -
> INFO:root:"GET /admin HTTP/1.1" 301 -
> INFO:root:"GET /admin/ HTTP/1.1" 200 -
> INFO:root:"GET /admin/css/base.css HTTP/1.1" 404 -
> INFO:root:"GET /admin/css/dashboard.css HTTP/1.1" 404 -
> 
> I've put the base.css file everywhere in the hopes of finding a location that 
> the admin module will pick it up from, but have just made a mess can you 
> advise where I should expect the admin module to pick up it's CSS? 
> Once i've gotten the admin CSS working and confirmed the dev site's static 
> content is still working, i'll clean all of the directories with CSS that 
> aren't needed in the myapp directory and can start trying to make something!
> 
> ./django-1.4/django/contrib/admin/static/admin/admin/css/base.css
> ./django-1.4/django/contrib/admin/static/admin/css/base.css
> ./myapp/admin/admin/css/base.css
> ./myapp/admin/css/base.css
> ./myapp/templates/admin/css/base.css
> ./myapp/templates/static/css/base.css
> ./myapp/blogtut/static/css/base.css
> ./myapp/css/base.css
> ./myapp/static/admin/admin/css/base.css
> ./myapp/static/admin/css/base.css
> ./myapp/static/css/base.css
> ./django-testapp/admin/admin/admin/css/base.css
> ./django-testapp/templates/admin/admin/css/base.css
> 
> 
> 
> 
> On Saturday, 28 September 2013 13:03:07 UTC-10, Thomas wrote:
> 
> On 2013-09-28, at 3:27 PM, Jason S  wrote: 
> 
> > I can now access my CSS file and i've confirmed it's location by changing 
> > its name and confirming the dev server can't see it any more.after I change 
> > the file name. 
> > 
> > The directory its finding it is under [project]/templates/static/css 
> > Sorry, no idea why its working but I suspect its permissions based as i'm 
> > running udo python manage.py runserver 0.0.0.0:8080 
> > I think the dev server is only accessing files owned by root? It doesn't 
> > sound right though. 
> 
> Is there another reason you are running as root? I've been doing all 
> development with my normal user account and have seen no issues at all. If 
> you do have permissions problems those should go away if everything is owned 
> by you rather than root. 
> 
> And you may have enabled django.contrib.staticfiles in your INSTALLED_APPS. I 
> think that helps to find files when you are running the development server. 
> There is a nice chapter in the Django docs on serving static files. 
> 
> hth 
> 
> - Tom 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.

Tom Lockhart
tlockhart1...@gmail.com



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
<>

Re: Static files configuration

2013-09-28 Thread Jason S
Thanks Tom,
I had a pretty painful install experience over a few weeks and had sudo'd a 
command I shouldn't have when doing the GAE install. 
After that experience i'd thought it'd be a pain to sort it out but i've 
just chown'd the project directory and the /tmp/dev_appserver.searchindexes 
(after making a backup) and its fine.

Also your right I have recently added django.contrib.staticfiles to my 
INSTALLED_APPS list, so that may well be it.

So i'm able to start the dev server as a standard user now and have my 
static content for my project served from [project]/templates/static/ but 
managed to break the admin css in the process.

INFO:root:"GET / HTTP/1.1" 200 -
INFO:root:"GET /static/css/base.css HTTP/1.1" 200 -
INFO:root:"GET /static/img/MainBanner.png HTTP/1.1" 200 -
INFO:root:"GET /admin HTTP/1.1" 301 -
INFO:root:"GET /admin/ HTTP/1.1" 200 -
INFO:root:"GET /admin/css/base.css HTTP/1.1" 404 -
INFO:root:"GET /admin/css/dashboard.css HTTP/1.1" 404 -
INFO:root:"GET /admin HTTP/1.1" 301 -
INFO:root:"GET /admin/ HTTP/1.1" 200 -
INFO:root:"GET /admin/css/base.css HTTP/1.1" 404 -
INFO:root:"GET /admin/css/dashboard.css HTTP/1.1" 404 -

I've put the base.css file everywhere in the hopes of finding a location 
that the admin module will pick it up from, but have just made a mess 
can you advise where I should expect the admin module to pick up it's CSS? 
Once i've gotten the admin CSS working and confirmed the dev site's static 
content is still working, i'll clean all of the directories with CSS that 
aren't needed in the myapp directory and can start trying to make something!

./django-1.4/django/contrib/admin/static/admin/admin/css/base.css
./django-1.4/django/contrib/admin/static/admin/css/base.css
./myapp/admin/admin/css/base.css
./myapp/admin/css/base.css
./myapp/templates/admin/css/base.css
./myapp/templates/static/css/base.css
./myapp/blogtut/static/css/base.css
./myapp/css/base.css
./myapp/static/admin/admin/css/base.css
./myapp/static/admin/css/base.css
./myapp/static/css/base.css
./django-testapp/admin/admin/admin/css/base.css
./django-testapp/templates/admin/admin/css/base.css




On Saturday, 28 September 2013 13:03:07 UTC-10, Thomas wrote:
>
>
> On 2013-09-28, at 3:27 PM, Jason S  
> wrote: 
>
> > I can now access my CSS file and i've confirmed it's location by 
> changing its name and confirming the dev server can't see it any more.after 
> I change the file name. 
> > 
> > The directory its finding it is under [project]/templates/static/css 
> > Sorry, no idea why its working but I suspect its permissions based as 
> i'm running udo python manage.py runserver 0.0.0.0:8080 
> > I think the dev server is only accessing files owned by root? It doesn't 
> sound right though. 
>
> Is there another reason you are running as root? I've been doing all 
> development with my normal user account and have seen no issues at all. If 
> you do have permissions problems those should go away if everything is 
> owned by you rather than root. 
>
> And you may have enabled django.contrib.staticfiles in your 
> INSTALLED_APPS. I think that helps to find files when you are running the 
> development server. There is a nice chapter in the Django docs on serving 
> static files. 
>
> hth 
>
> - Tom 
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Static files configuration

2013-09-28 Thread Tom Lockhart

On 2013-09-28, at 3:27 PM, Jason S  wrote:

> I can now access my CSS file and i've confirmed it's location by changing its 
> name and confirming the dev server can't see it any more.after I change the 
> file name.
> 
> The directory its finding it is under [project]/templates/static/css
> Sorry, no idea why its working but I suspect its permissions based as i'm 
> running udo python manage.py runserver 0.0.0.0:8080
> I think the dev server is only accessing files owned by root? It doesn't 
> sound right though.

Is there another reason you are running as root? I've been doing all 
development with my normal user account and have seen no issues at all. If you 
do have permissions problems those should go away if everything is owned by you 
rather than root.

And you may have enabled django.contrib.staticfiles in your INSTALLED_APPS. I 
think that helps to find files when you are running the development server. 
There is a nice chapter in the Django docs on serving static files.

hth

- Tom



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Static files configuration

2013-09-28 Thread Jason S
I can now access my CSS file and i've confirmed it's location by changing 
its name and confirming the dev server can't see it any more.after I change 
the file name.

The directory its finding it is under [project]/templates/static/css
Sorry, no idea why its working but I suspect its permissions based as i'm 
running udo python manage.py runserver 0.0.0.0:8080
I think the dev server is only accessing files owned by root? It doesn't 
sound right though.


On Saturday, 28 September 2013 11:29:07 UTC-10, Jason S wrote:
>
> Hi,
> I'm new to django and web development but have set up a project and run 
> through a few python and django tuts.
> I've gotten stuck importing CSS (and other static content) using the 
> static settings available in the settings.py file and have attempted to 
> resolve the issue by referring to a sample project and documentation and 
> have ended up pretty confused.
>
> I'd appreciate any help or thoughts and thanks in advance for taking the 
> time to read and help with my issue.
>
> I've ended up with a few "static" directories as follows:
> [project]/static
> [project]/templates/static
> [project]/[app]/static
>
> Ideally all the static content for each app would be served from 
> [project]/[app]/static and general static content from [project]/static
> Please call this out if its not best practise, I've got to learn that as 
> well!
>
> I'm calling the static content using  and at one point I was able to locate the 
> "test.css" file using python manage.py findstatic css/test.css in 
> [project]/static/css/ but I've made too many changes to get back to it. I 
> know I should be using git or similar to manage my changes, but one step at 
> a time...
>
> I've made alot of changes over about 4-5 hours, so I'd appreciate help 
> correcting my config and tidying it so it performs as expected but also in 
> removing any unnecessary components I've added. Note i've substituted some 
> details, like the user and project name with [user] etc
>
> cat settings.py
> # Initialize App Engine and import the default settings (DB backend, etc.).
> # If you want to use a different backend you have to remove all occurences
> # of "djangoappengine" from this file.
> from djangoappengine.settings_base import *
>
> import os
> import os.path # from blogtut
>
> # Activate django-dbindexer for the default database
> DATABASES['native'] = DATABASES['default']
> DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'}
> #DATABASES['my_tumble_log'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'}
> AUTOLOAD_SITECONF = 'indexes'
>
> SECRET_KEY = '[OMITTED, just in case]'
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.contenttypes',
> 'django.contrib.auth',
> 'django.contrib.sessions',
> 'django.contrib.staticfiles',
> 'djangotoolbox',
> 'autoload',
> 'dbindexer',
>
> # djangoappengine should come last, so it can override a few manage.py 
> commands
> 'djangoappengine',
>
> # Jason's apps
> 'blogtut',
>
> # Core
>'core',
> )
>
> MIDDLEWARE_CLASSES = (
> # This loads the index definitions, so it has to come first
> 'autoload.middleware.AutoloadMiddleware',
>
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> )
>
> TEMPLATE_CONTEXT_PROCESSORS = (
> 'django.contrib.auth.context_processors.auth',
> 'django.core.context_processors.request',
> 'django.core.context_processors.media',
> 'django.core.context_processors.static'
> )
>
> # This test runner captures stdout and associates tracebacks with their
> # corresponding output. Helps a lot with print-debugging.
> TEST_RUNNER = 'djangotoolbox.test.CapturingTestSuiteRunner'
>
> STATIC_URL = '/static'
> STATICFILES_DIRS = (
> "/home/[user]/[project]/myapp/templates/static",
> "/home/[user]/[project]/myapp/blogtut/static")
> STATIC_ROOT = '/home/[user]/[project]/myapp/static'
>
> STATICFILES_FINDERS = (
> "django.contrib.staticfiles.finders.FileSystemFinder",
> "django.contrib.staticfiles.finders.AppDirectoriesFinder")
>
> #ADMIN_MEDIA_PREFIX = '/media/admin/'
> TEMPLATE_DIRS = (
> os.path.join(os.path.dirname(__file__), 'templates'),
> os.path.join(os.path.realpath(__file__), '../templates'),
> )
>
> #MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media")
> #MEDIA_URL = '/media/'
> #IMAGE_URL = '/media/image/'
>
> LOGIN_URL = '/login/'
> LOGOUT_URL = '/logout/'
> LOGIN_REDIRECT_URL = '/'
>
> ROOT_URLCONF = 'urls'
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at 

Re: Basic query regarding admin CSS

2013-09-28 Thread Jason S
Hi, 
This is fixed, I think it was as I was missing one of the entries below:
 37 MIDDLEWARE_CLASSES = (
 38 # This loads the index definitions, so it has to come first
 39 'autoload.middleware.AutoloadMiddleware',
 40
 41 'django.middleware.common.CommonMiddleware',
 42 'django.contrib.sessions.middleware.SessionMiddleware',
 43 'django.contrib.messages.middleware.MessageMiddleware',
 44 'django.contrib.auth.middleware.AuthenticationMiddleware',
 45 )
 46
 47 TEMPLATE_CONTEXT_PROCESSORS = (
 48 'django.contrib.auth.context_processors.auth',
 49 'django.core.context_processors.request',
 50 'django.core.context_processors.media',
 51 'django.core.context_processors.static'
 52 )

On Friday, 27 September 2013 19:54:21 UTC-10, Jason S wrote:
>
> Hi,
> I'm new to development and have just gone from some python and django 
> tuts, on my way to developing my first app.
> I've created a model and can view it under the /admin page, however the 
> page does not use any of the pretty CSS you see in the tutorials because it 
> can't find the files:
>
> INFO:root:"GET /admin/ HTTP/1.1" 200 -
> INFO:root:"GET /admin/admin/css/base.css HTTP/1.1" 404 -
> INFO:root:"GET /admin/admin/css/dashboard.css HTTP/1.1" 404 -
>
> I've got the css, img and js folders for the admin site in the following 
> places:
> [myproject]/admin/admin
> [myproject]/templates/admin/admin
>
> I tried to view one of the CSS files directly via the browser for more 
> information and it displays the urls it searches.
> I'd appreciate if someone could tell me what i'm missing.
>
> http://192.168.20.204:8080/admin/admin/css/dashboard.css
> Page not found (404)Request Method:GETRequest URL:
> http://192.168.20.204:8080/admin/admin/css/dashboard.css
>
> Using the URLconf defined in urls, Django tried these URL patterns, in 
> this order:
>
>1. ^_ah/warmup$
>2. ^media/(?P.*)$
>3. ^admin/ ^$ [name='index']
>4. ^admin/ ^logout/$ [name='logout']
>5. ^admin/ ^password_change/$ [name='password_change']
>6. ^admin/ ^password_change/done/$ [name='password_change_done']
>7. ^admin/ ^jsi18n/$ [name='jsi18n']
>8. ^admin/ ^r/(?P\d+)/(?P.+)/$
>9. ^admin/ ^(?P\w+)/$ [name='app_list']
>10. ^admin/ ^blogtut/post/
>11. ^admin/ ^blogtut/comment/
>12. ^admin/ ^auth/user/
>13. ^admin/ ^blogtut/measurementtype/
>14. ^admin/ ^blogtut/measurementunits/
>15. ^$
>16. ^login/$
>17. ^logout/$
>18. ^posts/new/$
>19. ^posts/$
>20. ^$ [name='home']
>21. ^post/(?P[a-zA-Z0-9-]+)/$ [name='post']
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Static files configuration

2013-09-28 Thread Jason S
Hi,
I'm new to django and web development but have set up a project and run 
through a few python and django tuts.
I've gotten stuck importing CSS (and other static content) using the static 
settings available in the settings.py file and have attempted to resolve 
the issue by referring to a sample project and documentation and have ended 
up pretty confused.

I'd appreciate any help or thoughts and thanks in advance for taking the 
time to read and help with my issue.

I've ended up with a few "static" directories as follows:
[project]/static
[project]/templates/static
[project]/[app]/static

Ideally all the static content for each app would be served from 
[project]/[app]/static and general static content from [project]/static
Please call this out if its not best practise, I've got to learn that as 
well!

I'm calling the static content using  and at one point I was able to locate the 
"test.css" file using python manage.py findstatic css/test.css in 
[project]/static/css/ but I've made too many changes to get back to it. I 
know I should be using git or similar to manage my changes, but one step at 
a time...

I've made alot of changes over about 4-5 hours, so I'd appreciate help 
correcting my config and tidying it so it performs as expected but also in 
removing any unnecessary components I've added. Note i've substituted some 
details, like the user and project name with [user] etc

cat settings.py
# Initialize App Engine and import the default settings (DB backend, etc.).
# If you want to use a different backend you have to remove all occurences
# of "djangoappengine" from this file.
from djangoappengine.settings_base import *

import os
import os.path # from blogtut

# Activate django-dbindexer for the default database
DATABASES['native'] = DATABASES['default']
DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'}
#DATABASES['my_tumble_log'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'}
AUTOLOAD_SITECONF = 'indexes'

SECRET_KEY = '[OMITTED, just in case]'

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.staticfiles',
'djangotoolbox',
'autoload',
'dbindexer',

# djangoappengine should come last, so it can override a few manage.py 
commands
'djangoappengine',

# Jason's apps
'blogtut',

# Core
   'core',
)

MIDDLEWARE_CLASSES = (
# This loads the index definitions, so it has to come first
'autoload.middleware.AutoloadMiddleware',

'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.static'
)

# This test runner captures stdout and associates tracebacks with their
# corresponding output. Helps a lot with print-debugging.
TEST_RUNNER = 'djangotoolbox.test.CapturingTestSuiteRunner'

STATIC_URL = '/static'
STATICFILES_DIRS = (
"/home/[user]/[project]/myapp/templates/static",
"/home/[user]/[project]/myapp/blogtut/static")
STATIC_ROOT = '/home/[user]/[project]/myapp/static'

STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder")

#ADMIN_MEDIA_PREFIX = '/media/admin/'
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates'),
os.path.join(os.path.realpath(__file__), '../templates'),
)

#MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media")
#MEDIA_URL = '/media/'
#IMAGE_URL = '/media/image/'

LOGIN_URL = '/login/'
LOGOUT_URL = '/logout/'
LOGIN_REDIRECT_URL = '/'

ROOT_URLCONF = 'urls'



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: new django template

2013-09-28 Thread +Emmanuel
>From the error message, there should be a template named 'name.html' under 
the folder '/en/contact' which should be under the templates folder. Create 
a folder 'en' within the templates folder. Then create another folder 
'contact' within the 'en' folder. Put your 'name.html' file in the 
'contact' folder. That should work.

On Friday, September 27, 2013 6:03:40 PM UTC+3, Frédéric Bouin wrote:
>
> I am trying to edit some things in django and am running into a few 
> problems as I am quite new to it.
>
> I am working off an existing django configuration with templates that 
> currently work, but I don't really understand how to create new templates. 
> If I create a new .html file in my templates folder in "myprojects" and 
> then declare the new template under cms_templates = (...) in settings.py 
> nothing happens. Am I missing a step to get the template to upload and 
> appear in my cms?
>
> I also had a problem with an existing template, when I try to go to the 
> contact page I am told that the template does not exist: 
> http://paul.evansoderberg.com/en/contact/
> The template is declared under "cms_templates", the file exists in the 
> templates folder, and the page is created in django cms, yet I get this 
> error message.
>
> Help would be greatly appreciated, thank you.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Cardiff Django users group

2013-09-28 Thread Daniele Procida
I'm starting a user group for Django developers in Cardiff, Wales.

Email list: 

The plan is to hold meetings monthly, probably on a Wednesday evening with 
occasional events on weekends. 

I'm trying to get a suitable venue with good wireless access organised at 
Cardiff University, but there are other options.

Daniele

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


KeyError: Key 'slug' not found in Form

2013-09-28 Thread Roberto López López

Hi,

I am trying to translate my model using django-modeltranslation and the
SlugField is giving me a lot of trouble. I have successfully registered
the fields for translation, as you can see in the db table description:

| Table "public.news_news"
Column|   Type   |   Modifiers  
  
--+--+
 id   | integer  | not null default 
nextval('news_news_id_seq'::regclass)
 title| character varying(255)   | not null
 title_en | character varying(255)   | 
 title_nb | character varying(255)   | 
 slug | character varying(50)| not null
 slug_en  | character varying(50)| 
 slug_nb  | character varying(50)||

But when I try to add a new News item, I am getting the following error:

|Traceback: File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/core/handlers/base.py"
 in get_response
  115. response = callback(request, *callback_args, 
**callback_kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/contrib/admin/options.py"
 in wrapper
  372. return self.admin_site.admin_view(view)(*args, **kwargs) 
File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/utils/decorators.py"
 in _wrapped_view
  91. response = view_func(request, *args, **kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/views/decorators/cache.py"
 in _wrapped_view_func
  89. response = view_func(request, *args, **kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/contrib/admin/sites.py"
 in inner
  202. return view(request, *args, **kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/utils/decorators.py"
 in _wrapper
  25. return bound_func(*args, **kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/utils/decorators.py"
 in _wrapped_view
  91. response = view_func(request, *args, **kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/utils/decorators.py"
 in bound_func
  21. return func(self, *args2, **kwargs2) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/db/transaction.py"
 in inner
  223. return func(*args, **kwargs) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/contrib/admin/options.py"
 in add_view
  1036. model_admin=self) File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/contrib/admin/helpers.py"
 in __init__
  35. } for field_name, dependencies in prepopulated_fields.items()] 
File 
"/home/roberto/.virtualenvs/ve_news/local/lib/python2.7/site-packages/django/forms/forms.py"
 in __getitem__
  111. raise KeyError('Key %r not found in Form' % name)

Exception Type: KeyError at /en/admin/news/news/add/ Exception Value: u"Key 
'slug' not found in Form"|

My admin.py :

|from cmsplugin_news.admin import NewsAdmin as OldNewsAdmin

class NewsAdmin(OldNewsAdmin, TranslationAdmin,):
fields = ('title', 'slug')
form = NewNewsForm|

models.py:

|class News(models.Model):
title = models.CharField(_('Title'), max_length=255)
slug = models.SlugField(
_('Slug'), unique_for_date='pub_date',
)|

and forms.py:

|class NewNewsForm(forms.ModelForm):
class Meta:
model = News
fields = ('title', 'slug', )|

As well, this is my translation.py where I declare the fields that
should be translated by django-modeltranslation. I suppose anyhow that
the error is not here, as the fields are already translated in db:

|class NewsTranslationOptions(TranslationOptions):
fields = ('title', 'slug', 'excerpt', 'content')

translator.register(News, NewsTranslationOptions)|

Any help please? I am really stuck! Thanks!

Roberto

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Basic query regarding admin CSS

2013-09-28 Thread Jason S
Hi,
I'm new to development and have just gone from some python and django tuts, 
on my way to developing my first app.
I've created a model and can view it under the /admin page, however the 
page does not use any of the pretty CSS you see in the tutorials because it 
can't find the files:

INFO:root:"GET /admin/ HTTP/1.1" 200 -
INFO:root:"GET /admin/admin/css/base.css HTTP/1.1" 404 -
INFO:root:"GET /admin/admin/css/dashboard.css HTTP/1.1" 404 -

I've got the css, img and js folders for the admin site in the following 
places:
[myproject]/admin/admin
[myproject]/templates/admin/admin

I tried to view one of the CSS files directly via the browser for more 
information and it displays the urls it searches.
I'd appreciate if someone could tell me what i'm missing.

http://192.168.20.204:8080/admin/admin/css/dashboard.css
Page not found (404)Request Method:GETRequest URL:
http://192.168.20.204:8080/admin/admin/css/dashboard.css

Using the URLconf defined in urls, Django tried these URL patterns, in this 
order:

   1. ^_ah/warmup$
   2. ^media/(?P.*)$
   3. ^admin/ ^$ [name='index']
   4. ^admin/ ^logout/$ [name='logout']
   5. ^admin/ ^password_change/$ [name='password_change']
   6. ^admin/ ^password_change/done/$ [name='password_change_done']
   7. ^admin/ ^jsi18n/$ [name='jsi18n']
   8. ^admin/ ^r/(?P\d+)/(?P.+)/$
   9. ^admin/ ^(?P\w+)/$ [name='app_list']
   10. ^admin/ ^blogtut/post/
   11. ^admin/ ^blogtut/comment/
   12. ^admin/ ^auth/user/
   13. ^admin/ ^blogtut/measurementtype/
   14. ^admin/ ^blogtut/measurementunits/
   15. ^$
   16. ^login/$
   17. ^logout/$
   18. ^posts/new/$
   19. ^posts/$
   20. ^$ [name='home']
   21. ^post/(?P[a-zA-Z0-9-]+)/$ [name='post']

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Stephen McDonald
Hey Anton,

Here's good deep-dive into Mezzanine only published 24 hours ago:

http://blog.liip.ch/archive/2013/09/27/mezzanine-cms-hackday.html


On Saturday, 28 September 2013 02:35:28 UTC+10, Anton Melser wrote:
>
> Hi,
>
> I'm pretty new to Django/Python and I'm starting a fairly major project 
> (hopefully next 2+ years of my life :-)). If all goes well, there will be 
> several developers on the project in a year or two - getting our hands 
> dirty is what it's all about. Use something I know? PHP/.NET/Java - no 
> thanks! It's going to be a long road and I've quickly seen the superiority 
> of Python and the ease of development with Django and I'm definitely in for 
> the long haul so... 
>
> There is quite a bit of functionality that has been written 50k times 
> before and I'd rather not reinvent, like advanced user management (social 
> everything yadda yadda), some nice templates to start with (supporting 
> bootstrap 3 within the next 2-3 months or so) and dynamic theming, blog, 
> article management, easy plugging to search backends, content and user 
> rating, unit tests, etc.
>
> Beta versions are fine as long as the latest sexy version will go stable 
> within 2-3 months and contributing back is a given, at least while it 
> remains viable.
>
> So I've been looking around at what to start with and there is quite a bit 
> of choice. Django-CMS, Mezzanine, FeinCMS to name but a few... 
>
> The stuff I refer to above is stuff I would REALLY like to have out of the 
> box (ie, it's what we're starting with), for the rest (marketplace, 
> mapping, geo-location, kitchen sink, etc.) we just need for it to be easy 
> to add new modules which by then I/we should be able to write from scratch 
> anyway, if needed. Other stuff we probably don't need at all like 
> multi-lang.
>
> I guess the only other particularity is that we are going to need 
> excellent caching - we are expecting around 90% of the traffic on 2-3 days 
> and serious peaking within that. Going PAAS is not out of the question but 
> if we can get away with some advanced caching then I'd rather start with 
> that and then if cashflow warrants it re-evaluate the situation later. 
>
> So, should I start with a CMS? If so, which one? What I'm really looking 
> for is a base to start with that I don't end up saying "why the #!@& did I 
> start with X" in 12 months time...
>
> Any opinions or insults are most welcome!
>
> Thanks,
> Anton
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Anton Melser


> Hey Anton,
>
> From my experience if it's a 2 year project you're building don't use a 
> CMS. Start with a plain Django project and then add apps you need. All 
> these CMSs will just lock you in and become more of a hinderance then help. 
>
> I also recommend building your own admin before you invest too much time 
> into customising the default admin. 
>
> Certainly very wise advice. I guess my problem is that I wanted to have a 
solid guide for overall project structure (not having done a major project 
in Django before), something which a good CMS can often provide. That and 
some first versions of apps so we can start with something and evolve. It's 
definitely the lock-in that I'm looking to minimise though... FeinCMS seems 
to be the project that puts itself across as what I'm looking for - a solid 
skeleton that doesn't assume too much. I'll look more into that.
Thanks for your insight,
A

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Anton Melser

>
>
> Might be an idea to write a one page business plan. Amazing how quickly 
> it all becomes clear as soon as the business objectives are nailed down. 
> After that I would guess only one of those would stand out for you. 
>
> We have a pretty solid business plan, or at least one that the startup 
incubator is happy with :-). The only problem is that they are necessary to 
create but only really for crystallising thinking rather than laying out a 
solid roadmap. We have far too many ideas and we want to let things evolve 
through test-and-learn and customer development. Basically we just want an 
MVP that we won't have to throw out 6 mths in. Maybe it's a pipe dream 
though...
Thanks,
A

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.