text media files for comments

2014-01-13 Thread Fatih Tiryakioglu
Hi all,

I want to render a static media .txt file from django template, but I can't 
load it. Should I use database for text comments, or is it better statatic 
text files like image files in media folder.

Any help is appreciated.


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/de60230e-bbe9-4e40-bdd4-ca29617497ae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: remove timezone support from one app

2014-01-13 Thread smcoll
What i wound up doing was to create a custom ModelField which deals with 
timezone-naive datetimes/timestamps: https://gist.github.com/smcoll/8405914

Then, i created schema/data migrations in South to convert existing values.

On Saturday, January 11, 2014 11:05:54 AM UTC-6, smcoll wrote:
>
> To clarify, i'm dealing with datetimes which pre-date the implementation 
> of timezones (solar time).  So i'd like any admin user in any timezone to 
> be able to enter a naive datetime which will remain the same naive datetime 
> for any usage in the site.
>
> On Saturday, January 11, 2014 10:59:34 AM UTC-6, smcoll wrote:
>>
>> i have timezone support enabled for my project, but there is one 
>> application which i would like to behave as timezone-naive.  How can this 
>> be accomplished?
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ca90848-c386-465b-9047-3d5f74991bbf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


NoReverseMatch error on redirect

2014-01-13 Thread Brad Rice
I have a mulit-page form I am building. I get the start page to enter the 
data for the application, validate and save. When I try using reverse to 
move to the next page I get this error:

NoReverseMatch at /requestform/start/Reverse for 'registrant_add' with 
arguments '()' and keyword arguments '{'app_id': 11}' not found.

I have this url in my urls.py

url(r'^step1/(?P\d+)/$, RegistrantCreate.as_view(), 
name="registrant_add"),

I am trying to call the view this way:

class ApplicationCreate(CreateView):
model = Application
form_class = ApplicationForm
slug_field = 'created_by'
template_name = 'requestform/start_form.html'

@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(ApplicationCreate, self).dispatch(*args, **kwargs)


def form_valid(self, form):
obj = form.save(commit=False)
obj.created_by = self.request.user
obj.created = datetime.datetime.today()
obj.modified = datetime.datetime.today()
obj.save()
return HttpResponseRedirect(reverse('registrant_add', 
kwargs={'app_id': obj.id}))

Why doesn't django recognize the named url 'registrant_add' and redirect to 
it?



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a7a2ad99-0be5-4aa8-8c1f-05fc3e0b85c0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: app to record and play video

2014-01-13 Thread Kelly Nicholes
Django, as far as the front-end is concerned, has little to do with 
actually capturing the video.  This is going to be on the frontend with 
your browser.  Depending on your audience, they might not have browser web 
capture available and will have to use a browser plugin like flash or 
silverlight, as mentioned in 
http://www.html5rocks.com/en/tutorials/getusermedia/intro/.  Otherwise, 
follow that link and see if that'd suit your needs.  


On Sunday, January 12, 2014 11:05:26 AM UTC-7, Piyush D wrote:
>
> Hi,
> I'm trying to build an app that records videos using webcam and plays it 
> on demand. Are there any resources/documentations on how to do this in 
> Django?
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bb51e98-b4ce-4174-98ba-23a27fc12c08%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: DateTimeQuery object has no attribute tzinfo when USE_TZ is True

2014-01-13 Thread Tom Evans
On Sat, Jan 11, 2014 at 4:51 AM, Kush Goyal  wrote:
> I am using postgres as my database. I have a model called Invoice with a
> datetime field. I get an error when I run the query:
>
> Invoice.objects.datetimes('date_field','day')
>
> The error is:
>
> AttributeError: 'DateTimeQuery' object has no attribute 'tzinfo'
>
> This happens when USE_TZ setting is set to True in my settings file.
>
> I have read the documentation on django docs about datetimes query and it
> says that when using postgres pytz is not required. But I installed pytz
> anyway and tried again but still got the error.
>
> When I set USE_TZ to false the query runs fine and there are no errors.
>
> I found this ticket on django website which reports this error but I do not
> know how to use the patch it talks about.
>
> https://code.djangoproject.com/ticket/21432
>
> Can someone please tell me how to run the query without errors with
> USE_TZ=True.

Update to django 1.6.1 or later, when this bug was fixed.

Cheers

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1JwF3KFoOGam5br9Y7ntqO%2B2F7ko6GqbgSDnjvuxzV59A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Mapping SSL certificates to django users

2014-01-13 Thread Roberto De Ioris

> Hi tomaso
>
> Did you maybe found the solution? We have the same issue.
>
> Best regards
> Mitja

Both apache and nginx can set the HTTPS_DN/other_names_as_well variable to
the distinguished name of the x509 peer.

Just add

SSLOptions +StdEnvVars

I use it as a decorator to protect some view:

https://github.com/unbit/uwsgi.it/blob/master/uwsgi_it_api/views.py#L19

this works in mod_wsgi and variables/cgi based proxies like FastCGI,SCGI
or uwsgi

-- 
Roberto De Ioris
http://unbit.it

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8df707a6291a2e0f9d12db9b3d40e9b6.squirrel%40manage.unbit.it.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Duplicate Column name Django south migration Error

2014-01-13 Thread Mrinmoy Das
You have a duplicate field, remove it. Whats the exact problem?

Mrinmoy Das
http://goromlagche.in/


On Mon, Jan 13, 2014 at 2:47 PM, Vishnu Cherumadathil <
vishnu.say...@gmail.com> wrote:

