Re: Django Calendar App Just Like Google Calendar

2013-01-12 Thread Mario Gudelj
It was straight forward. Tastypie makes it really easy to talk json to
backbone and plotting the appointments in fullcalendar was even easier. You
can have the basic functinality in couple of days. More challenging are the
recurring appointments but python's rrule was great help there.
On 13 Jan, 2013 9:01 AM, "william ratcliff" 
wrote:

> How did you find the integration?
>
> William
>
>
> On Sat, Jan 12, 2013 at 4:52 PM, Mario Gudelj wrote:
>
>> I don't think there is one. I looked for one few months ago and ended up
>> building one from scratch with fullcaledar.js, backbone and tastypie
>>  On 12 Jan, 2013 6:00 PM, "Kashif Ali"  wrote:
>>
>>> Hello Guys,
>>>
>>> Is there any django app available that is a replica of google calendar?
>>> I have checked django-scheduler, django-swingtime and couple of more but
>>> the hardest part with these apps/projects is the limited documentation.
>>> Can anybody please guide me what app can serve my purpose?
>>>
>>> Thanks,
>>> Kashif
>>>
>>> --
>>> 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.
>

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



Django Roles/Permissions

2013-01-12 Thread Chung Wu
Hi there,

I am having difficulty figuring out how to structure the following problem:

Users have different roles/groups:

Admin, Manager, Author

Admins can edit every user, can view list of all users, delete all users
Manager can edit all users who are not admins or managers, ""
Author, can only edit themselves, view themselves

Users are associated with Posts

The posts would follow the same logc

Authors can only see posts they have created, Edit them etc

Is there a generic way to do this?

Currently I have views that list all users, post etc but how would I 
integrate roles/permissions to filter the lists, prevent the user for 
editing others etc.

Hope you can point me in the right direction

Thanks

-- 
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/-/OUSzdMwTvroJ.
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: show an image in django

2013-01-12 Thread jianhui chen
Really thanks your help. Finally, I find the problem is not in django
settings, but in google engine settings.
By trying many methods, my problem problem is solved by this way.
add
- url: /static
  static_dir: static  #my static folder is in the root of the project
  expiration: '0'
to app.yaml.

and I run command :

./manage.py collectstatic

before I update file to google app engine, but I don't whether this
command is necessary for the static issue.




On Thu, Jan 10, 2013 at 5:39 PM, @jeffblack360 wrote:

> I think your configuration should allow you to hit your image from your
> browser via the following link:
>
> http://localhost:8000/static/images/gauge_example.jpg
>
> If that works change your replace {{STATIC_URL}} with '/static/'...
>
>  = "390" height = "225" />
>
>
> On Tuesday, January 8, 2013 8:41:55 AM UTC-6, jianhui chen wrote:
>>
>> Hi all,
>> I want to show an image in project in which the folder DIR looks like
>> this:
>> images/a.jpg
>> templates/introduction.html
>>
>> In introduction.html I use
>> 
>>
>> It can show image correctly when I open the "introduction.html" directly
>> using firefox, but it shows ""GET /images/gauge_example.jpg HTTP/1.1" 404 "
>> when I open it in 
>> http://127.0.0.1:8000/**introduction/,
>> and there is no image in the webpage.
>>
>> I used the last method in http://stackoverflow.com/**
>> questions/2148738/cannot-get-**images-to-display-in-simple-**django-site.
>>  But it doesn't work.
>>
>> Could anyone give me some suggestions?
>>
>> jianhui
>>
>>
>>
>>
>>
>>  --
> 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/-/AO-VKasUjWcJ.
>
> 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.



Re: What's your opinion about nested apps?

2013-01-12 Thread Nikolas Stevenson-Molnar
The same reason you'd nest Python modules: the scope of the app is broad
or complex enough to justify separating into more discrete components,
yet those components are not independent from each other or from the
top-level app.

_Nik

On 1/12/2013 4:37 PM, Sithembewena Lloyd Dube wrote:
> Why does this sort of nesting even occur? Why not use the generic
> Django project/ app structure, where you have a project and apps under
> a project, instead of apps under other apps? Why would it ever be
> necessary to 'nest' apps in other apps?
>
> On Sat, Jan 12, 2013 at 11:02 PM, Sam Solomon  > wrote:
>
> We've not had any trouble and we have a very nested structure:
>
> project/main_app/sub_apps/
>
> project has manage.py, main_app has main urls.py, etc.
>
> sub_apps have models/views/urls, etc.
>
> We also have:
>
> project/main_app/utils/other_apps/ with no issues (and utils and
> other_apps both have models, even though utils/models.py may not
> have been the best decision).
>
> Also note that many third party apps do stuff like this too
> (django-allauth is one that comes to mind).
> -- 
> 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/-/XOwYE_Yj9vQJ.
>
> 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.
>
>
>
>
> -- 
> Regards,
> Sithu Lloyd Dube --
> 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.



