Django form wizard multiple file uploads problem

2020-04-08 Thread Deniz Bazan

I have a problem with form wizard, I have a form wizard with 3 steps. 
In step 2, user uploaded several files. In step 3, send the data to the 
database.
I can save files in server in step 2, but if user does not finish the form 
then files will remain on the server for free.Therefore I should not save 
files in step 2 but at done ()
Unfortunately I cannot reach all files in done () method.
How can I solve it, you have a solution for 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/96dd0e73-a4fc-4ec0-b992-f258cc2ded16%40googlegroups.com.


How to add a language in Django that its not supported by default?

2018-08-09 Thread Deniz Bazan


Im trying to make a website in 5 languages. The main language should be 
kurdish but it is not supported by Django default. I tried already the how 
to add new languages into Django? 


but it didnt work for me. I receive an error mesagge

**LANG_INFO = dict(django.conf.locale.LANG_INFO.items() + 
EXTRA_LANG_INFO.items())

TypeError: unsupported operand type(s) for +: 'dict_items' and 
'dict_items'**

I also tried already to copy an english *po file* and rename it "ku" 
(kurdish) and i added into django/conf/*init*.py the language info.

'ku': {
'bidi': False,
'code': 'ku',
'name': 'Kurdish',
'name_local': 'Kurdî',},

I can see the language by languages option by template but when i click it 
i receive an error message.

File "/usr/lib/python3.6/gettext.py", line 91, in _tokenizeraise 
ValueError('invalid token in plural form: %s' % value)

ValueError: invalid token in plural form: EXPRESSION

Does anybody know how can i fix it? Thanks so much!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/50ebc90d-fb3f-4223-b203-a94fabd30162%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New language adding error('Unknown language code si.')

2018-08-09 Thread Deniz Bazan
Hi Kumara, did you  find a solution for your question, because i have same 
problem. 

Am Montag, 30. April 2018 14:04:01 UTC+2 schrieb lakshitha kumara:
>
> Hello Jason,
>
> *Thanks you for your reply but **unfortunately** that example not working 
> any more with django 2 and python 3 .*
>
>
> *Thanks*
> On Monday, April 30, 2018 at 7:47:45 AM UTC+5:30, lakshitha kumara wrote:
>>
>> Hello Guys 
>>
>> I added new language to django . language called Sinhala. My code is look 
>> like this.
>>
>> On settings page 
>>
>> LANGUAGE_CODE = 'en'
>> LANGUAGES = [
>> ('si', _('Sinhala')),
>> ('en', _('English')),
>> ]
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = True
>>
>> LOCALE_PATHS = (
>> os.path.join(os.path.dirname(__file__), "../locale"),
>> )
>>
>> On locale folder 
>>
>> __init__.py
>>
>> LANG_INFO = {
>> 'si': {
>> 'bidi': False,
>> 'code': 'si',
>> 'name': 'Sinhala',
>> 'name_local': 'Sinhala',
>> },
>> }
>> I ran this command after that 
>>
>> manage.py makemessages -l si
>> manage.py compilemessages
>>
>>
>> When i goes to admin URL with sinhala language its working fine i try get 
>> all supported language give this error 
>>
>> {% csrf_token %}
>> 
>> 
>> {% get_current_language as LANGUAGE_CODE %}
>> {% get_available_languages as LANGUAGES %}
>> {% get_language_info_list for LANGUAGES as languages %}
>> {% for language in languages %}
>> > LANGUAGE_CODE %} selected{% endif %}>
>> {{ language.name_local }} ({{ language.code }})
>> 
>> {% endfor %}
>> 
>> 
>> 
>>
>>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/145f6cc1-2b36-4273-9cf5-0c3f70889e63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I need help! How to add a language in Django that its not supported by default?

2018-08-10 Thread Deniz Bazan


I m trying to make a website in 5 languages. The main language should be 
kurdish but it is not supported by Django default. I tried already the how 
to add new languages into Django? 


but it didnt work for me. I receive an error mesagge

**LANG_INFO = dict(django.conf.locale.LANG_INFO.items() + 
EXTRA_LANG_INFO.items())

TypeError: unsupported operand type(s) for +: 'dict_items' and 
'dict_items'**

I also tried already to copy an english *po file* and rename it "ku" 
(kurdish) and i added into django/conf/*init*.py the language info.

'ku': {
'bidi': False,
'code': 'ku',
'name': 'Kurdish',
'name_local': 'Kurdî',},

I can see the language by languages option by template but when i click it 
i receive an error message.

File "/usr/lib/python3.6/gettext.py", line 91, in _tokenizeraise 
ValueError('invalid token in plural form: %s' % value)

ValueError: invalid token in plural form: EXPRESSION

Does anybody know how can i fix it? Thanks so much!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2d14351c-e7d9-4aee-b4e5-c6e0ec175fcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add a language in Django that its not supported by default?

2018-08-10 Thread Deniz Bazan
thanks Clay, but this code  was not from me,i cant understand this code.I
need help for extra language by Django,wenn i dont find any solution for
this it ist very sad for me.


On Fri, Aug 10, 2018 at 3:17 PM Clay Records 
wrote:

> Hey Deniz,
>
> It seems you're making a mistake with adding dictionaries. Dictionaries
> cannot be added with the '+' symbol.
>
> This code gets the same error.
>
> a = {1:1, 2:2}
> b = {4:4, 5:5}
> c = dict(a.items() + b.items())
> print(c)
>
>
> However, this code has no errors.
>
> a = {1:1, 2:2}
> b = {4:4, 5:5}
> c = {**a, **b}
> print(c)
>
>
> Try adding your dictionaries together this way.
>
> -Clay Records
>
>
> On Thursday, August 9, 2018 at 11:31:59 AM UTC-4, Deniz Bazan wrote:
>>
>> Im trying to make a website in 5 languages. The main language should be
>> kurdish but it is not supported by Django default. I tried already the how
>> to add new languages into Django?
>> <https://stackoverflow.com/questions/12946830/how-to-add-new-languages-into-django-my-language-uyghur-or-uighur-is-not-su/>
>>
>> but it didnt work for me. I receive an error mesagge
>>
>> **LANG_INFO = dict(django.conf.locale.LANG_INFO.items() + 
>> EXTRA_LANG_INFO.items())
>>
>> TypeError: unsupported operand type(s) for +: 'dict_items' and
>> 'dict_items'**
>>
>> I also tried already to copy an english *po file* and rename it "ku"
>> (kurdish) and i added into django/conf/*init*.py the language info.
>>
>> 'ku': {
>> 'bidi': False,
>> 'code': 'ku',
>> 'name': 'Kurdish',
>> 'name_local': 'Kurdî',},
>>
>> I can see the language by languages option by template but when i click
>> it i receive an error message.
>>
>> File "/usr/lib/python3.6/gettext.py", line 91, in _tokenizeraise 
>> ValueError('invalid token in plural form: %s' % value)
>>
>> ValueError: invalid token in plural form: EXPRESSION
>>
>> Does anybody know how can i fix it? Thanks so much!
>>
>> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bb88-3616-4ec5-b518-9f2df2ef9a63%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/bb88-3616-4ec5-b518-9f2df2ef9a63%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Mit freundlichen Grüßen
*Deniz Bazan*

Web Entwickler
Filmmaker, Cutter, 3D  Artist
Tel:+49 163 133 68 00
http://denizbazan.jimdo.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADVVM_hYTLWBnAUPS8S5uL1xiitv7BwZO3G%3D%3DXDX0RU5Hdd_cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


In my django web app i wannt show time in user timezone

2018-12-07 Thread Deniz Bazan
Hello everybody,
I have a django web app, in my app i want to show in the page where the 
time information is, with user timezone.

I have a form with start_time and end_time(Timefield) user send this with a 
specific timezone(Berlin/Europa) after this when a user go to the page, the 
user should see the page with his own timezone.

I use Django 2.1 with postgresql database. 

Thanks for any recommendation!
Regards, 
Deniz

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e727995f-87e8-4a5c-bc25-fbe948269360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.