> The error was: (1060, "Duplicate column name 'address_ar'")
>  ! Error found during real run of migration! Aborting.
>
>  ! Since you have a database that does not support running
>  ! schema-altering statements in transactions, we have had
>  ! to leave it in an interim state between migrations.
>
> ! You *might* be able to recover with:   - no dry run output for
> delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `address_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `block_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `streat_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `house_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `ad_direction_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `build_num_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `floor_ar`
> CASCADE; []
>- no dry run output for delete_foreign_key() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `flat_ar` CASCADE;
> []
>= ALTER TABLE `vendor_product` ADD COLUMN `details_en` longtext NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_product` ADD COLUMN `p_name_en` varchar(100)
> NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_product` ADD COLUMN `description_en` longtext
> NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendorprofile` ADD COLUMN `shop_name_en`
> varchar(100) NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendorprofile` ADD COLUMN `description_en`
> longtext NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendorprofile` ADD COLUMN `owner_name_en`
> varchar(100) NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendorprofile` ADD COLUMN `details_en` longtext
> NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_vendorprofile` ADD COLUMN `contact_name_en`
> varchar(100) NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>= ALTER TABLE `vendor_subcategory` ADD COLUMN `name_en` varchar(200)
> NULL; []
>- no dry run output for alter_column() due to dynamic DDL, sorry
>
>  ! The South developers regret this has happened, and would
>  ! like to gently persuade you to consider a slightly
>  ! easier-to-deal-with DBMS (one that supports DDL transactions)
>  ! NOTE: The error which caused the migration to fail is further up.
> Error in migration:
> vendor:0052_auto__add_field_vendoraddressbook_address_ar__add_field_vendoraddressb
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a5bcd037-ebfc-4ee9-856e-40c6953a66fe%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWA-MPVdnFQpO4TWm7gN4hnDNfePqk-YL7CW4PUR2fNn1ZmKw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: No module named django.core

2014-01-13 Thread Mrinmoy Das
activate your virtualenv.

Mrinmoy Das
http://goromlagche.in/


On Mon, Jan 13, 2014 at 5:47 PM,  wrote:

> I get this error while creating New Project.
>
> radhika$ django-admin.py startproject housing
>
> Traceback (most recent call last):
>
>   File "/usr/local/bin/django-admin.py", line 2, in 
>
> from django.core import management
>
> ImportError: No module named django.core
>
> Any suggestions on this please. 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7c9e503e-8127-4b8d-8f45-78ab71e3d14a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWA-MMU1ZCY-m4ZutPx3cv2q1xmoMbzsQ5iu99_txabZN0Gog%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Mapping SSL certificates to django users

2014-01-13 Thread mitja . sturm
Hi tomaso

Did you maybe found the solution? We have the same issue.

Best regards
Mitja

On Monday, April 2, 2012 3:03:28 PM UTC+2, tomaso wrote:
>
> Hello,
>
> how can I map a DN (or any other part of X509 certificate) to a django 
> user?
>
> I have found a documentation article about django middleware using 
> REMOTE_USER
> transferred from apache, but I am not sure if this is the way and if yes 
> how to
> - tell apache that a given part of X509 certificate should go to 
> REMOTE_USER
> - map REMOTE_USER strings to django users
>
> Thank you for any help,
>
> -- 
> Tomas Kouba
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e79965ca-52e1-4f4f-ac1f-f6e83bcba45c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Duplicate Column name Django south migration Error

2014-01-13 Thread Vishnu Cherumadathil
The error was: (1060, "Duplicate column name 'address_ar'")
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   - no dry run output for 
delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `address_ar` 
CASCADE; []
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `block_ar` CASCADE; 
[]
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `streat_ar` 
CASCADE; []
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `house_ar` CASCADE; 
[]
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `ad_direction_ar` 
CASCADE; []
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `build_num_ar` 
CASCADE; []
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `floor_ar` CASCADE; 
[]
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendoraddressbook` DROP COLUMN `flat_ar` CASCADE; 
[]
   = ALTER TABLE `vendor_product` ADD COLUMN `details_en` longtext NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_product` ADD COLUMN `p_name_en` varchar(100) NULL; 
[]
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_product` ADD COLUMN `description_en` longtext 
NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendorprofile` ADD COLUMN `shop_name_en` 
varchar(100) NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendorprofile` ADD COLUMN `description_en` 
longtext NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendorprofile` ADD COLUMN `owner_name_en` 
varchar(100) NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendorprofile` ADD COLUMN `details_en` longtext 
NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_vendorprofile` ADD COLUMN `contact_name_en` 
varchar(100) NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry
   = ALTER TABLE `vendor_subcategory` ADD COLUMN `name_en` varchar(200) 
NULL; []
   - no dry run output for alter_column() due to dynamic DDL, sorry

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)
 ! NOTE: The error which caused the migration to fail is further up.
Error in migration: 
vendor:0052_auto__add_field_vendoraddressbook_address_ar__add_field_vendoraddressb

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a5bcd037-ebfc-4ee9-856e-40c6953a66fe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


ImportError: No module named django.core

2014-01-13 Thread radsepvj
I get this error while creating New Project.

radhika$ django-admin.py startproject housing

Traceback (most recent call last):

  File "/usr/local/bin/django-admin.py", line 2, in 

from django.core import management

ImportError: No module named django.core

Any suggestions on this please. 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c9e503e-8127-4b8d-8f45-78ab71e3d14a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.