Re: What's your opinion about nested apps?

2013-01-12 Thread Sam Solomon
I agree, the simple approach may be good for some things, but we have a
highly complex tightly coupled main app that for us, we believe it's
easiest to keep bundled together. If we add/write new, more generic apps to
our site, we would obviously consider adding it as an app in the "project/"
folder.

Thinking back, we may have gone too far in this direction from our last
site where we were using pre-1.4 directory structure where everything was
flat and we had 40 apps in one directory, which starts getting a
bit unwieldy (sort annoying for auto-completes and also doesn't allow you
to show how different "apps" are related at all)

-- 
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: What's your opinion about nested apps?

2013-01-12 Thread Sithembewena Lloyd Dube
I also suspect that this sort of nesting will affect plugability of apps -
what is wrong with a simple approach?

On Sat, Jan 12, 2013 at 11:02 PM, Sam Solomon  wrote:

> We've not had any trouble and we have a very nested structure:
>
> project/main_app/sub_apps/
>
> project has manage.py, main_app has main urls.py, etc.
>
> sub_apps have models/views/urls, etc.
>
> We also have:
>
> project/main_app/utils/other_apps/ with no issues (and utils and
> other_apps both have models, even though utils/models.py may not have been
> the best decision).
>
> Also note that many third party apps do stuff like this too
> (django-allauth is one that comes to mind).
>
> --
> 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/-/XOwYE_Yj9vQJ.
>
> 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.
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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: What's your opinion about nested apps?

2013-01-12 Thread Sithembewena Lloyd Dube
Why does this sort of nesting even occur? Why not use the generic Django
project/ app structure, where you have a project and apps under a project,
instead of apps under other apps? Why would it ever be necessary to 'nest'
apps in other apps?

On Sat, Jan 12, 2013 at 11:02 PM, Sam Solomon  wrote:

> We've not had any trouble and we have a very nested structure:
>
> project/main_app/sub_apps/
>
> project has manage.py, main_app has main urls.py, etc.
>
> sub_apps have models/views/urls, etc.
>
> We also have:
>
> project/main_app/utils/other_apps/ with no issues (and utils and
> other_apps both have models, even though utils/models.py may not have been
> the best decision).
>
> Also note that many third party apps do stuff like this too
> (django-allauth is one that comes to mind).
>
> --
> 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/-/XOwYE_Yj9vQJ.
>
> 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.
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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: Form validation

2013-01-12 Thread Babatunde Akinyanmi
Over ride the post method of your wizard class. There you can call
get_all_cleaned_data or get_cleaned_data_for_step. Use the default
implementation and adjust it to work according to you logic. From your post
method you can raise ValidationError but it will crash the app. If you want
the normal form behavior where ValidationError will render the form with
the error at the top, you will need to do that in your form's clean method.

Sent from my Windows Phone
--
From: Kristofer
Sent: 1/11/2013 4:48 PM
To: Babatunde Akinyanmi
Cc: django-users@googlegroups.com
Subject: Re: Form validation

More details on the form and why there is a field that depends on 6 pages:

In steps 2-5, I am prompting the user for questions and choices about a
particular service.

On page 6 they are given the opportunity to select a date/time for the
service. The validation will calculate how how much time is required based
on steps 2-5 and see if the time they pick fits in the calendar. If it
doesn't, it will ask them to pick a different time.

I'm still not sure where I can use it, because I can't call
get_cleaned_data_for_step from the forms validation/clean field, and I'm
not sure where else I can access the required form steps and also be able
to raise a validation error.


--
*From: *"Babatunde Akinyanmi" 
*To: *"Kristofer" , django-users@googlegroups.com
*Sent: *Friday, January 11, 2013 8:05:59 AM
*Subject: *RE: Form validation

Hi,
You can use the wizard's get_cleaned_data_for_step(step) method where step
is 0-indexed so step 2 form data would be:
get_cleaned_data_for_step('1').
It would return a dictionary of the cleaned data for that step.

Ignorable comment: I would be very pissed if I had to fill 6 form pages
only to be told I can't continue because of something I did 4 pages ago.

Sent from my Windows Phone
--
From: Kristofer
Sent: 1/11/2013 8:00 AM
To: django-users@googlegroups.com
Subject: Form validation

Hello,

I am using FormWizard with a 12-step form.

On step 6, I want to perform verification on a field but it depends on
fields that were entered in steps 2-5.

I cannot figure out how to get data from the previous steps in the form
validation for step 6.

Where is a point in the FormWizard where I can access previous form data
and can also raise ValidationError on a field?

Thanks,

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



Re: NEED HELP ON RUNNING DJANGO ON XAMPP 1.7 UNDER WIN 8

2013-01-12 Thread Nikolas Stevenson-Molnar
Do you have an "Allow" directive for the appropriate directory?

http://httpd.apache.org/docs/2.0/mod/mod_access.html#allow

_Nik

On 1/12/2013 10:27 AM, Kanai Lomayani wrote:
> I have managed to install mod_wsgi on apache and django when i try to
> access the django address I get this error 
> *[Sat Jan 12 20:29:59 2013] [error] [client 127.0.0.1] client denied
> by server configuration: C:/xampp/locksmith/locksmith/django.wsgi*
> my scriptalias : *WSGIScriptAlias /locksmith/
> "C:/xampp/locksmith/django.wsgi"*
> *
> *
> Please i need your help i have searched all day long with no results
>
> --Kanai
> -- 
> 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/-/FYeePiATOxsJ.
> 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.



Re: How do I display a static image in my index.html file?

2013-01-12 Thread Jeffrey Black
Directory structure please?

FWIW, you have django.contrib.staticfiles defined twice.

Did you read the howto doc on static files?

@jeffblack360

On Jan 12, 2013, at 2:17 PM, frocco  wrote:

>> 
> Page not found (404)
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/static/img/auto.jpg
> Using the URLconf defined in ntw.urls, Django tried these URL patterns, in 
> this order:
> ^staff/$
> ^static/img/$
> ^static/$
> ^admin/doc/
> ^admin/
> The current URL, static/img/auto.jpg, didn't match any of these.
> -- 
> 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/-/3Qt8rkRKSrcJ.
> 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.



Re: How do I display a static image in my index.html file?

2013-01-12 Thread Nikolas Stevenson-Molnar
Add your static files directory to STATICFILES_DIRS. Make sure to
include a trailing comma. E.g:

STATICFILES_DIRS = (
os.path.join(DIR,'static'),
)

_Nik

On 1/12/2013 12:09 PM, frocco wrote:
> Page not found (404)
> Request Method:GET
> Request URL:http://127.0.0.1:8000/static/img/auto.jpg
> 'img/auto.jpg' could not be found
>
> [code]
> # Django settings for store project.
> import os
> import django.contrib.staticfiles
>
> DIR = os.path.abspath(os.path.dirname(__name__))
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'store',  # Or path to database
> file if using sqlite3.
> 'USER': 'root',  # Not used with sqlite3.
> 'PASSWORD': 'root',  # Not used with sqlite3.
> 'HOST': '/Applications/MAMP/tmp/mysql/mysql.sock',
>  # Set to empty string for localhost. Not used with sqlite3.
> 'PORT': '',  # Set to empty string for
> default. Not used with sqlite3.
> }
> }
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'America/New_York'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold
> user-uploaded files.
> # Example: "/home/media/media.lawrence.com/media/"
> MEDIA_ROOT = os.path.join(DIR,'media')
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://media.lawrence.com/media/;,
> "http://example.com/media/;
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/home/media/media.lawrence.com/static/"
> STATIC_ROOT = os.path.join(DIR,'static')
>
> # URL prefix for static files.
> # Example: "http://media.lawrence.com/static/;
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or
> "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # List of finder classes that know how to find static files in
> # various locations.
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = 'ne#cnv$g0^b6fl5$u#zue=5jw8898@c5jqrrh694jzrr-ob5!n'
>
> # List of callables that know how to import templates from various
> sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> # 'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> # Uncomment the next line for simple clickjacking protection:
> # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> ROOT_URLCONF = 'store.urls'
>
> # Python dotted path to the WSGI application used by Django's runserver.
> WSGI_APPLICATION = 'store.wsgi.application'
>
> TEMPLATE_DIRS = (
> # Put strings here, like "/home/html/django_templates" or
> "C:/www/django/templates".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> os.path.join(DIR,'templates'),
> )
>
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # 

Re: How do I display a static image in my index.html file?

2013-01-12 Thread frocco

>
>
> Page not found (404)Request Method:GETRequest URL:
> http://127.0.0.1:8000/static/img/auto.jpg
>
> Using the URLconf defined in ntw.urls, Django tried these URL patterns, 
> in this order:
>
>1. ^staff/$
>2. ^static/img/$
>3. ^static/$
>4. ^admin/doc/
>5. ^admin/
>
> The current URL, static/img/auto.jpg, didn't match any of these.
>

-- 
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/-/3Qt8rkRKSrcJ.
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: How do I display a static image in my index.html file?

2013-01-12 Thread frocco
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/static/img/auto.jpg
'img/auto.jpg' could not be found

[code]
# Django settings for store project.
import os
import django.contrib.staticfiles

DIR = os.path.abspath(os.path.dirname(__name__))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
'mysql', 'sqlite3' or 'oracle'.
'NAME': 'store',  # Or path to database file if 
using sqlite3.
'USER': 'root',  # Not used with sqlite3.
'PASSWORD': 'root',  # Not used with sqlite3.
'HOST': '/Applications/MAMP/tmp/mysql/mysql.sock', 
 # Set to empty string for localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for default. 
Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/New_York'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded 
files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = os.path.join(DIR,'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/;, "http://example.com/media/;
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(DIR,'static')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/;
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'ne#cnv$g0^b6fl5$u#zue=5jw8898@c5jqrrh694jzrr-ob5!n'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'store.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'store.wsgi.application'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or 
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(DIR,'templates'),
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'staff',
'page',
'tinymce',
'django.contrib.staticfiles',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See 

NEED HELP ON RUNNING DJANGO ON XAMPP 1.7 UNDER WIN 8

2013-01-12 Thread Kanai Lomayani
I have managed to install mod_wsgi on apache and django when i try to 
access the django address I get this error 
*[Sat Jan 12 20:29:59 2013] [error] [client 127.0.0.1] client denied by 
server configuration: C:/xampp/locksmith/locksmith/django.wsgi*
my scriptalias : *WSGIScriptAlias /locksmith/ 
"C:/xampp/locksmith/django.wsgi"*
*
*
Please i need your help i have searched all day long with no results

--Kanai

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



Making of model field type dependent upon the type of admin input form?

2013-01-12 Thread Hans De Winter
I have the following model defined (in my models.py file):

class File(models.Model):

filename = models.FilePathField(path = '/my_dir/', recursive =  True)

 
This model has been registered to the automatic *admin interface* (in the 
admin.py file):

class FileAdmin(admin.ModelAdmin):

fields = ('filename', )


admin.site.register(File, FileAdmin)

*Adding* a new file using the automatic *admin interface* correctly 
displays a FilePathField widget pointing to the /my_dir/ directory. 
However, when I enter the *change view* in the *admin interface* (by 
clicking on the file in the *list view* page), I would like to have a 
CharField widget to display the filename of my file (instead of the 
FilePathWidget as defined in the File class). Is there a way to achieve 
this somehow?

Many thanks in advance,

- Hans

-- 
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/-/t9CE4c5Wg-kJ.
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 Calendar App Just Like Google Calendar

2013-01-12 Thread Mario Gudelj
I don't think there is one. I looked for one few months ago and ended up
building one from scratch with fullcaledar.js, backbone and tastypie
On 12 Jan, 2013 6:00 PM, "Kashif Ali"  wrote:

> Hello Guys,
>
> Is there any django app available that is a replica of google calendar?
> I have checked django-scheduler, django-swingtime and couple of more but
> the hardest part with these apps/projects is the limited documentation.
> Can anybody please guide me what app can serve my purpose?
>
> Thanks,
> Kashif
>
> --
> 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.



Re: What's your opinion about nested apps?

2013-01-12 Thread Sam Solomon
We've not had any trouble and we have a very nested structure:

project/main_app/sub_apps/

project has manage.py, main_app has main urls.py, etc.

sub_apps have models/views/urls, etc.

We also have:

project/main_app/utils/other_apps/ with no issues (and utils and other_apps 
both have models, even though utils/models.py may not have been the best 
decision).

Also note that many third party apps do stuff like this too (django-allauth 
is one that comes to mind).

-- 
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/-/XOwYE_Yj9vQJ.
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: How do I display a static image in my index.html file?

2013-01-12 Thread frocco
Google keeps deleting my reply.

I tried the url to the static/img path and get 404 error.


On Saturday, January 12, 2013 2:45:48 PM UTC-5, frocco wrote:
>
> Hello,
>
> django 1.4 on mac.
>
> plan to deploy to Bluehost.com when finished.
>
> I have a php site I want to convert to django.
>
> but honestly, django is harder for me to learn than php, but I am 
> determined.
>
> On Saturday, January 12, 2013 12:24:34 PM UTC-5, @jeffblack360 wrote:
>>
>> frocco:
>>
>> First things first: What version of Django are you running, and what OS?
>>
>> Thanks,
>>
>>
>> Jeff
>> @jeffblack360
>>
>>
>> On Jan 11, 2013, at 11:38 PM, Nikolas Stevenson-Molnar <
>> nik.m...@consbio.org> wrote:
>>
>> Could you provide a bit more detail on the problem you're having?
>>
>> _Nik
>>
>> On 1/11/2013 8:12 PM, frocco wrote:
>>  
>> I am still stuck.
>>
>> On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote: 
>>>
>>> Hello, 
>>>
>>>  I am a newbie and cannot figure out how to do a simple image display 
>>> that I currently do in PHP.
>>> I want to display a logo on my home page.
>>>
>>>  I tried google, but am having no luck.
>>>
>>>  Thanks
>>>
>> -- 
>> 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/-/8g4-QNDvZdAJ.
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users...@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...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/pmiohO0_tQEJ.
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: How do I display a static image in my index.html file?

2013-01-12 Thread frocco
Hello,

django 1.4 on mac.

plan to deploy to Bluehost.com when finished.

I have a php site I want to convert to django.

but honestly, django is harder for me to learn than php, but I am 
determined.

On Saturday, January 12, 2013 12:24:34 PM UTC-5, @jeffblack360 wrote:
>
> frocco:
>
> First things first: What version of Django are you running, and what OS?
>
> Thanks,
>
>
> Jeff
> @jeffblack360
>
>
> On Jan 11, 2013, at 11:38 PM, Nikolas Stevenson-Molnar <
> nik.m...@consbio.org > wrote:
>
> Could you provide a bit more detail on the problem you're having?
>
> _Nik
>
> On 1/11/2013 8:12 PM, frocco wrote:
>  
> I am still stuck.
>
> On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote: 
>>
>> Hello, 
>>
>>  I am a newbie and cannot figure out how to do a simple image display 
>> that I currently do in PHP.
>> I want to display a logo on my home page.
>>
>>  I tried google, but am having no luck.
>>
>>  Thanks
>>
> -- 
> 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/-/8g4-QNDvZdAJ.
> To post to this group, send email to django...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@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...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/p9ZBdxqk-KsJ.
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: difficulty with static files

2013-01-12 Thread Sammy
Tom - thanks so much.  I was able to resolve it.

On Thursday, November 29, 2012 10:00:26 AM UTC-8, Sammy wrote:
>
> Hello django experts
> I am unable to get my static files to work.  Here are my settings:
>
> projectfiles
> |
> |-myproject
> | |
> | |-static
> | | |
> | | |-css
> | | |-js
> | |-__init__.py
> | |-settings.py
> | |-urls.py
> | |-wsgi.py
> |
> |-myapp
> |
> |-templates
>
>
> +++
> 
>
>
> settings.py
> import os
> SITE_ROOT = (os.path.realpath(os.path.dirname(__file__))).replace('\\','/')
> DEBUG = True
> MEDIA_ROOT = (os.path.join(SITE_ROOT, '/static')).replace('\\','/')
> MEDIA_URL = '/static/'
> STATIC_ROOT = ''
> STATIC_URL = ''
> STATICFILES_DIRS = ()
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> 'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> +
> +
>
>
> urls.py
> urlpatterns = patterns('',
> (r'^myurl/$', myview),
> )
>
>
> from myproject.settings import DEBUG
> if DEBUG:
> urlpatterns += patterns('', (r'^static/(?P.*)$', 
> 'django.views.static.serve', 
>
> {'document_root': 'static'}))
>
> +++
>
> +++
>
> the app works fine but no connection to my css's or javascripts.
>
> I'm using pycharm if that makes a difference.
>
> Any help would be greatly appreciated.
>
>
>
>  
>

-- 
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/-/u2SucG6Hd94J.
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: How do I display a static image in my index.html file?

2013-01-12 Thread Jeffrey Black
Double-check your the static settings in settings.py and try this:

1: Make sure static URL is '/static/'

2: 

3: Move your img directory to store/static directory.

4: Try and hit your image via browser with 
http://localhost:8000/static/img/auto.jpg

5: Read the Django documentation about managing static files:
https://docs.djangoproject.com/en/1.4/howto/static-files/

The django.contrib.staticfiles module will pick up static directories in your 
app directory.

Good luck.

@jeffblack360

On Jan 12, 2013, at 8:10 AM, frocco  wrote:

> [code]
> #staff/views.py
> from django.shortcuts import render_to_response
> from django.template import RequestContext
> from staff.models import Staff
> 
> def index(request):
> return render_to_response('staff/index.html')
> *
> Index.html in folder templates/staff
> 
> 
> 
> *
> 
> auto.jpg in folder img
> 
> 
> My site is:
> 
> store
>   img
> auto.jpg
>   staff
>  views.py
>   templates
>  staff
> index.html
> 
> image is not showing.
> This needs to work in development and production
> 
> On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote:
> Hello,
> 
> I am a newbie and cannot figure out how to do a simple image display that I 
> currently do in PHP.
> I want to display a logo on my home page.
> 
> I tried google, but am having no luck.
> 
> Thanks
> -- 
> 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/-/_yjULDxZe2YJ.
> 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.



Re: How do I display a static image in my index.html file?

2013-01-12 Thread Jeffrey Black
frocco:

First things first: What version of Django are you running, and what OS?

Thanks,


Jeff
@jeffblack360


On Jan 11, 2013, at 11:38 PM, Nikolas Stevenson-Molnar  
wrote:

> Could you provide a bit more detail on the problem you're having?
> 
> _Nik
> 
> On 1/11/2013 8:12 PM, frocco wrote:
>> I am still stuck.
>> 
>> On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote:
>> Hello,
>> 
>> I am a newbie and cannot figure out how to do a simple image display that I 
>> currently do in PHP.
>> I want to display a logo on my home page.
>> 
>> I tried google, but am having no luck.
>> 
>> Thanks
>> -- 
>> 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/-/8g4-QNDvZdAJ.
>> 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.



RE: Best/Cleanest way to add fields to Class User in models.py?

2013-01-12 Thread bb6xt
I'll advice you take a look at the custom user models documentation. It is new 
in django 1.5 which will become the latest stable version in less than 2 weeks 
from now(?). It looks like the cleanest way imho. Sorry I don't have the link 
but am sure a simple search will lead you to the django doc page.

--
Sent from my mobile device

-- 
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: What's your opinion about nested apps?

2013-01-12 Thread Fernando Rocha


On Jan 12, 11:37 am, David Medina  wrote:
> It's only a email typo, never mind. I wanted to explain the "nested"
> concept with code.
>
> The main question could be: *Has it any side effects?*, Third apps maybe?.

I had some issues with commands with an app that uses a similar
structure.

More about it here::
https://code.djangoproject.com/ticket/14087
https://github.com/kylemacfarlane/django-cuddlybuddly-storage-s3/issues/4

> I haven't found nothing about it in official doc and so on.
>
> El viernes, 11 de enero de 2013 16:00:37 UTC+1, Sergiy Khohlov escribió:
>
>
>
>
>
>
>
>
>
> > keep in mind comas
>
> > INSTALLED_APPS = (
>
> >     'incidences',
> >     'problems',
> > )
> > 2013/1/11 David Medina :
> > > INSTALLED_APPS = (
> > >     'trouble_ticketer',
> > >     'trouble_ticketer.incidences'
> > >     'trouble_ticketer.problems'
> > > )
>
> > Many thanks,
>
> > Serge
>
> > +380 636150445
> > skype: skhohlov

-- 
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: What's your opinion about nested apps?

2013-01-12 Thread David Medina
It's only a email typo, never mind. I wanted to explain the "nested" 
concept with code.

The main question could be: *Has it any side effects?*, Third apps maybe?. 
I haven't found nothing about it in official doc and so on.

El viernes, 11 de enero de 2013 16:00:37 UTC+1, Sergiy Khohlov escribió:
>
> keep in mind comas 
>
> INSTALLED_APPS = ( 
>
> 'incidences', 
> 'problems', 
> ) 
> 2013/1/11 David Medina : 
> > INSTALLED_APPS = ( 
> > 'trouble_ticketer', 
> > 'trouble_ticketer.incidences' 
> > 'trouble_ticketer.problems' 
> > ) 
>
>
>
> Many thanks, 
>
> Serge 
>
>
> +380 636150445 
> skype: skhohlov 
>

-- 
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/-/5CDmM07lZywJ.
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.



ANN: Portable Python 2.7.3.2 released

2013-01-12 Thread Perica Zivkovic
Dear people,

I would like to announce new release of Portable Python based on Python 
2.7.3

Included in this release:
-
 PyScripter v2.5.3
 NymPy 1.6.2
 SciPy 0.11.0
 Matplotlib 1.1.1
 PyWin32 218
 Django 1.4.3
 PIL 1.1.7
 Py2Exe 0.6.9
 wxPython 2.9.4.0
 NetworkX 1.7
 Lxml 2.3
 PySerial 2.5
 PyODBC 3.0.6
 PyGame 1.9.1
 PyGTK 2.24.2
 PyQt 4.9.6-1

Improvements since last release:

Aside from upgrade of all pacakges listed above these are improvements and 
bugfixes compared to 2.7.3.1 release
- Django scripts added to App\Scripts
- Python-Portable.exe and all other *-Portable.exe are accepting command 
line arguments. This is now preferred way of running your python scripts 
from command line.
- Fixed MSCRT version included with the package and issues with running 
Portable Python on machines without MSCRT installed.
- Help in QtDesigner is available and working
- Fixed UIC that was missing from PyQt
- Fixed issues with running Py2Exe on machines without MSCRT
- By default all packages are installed if selection is not modified during 
the installation

Installation and use:
-
After downloading, run the installer, select the packages you would like to 
install, select the target folder and you are done! In the root folder of 
the distribution you will find shortcuts for selected applications. Some of 
the most popular free Python IDE’s come preinstalled and preconfigured with 
Portable Python. How to use and configure them further please consult their 
documentation or project sites.

Download location: http://portablepython.com/wiki/PortablePython2.7.3.2

Warning: Default installation installs all packages - make sure to review 
packages selection during installation process as it can take quite some 
time to install 505MB on the USB drive(s).

Please use feedback and support section on the portal to request new 
packages or to report issues.

I hope you will have some fun with it !

Perica Zivkovic
http://www.PortablePython.com

-- 
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/-/JZNlzIjhA28J.
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: How do I display a static image in my index.html file?

2013-01-12 Thread frocco
[code]
#staff/views.py
from django.shortcuts import render_to_response
from django.template import RequestContext
from staff.models import Staff

def index(request):
return render_to_response('staff/index.html')
*
Index.html in folder templates/staff



*

auto.jpg in folder img


My site is:

store
  img
auto.jpg
  staff
 views.py
  templates
 staff
index.html

image is not showing.
This needs to work in development and production

On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote:
>
> Hello,
>
> I am a newbie and cannot figure out how to do a simple image display that 
> I currently do in PHP.
> I want to display a logo on my home page.
>
> I tried google, but am having no luck.
>
> Thanks
>

-- 
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/-/_yjULDxZe2YJ.
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: Generating HTML code

2013-01-12 Thread Matteo Suppo
I use http://foundation.zurb.com/ or http://twitter.github.com/bootstrap/

They don't generate html but they help build pages faster.

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



Generating HTML code

2013-01-12 Thread Paul Lanza
As I am in the process of learning Django (I've programmed with python for 
years, and know HTML very well, too), do most programmers develop their 
HTML by hand, or do you use a 3rd party software to generate HTML and use 
that as a starting point for the page you are creating.  If you are using 
software, what are you using?

-- 
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/-/wvsW_obbzpUJ.
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: how to set template and media directory in settings?

2013-01-12 Thread Mário Neto
And trying like this:

>>> PROJECT_PATH = os.path.abspath(os.path.dirname(__name__))
>>> PROJECT_PATH
'C:\\Users\\Mario'
>>> os.path.join(os.path.dirname(PROJECT_PATH), "..")
'C:\\Users\\..'

Best regards

2013/1/11 frocco 

> PROJECT_PATH = os.path.join(os.path.dirname(__file__))
>




-- 
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet Environments* - 2003 - FIC

-- 
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: Best/Cleanest way to add fields to Class User in models.py?

2013-01-12 Thread Iñigo Medina

On Fri, Jan 11, 2013 at 11:06:57PM -0800, Saqib Ali wrote:
> 
> The User class obviously has a lot of important features that any website 
> developer will need to track and manage users to the website.
> However, I wish the class had three additional members -- all 
> BooleanFields: myBoolA, myBoolB, myBoolC.
> 
> What is the safest/cleanest/easiest/best way to achieve this functionality? 
> Where should I add those members? It seems unwise to modify the Django 
> source package itself.

Standard way of solving that is using a custom User Profile related to User
class. I've used such approach and it has the benefits that you keep separated
both models and so they become more reusable. However it has extra cost at
database level.

If you are planning to use Django 1.5 you might extend the User class.

Iñigo

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



Re: Best/Cleanest way to add fields to Class User in models.py?

2013-01-12 Thread Russell Keith-Magee
On Sat, Jan 12, 2013 at 3:06 PM, Saqib Ali  wrote:

>
> In my models.py, I use django.contrib.auth.models.User as a foreign key
> in many of the classes I created.
>
> The User class obviously has a lot of important features that any website
> developer will need to track and manage users to the website.
> However, I wish the class had three additional members -- all
> BooleanFields: myBoolA, myBoolB, myBoolC.
>
> What is the safest/cleanest/easiest/best way to achieve this
> functionality? Where should I add those members? It seems unwise to modify
> the Django source package itself.
>
>
As others have replied, one option is to use a profile class. Although
Django has the concept of a UserProfile, this is being deprecated; but the
broader idea -- a separate table with a OneToOneKey to the User model -- is
still valid.

In Django 1.5 (due for release any week now), you can define your own
custom User model. If you're happy with the base Django User, and just want
to add a couple of fields, you can extend an AbstractUser base class and
add your own fields.

Which one is the better option? That's really up to you. The more you put
on your User model, the less reusable your code will be. However, putting
data into separate tables will incur a retrieval cost.

One way to answer this question is to ask the purpose of the boolean fields
you want to add. Are these extra fields essential properties of what it
means to be a User in your project, or are they descriptions of how one
particular application will interact with a User object. If they're
fundamental properties of a User, a custom User object may be appropriate.
If they're the latter, a profile object may be a better approach.

However, ultimately, only you can confirm which approach is best for your
own project.

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.



Re: Best/Cleanest way to add fields to Class User in models.py?

2013-01-12 Thread Kashif Ali
On Sat, Jan 12, 2013 at 1:27 PM, Saqib Ali  wrote:

> Kashif, if I do that, then there are more questions/issues:
>
> 1) Should user UserProfile be an extension of the User class? Or should it
> be a completely separate, independent class?
>
>
You can not extend User class/model as its not an abstract class. Rather it
will be a separate, independent one. e.g.

from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True, related_name='profile')
theme = models.ForeignKey(Themes,null=True,blank=True)

def __str__(self):
return self.user

class Meta:
ordering = ["user"]


2) Whichever method I decide to use, I would like my other models to use as
> their foreign keys the same Users that are shown to me in the Admin
> interface.
>

It will be same Users as its referencing to the same model. only difference
is object reference to the object.

If I create and implement UserProfile, then I will be creating a separate
> object -- not the same one from the Admin interface. So how do I work
> around that?
>
> Yes it will be separate object but that object also contains user object
as well and you can access any of its fields. You can change its behavior
by having customs forms for your models. For this you have to look at how
to implement django forms.
model factory and form factory can also be use as per requirement if you
can have a look at there docs.


> - Saqib
>
>
> On Sat, Jan 12, 2013 at 2:40 AM, Kashif Ali  wrote:
>
>> I will suggest to create UserProfile model instead of customizing User
>> model. Add as many fields as you like in UserProfile model and use this new
>> model in your application wherever you are referencing User model.
>> You have todo some settings in your settings file in this regards.
>>
>> Kashif
>>
>>
>> On Sat, Jan 12, 2013 at 12:06 PM, Saqib Ali wrote:
>>
>>>
>>> In my models.py, I use django.contrib.auth.models.User as a foreign key
>>> in many of the classes I created.
>>>
>>> The User class obviously has a lot of important features that any
>>> website developer will need to track and manage users to the website.
>>> However, I wish the class had three additional members -- all
>>> BooleanFields: myBoolA, myBoolB, myBoolC.
>>>
>>> What is the safest/cleanest/easiest/best way to achieve this
>>> functionality? Where should I add those members? It seems unwise to modify
>>> the Django source package itself.
>>>
>>>  --
>>> 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/-/FkW8DULxAFAJ.
>>> 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.
>>>
>>
>>
>>
>> --
>> -Kashif
>>
>> --
>> 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.
>



-- 
-Kashif

-- 
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: Best/Cleanest way to add fields to Class User in models.py?

2013-01-12 Thread Saqib Ali
Kashif, if I do that, then there are more questions/issues:

1) Should user UserProfile be an extension of the User class? Or should it
be a completely separate, independent class?

2) Whichever method I decide to use, I would like my other models to use as
their foreign keys the same Users that are shown to me in the Admin
interface. If I create and implement UserProfile, then I will be creating a
separate object -- not the same one from the Admin interface. So how do I
work around that?


- Saqib


On Sat, Jan 12, 2013 at 2:40 AM, Kashif Ali  wrote:

> I will suggest to create UserProfile model instead of customizing User
> model. Add as many fields as you like in UserProfile model and use this new
> model in your application wherever you are referencing User model.
> You have todo some settings in your settings file in this regards.
>
> Kashif
>
>
> On Sat, Jan 12, 2013 at 12:06 PM, Saqib Ali wrote:
>
>>
>> In my models.py, I use django.contrib.auth.models.User as a foreign key
>> in many of the classes I created.
>>
>> The User class obviously has a lot of important features that any website
>> developer will need to track and manage users to the website.
>> However, I wish the class had three additional members -- all
>> BooleanFields: myBoolA, myBoolB, myBoolC.
>>
>> What is the safest/cleanest/easiest/best way to achieve this
>> functionality? Where should I add those members? It seems unwise to modify
>> the Django source package itself.
>>
>>  --
>> 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/-/FkW8DULxAFAJ.
>> 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.
>>
>
>
>
> --
> -Kashif
>
> --
> 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.