Re: Về: Exciting Opportunity: Join Our Django WhatsApp Bulk Messaging Project!

2024-02-29 Thread Akash Shekhavat
I am interested 9834295393

On Thu, 29 Feb, 2024, 5:16 am yaamoussa-solution, <
yaamoussa02di...@gmail.com> wrote:

> hello i am interesting
>
>
> Le sam. 24 févr. 2024 à 15:03, Hoàng Xuân  a
> écrit :
>
>> Hi! Please can you add me to join the group ? Thank you !
>> --
>> *From:* django-users@googlegroups.com  on
>> behalf of Benjamin Nwoke 
>> *Sent:* Saturday, February 24, 2024 0:52
>> *To:* django-users@googlegroups.com 
>> *Subject:* Re: Exciting Opportunity: Join Our Django WhatsApp Bulk
>> Messaging Project!
>>
>> I'm interested, I wish to have the details
>>
>> On Sun, Feb 18, 2024, 5:48 PM SURAJ TIWARI 
>> wrote:
>>
>>  Join Our Django WhatsApp Bulk Messaging Project!
>>
>>  Hello everyone,
>>
>> Are you looking for an exciting opportunity to gain hands-on experience
>> in Django development? Do you want to work on a meaningful project that
>> leverages WhatsApp for bulk messaging? We're thrilled to invite you to join
>> our dynamic team!
>>
>>  Benefits:
>>
>>- Get hands-on experience working on a real-world Django project.
>>- Learn how to leverage WhatsApp for bulk messaging, a valuable skill
>>in today's digital landscape.
>>- Opportunities for hybrid work, allowing flexibility in your
>>schedule.
>>- Collaborate with experienced developers and gain valuable
>>mentorship.
>>- Access to cutting-edge tools and technologies.
>>
>>  Opportunities Available:
>>
>>- Django developers
>>- Frontend developers
>>- UI/UX designers
>>- Quality assurance testers
>>
>> 欄 How to Join: Simply reply to this message expressing your interest,
>> and we'll provide you with all the necessary details to get started on our
>> project.
>>
>> Let's work together to create something amazing and gain valuable
>> experience along the way! ✨
>>
>> Best regards,
>>
>> Suraj Tiwari
>>
>>
>> --
>> 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/e8a705fd-10d9-4c1a-b4ba-0a7b896dbfean%40googlegroups.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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAN1m8aGoqq8RMKyRpRfozPKcE79m%3DP8N086UXr6EnpGu%3DxTmEA%40mail.gmail.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/TY2PR04MB37736396116D0403F831CAC2A5542%40TY2PR04MB3773.apcprd04.prod.outlook.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPs4bqHZ%3Dej3%3D-OLu7C_VeuYQRuUVpQ91LXK_gu4_WZPGSr%3DXA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP4fKdbwqLa-CEDciFnstLPzDge8rtxhDgLoQkrEkpYdX8%2BEgg%40mail.gmail.com.


Re: Get experience letter and job opportunities

2024-02-16 Thread Akash Shekhavat
Hii
I am also interested
+919834295393

On Fri, 16 Feb, 2024, 4:36 pm kumbhaj shukla,  wrote:

> Hii
> Add me as well.
>
> https://www.linkedin.com/in/kumbhaj
>
> On Fri, Feb 16, 2024, 12:10 PM william Kachuma  wrote:
>
>> hi
>>
>> Please add me aswell
>>
>> Kind regards
>>
>> On Wed, 14 Feb 2024 at 18:10, Rajalakshmi K 
>> wrote:
>>
>>> Hi... Add me.. Iam interested
>>>
>>> On Wed, 14 Feb, 2024, 8:54 pm Clifford Mukosh, 
>>> wrote:
>>>
 Hi add me I am intrested.

 On Tue, 6 Feb 2024, 11:03 machine learning, 
 wrote:

> anyone here to help me in our django project and in return we will
> give you access to software that will apply 100s of job for you and also
> hand on work experience.
>
> --
> 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/CAKKYCB4FFeSCpDQEoYDDwO2Yz%2B93F7DL_LhcgBxiPe4Lzd0scQ%40mail.gmail.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAHmKA0%3D2A1gLMwkdn1YFJMBb1K2kCHZkVOspf_YJwpT9Ds%3DYgw%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CABexcb3EO1URkvhutmo20LghqdRP%2BWF4WbkZO_Zcsbm6%3DgJ%2B%2BQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CADa4_w2gCJMMvcJT%3D6yWgWSiyb1CcwrXhbw2wK-WK-s%2Bum3TkQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPjc%3DUX%2Bvyrm_dUgSTH3PX0_Gc7fv%2B8QB-4Ub8bwORV31VaOsA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP4fKdY6kV9HBuFMPRtbGLTycBa-p%2BJt1sR%3DomthvQ5J0p-9gg%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread Akash Kundoo
>From where you're importing employees? Check that?

On Thu, 1 Sep, 2022, 7:31 pm Pooja Kumari,  wrote:

> Can anyone explain this error?
>
> --
> 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/2920648e-f12c-4e26-a089-59a196fd653an%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACTgikHJx6PUikfv6apyxe0suW%3D9tZNZCNy-0A%3D%3DXBv6%3DR2FyA%40mail.gmail.com.


Re: is anybody know how to add multiple fields on html form when user click on + icon

2022-06-17 Thread Akash Verma
You can use js or jquery for that.

On Fri, Jun 17, 2022, 12:38 PM Abhinandan K 
wrote:

> for example-
> fields are-
> name,age,salary.  +
> and when user click on + sign same fields increased according to user
> clicks on + sign..
>
> --
> 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/CAA6_Mp7YOmRprYhKu0Xb0%3DTVQqLTMEn7St2xRVrQjJeQ%2BghOgg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEvQWLOHO%3Dk4OsJNOok1YZMj6UCyHY6YkjGvvkgB5Md7WWfPmQ%40mail.gmail.com.


Re: help

2021-10-26 Thread Akash Verma
Use python -m django-admin startproject 

On Tue 26 Oct, 2021, 3:45 PM Kasper Laudrup,  wrote:

> On 25/10/2021 21.59, Planet X wrote:
> > hey there i can not figure out while django is installed to but its
> > showing django-admin is not recongnized as an internal or external
> > command please help
> >
>
> How did you install Django? What OS are you using?
>
> A bit of information like that would make it much easier for someone to
> help you.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/8d6cabf4-5972-190f-1744-6d3983715c2e%40stacktrace.dk
> .
>

-- 
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/CALLgasxepbqevfDWpo%3DZvj21auOhxiQ4SrYps5WuPv1QJrCsbg%40mail.gmail.com.


What values is expected for CSRF_COOKIE_PATH ?

2021-01-29 Thread akash tyagi
This should either match the URL path of your Django installation or be a 
parent of that path. 
This sentence is confusing to me. 

Suppose my domain name is demo.com , and I have django apps as App1,App2. 
Both uses CSRF token. What should be the correct CSRF_COOKIE_PATH here ?


-- 
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/5ed1519e-436b-4a65-9c8f-d89b3545b069n%40googlegroups.com.


Re: load static in css file

2020-08-24 Thread 'Akash Sinha' via Django users

Hi
Create a folder inside ur project as static and keep ur images,css and js files 
into that folder then in your settings.py file define static path. U need to 
run python manage.py collect static command on terminal and then you have to 
link that css file in HTML

Hint: check for Managing static files in official django doc or try stack 
overflow.com you will get example to setup static path
 
 
  On Mon, 24 Aug 2020 at 5:37 pm, MAMADOU KANTE wrote:   Hi 
Everybody!I am trying to set a background image using the STYLE tag with django 
template as follows: But when I open the 
HTML page and inspect the page I receive an image with width zero. Can anyone 
help?When I use the same syntax on a regular HTML without django templates it 
works.
On Mon, Aug 3, 2020 at 10:02 AM Obodoma Uzondu Vincent  
wrote:

Hello your have to follow the direction where you stored your file . Generally, 
in Django you create a static folder then maybe an image files where you store 
the images. You should link the image this way src= "{% static 
'images/imag.png' %}"
On Mon, 3 Aug 2020, 10:06 Yemin Sajid,  wrote:

This may not work as intended if the CSS files are not rendered using the 
Django template engine. You have to put the style declaration where you'd need 
the image in the  tag in your template code. From there you can 
use the {% static “images/imag.png” %} syntax.
On Friday, July 31, 2020 at 5:58:48 PM UTC+6 Chander shekhar wrote:

tried this buddy yet it is not working
Regards
Chander Shekhar
(bestcsp)


On Thu, Jul 30, 2020 at 6:11 PM Irfan Khan  wrote:

{% static 'imag.jpg' %}   instead of this try
{% static “images/imag.png” %}
On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar  wrote:

I am unable to fetch images from css file .I have used {% load static %}{% 
static 'imag.jpg' %}buti can't fetch.console is saying image not found.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/554cbaf1-3b94-40b4-a0f1-efe0bd3f24ceo%40googlegroups.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...@googlegroups.com.


To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALKGVio%3DAsCafgcd-zfjBb2of-RWbPaTwwGjf7sXbjstgFdM6Q%40mail.gmail.com.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f0e45bd1-68ca-405f-a033-c808d6da53d5n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACsKspkUCWwQdO_nGB%3DoU61X9qta7_8bFoBJODSF5rZNoVhiyQ%40mail.gmail.com.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOUY%2BRry8CUXbtx9QGhXYoU5c8R92gxG3q32%2B7dFpiPTnNgWaQ%40mail.gmail.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1004603577.4391205.1598272002937%40mail.yahoo.com.


Re: Unable to import HTML code

2020-07-05 Thread 'Akash Sinha' via Django users

In your settings.py file you have to mention your static path , please check if 
you have mentioned that. 2nd if everything is good . Try to access that css 
file on the browser .start the server with python manage.py runserver and type 
the full path of the file in url,("localhost:8000/static/style.css") if you can 
see your css code on browser then u have check ur html file.
1. Check for static tag in html file  i.e {% load static % }
2. static path in html file
 
 
  On Sun, 28 Jun 2020 at 12:29 am, Avi shah wrote:   I have 
developed a front end using bootstrap and different themes , and now I want to 
convert it into django html , I've loaded the static files and mentioned all 
the templates sec in my settings.py but for some reason my css is not being 
shown on the project even though it's been collected using collectstatic in 
manage.py 

-- 
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/50077ad1-eacb-4584-9566-dede788826aco%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2129713194.2118202.1593939180763%40mail.yahoo.com.


Django admin change history log ?

2019-11-16 Thread Akash Rajgure


HI,

In Django admin application there is a history page, which shows the 
modification history for a given model. In different models the changes 
field shown differently: action or comment. Cannot add pics, so here is the 
link to the pic: Django Classes in Pune 
 Is it 
possible to change the comment to action, because it is not properly 
displays modifications. Why is the comments has different format of 
messaging. We are not using any external packages like simple-history etc. 
It is just default logging Django. We couldn't find any information about 
overwriting the history block of admin app. And in the code nowhere 
specified comment or action. Please Help.

-- 
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/95d3c335-c5f7-4108-8c27-9768c478f160%40googlegroups.com.


Re: Django is not working

2019-08-22 Thread 'Akash Sinha' via Django users
You are using python 2.7 with Django , I will suggest you should use python 3.6 
or above.

Sent from Yahoo Mail on Android 
 
  On Fri, Aug 23, 2019 at 3:14 AM, Tom Gertin wrote:   
Hello, I have successfully install Django 1.11.22. However, I believe something 
is wrong because I cannot get the command that lists its version to work, in 
addition the manage.py help command also produces the same error. Here is the 
error.
$ pip install Django==1.11.22DEPRECATION: Python 2.7 will reach the end of its 
life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be 
maintained after that date. A future version of pip will drop support for 
Python 2.7.Collecting Django==1.11.22  Using cached 
https://files.pythonhosted.org/packages/70/22/237da71dc112f2bba335c18380bc403fba430c44cc4da088824e77652738/Django-1.11.22-py2.py3-none-any.whlRequirement
 already satisfied: pytz in 
/home/ubuntu/.venv/my_geonode/lib/python2.7/site-packages (from 
Django==1.11.22) (2019.1)Installing collected packages: Django  Found existing 
installation: Django 1.11.21    Uninstalling Django-1.11.21:      Successfully 
uninstalled Django-1.11.21Successfully installed Django-1.11.22WARNING: You are 
using pip version 19.1.1, however version 19.2.2 is available.You should 
consider upgrading via the 'pip install --upgrade pip' command.$ python -m 
django --versionTraceback (most recent call last):  File 
"/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main    "__main__", 
fname, loader, pkg_name)  File "/usr/lib/python2.7/runpy.py", line 72, in 
_run_code    exec code in run_globals  File 
"/home/ubuntu/.venv/my_geonode/lib/python2.7/site-packages/django/__main__.py", 
line 9, in     management.execute_from_command_line()  File 
"/home/ubuntu/.venv/my_geonode/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 364, in execute_from_command_line    utility.execute()  File 
"/home/ubuntu/.venv/my_geonode/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 338, in execute    django.setup()  File 
"/home/ubuntu/.venv/my_geonode/local/lib/python2.7/site-packages/django/__init__.py",
 line 27, in setup    apps.populate(settings.INSTALLED_APPS)  File 
"/home/ubuntu/.venv/my_geonode/local/lib/python2.7/site-packages/django/apps/registry.py",
 line 85, in populate    app_config = AppConfig.create(entry)  File 
"/home/ubuntu/.venv/my_geonode/local/lib/python2.7/site-packages/django/apps/config.py",
 line 120, in create    mod = import_module(mod_path)  File 
"/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module    
__import__(name)ImportError: No module named contrib
Help would be appreciated. Also, what is odd is that if I enter the python 
console, I can import django and print out the version.
Thanks,
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/471a2ef7-8032-420f-8fd2-027f005d1d55%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1485038449.1267586.1566533098549%40mail.yahoo.com.


Learn_Master_Django

2019-06-23 Thread akash bhanu Tiwari
I want to learn and to be master in Django. But the official documentation was 
so hard to understand. Please give me some link, suggestions.. please need 
urgent..

-- 
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/fd649c9d-bcf8-4c7c-b8b9-615b0fe6c823%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: reg: Django model sequense of the fields

2019-05-18 Thread 'Akash Sinha' via Django users
Position doesn't matters. 
 
  On Fri, May 17, 2019 at 7:12 PM, Test Bot wrote:   
[Just Curious] would it matter in any way what the position of field is in the 
respective tables.

On Fri, May 17, 2019, 5:46 PM 'Akash Sinha' via Django users 
 wrote:

Hello 

This happens for 2 reasons
1st. Those fields might be Foreign key, Foreign key fields are shown at the end 
in DB.

2nd.  You have added those fields later in our model class, if you will add new 
fields in model.py file those fields will be listed at the end.


 
 
  On Wed, May 8, 2019 at 9:22 PM, 'Amitesh Sahay' via Django 
users wrote:   Hello Users, 
I am seeing a very strange issue with my Django models. in my models.py, I have 
21 fields. Out of them , the 6th field is DASHBoard. However, when I see those 
fields in my postgres DB through PgAdminIII, it is listed at the very end of 
the list. 
Sorry, for security reasons I couldn't give the list of the fields here.
Could there be any explanation for this situation?


Regards,
Amitesh Sahay

-- 
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/1048828608.1995499.1557330720573%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.
  


-- 
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/284735666.2028007.1558069879362%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.



-- 
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/CAD%3DM5eRMBwtQfgEacV3SqDCh4zZMDPtJ_yarb1_eazMYpcuDAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  

-- 
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/927234931.2311630.1558166418301%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


Re: reg: Django model sequense of the fields

2019-05-17 Thread 'Akash Sinha' via Django users
Hello 

This happens for 2 reasons
1st. Those fields might be Foreign key, Foreign key fields are shown at the end 
in DB.

2nd.  You have added those fields later in our model class, if you will add new 
fields in model.py file those fields will be listed at the end.


 
 
  On Wed, May 8, 2019 at 9:22 PM, 'Amitesh Sahay' via Django 
users wrote:   Hello Users, 
I am seeing a very strange issue with my Django models. in my models.py, I have 
21 fields. Out of them , the 6th field is DASHBoard. However, when I see those 
fields in my postgres DB through PgAdminIII, it is listed at the very end of 
the list. 
Sorry, for security reasons I couldn't give the list of the fields here.
Could there be any explanation for this situation?


Regards,
Amitesh Sahay

-- 
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/1048828608.1995499.1557330720573%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.
  

-- 
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/284735666.2028007.1558069879362%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


error 403 on admin login

2019-04-10 Thread Akash Kumar
I was following the official polls app tutorial on Django on v2.2.
i have created the superuser of the first time but whenever I log in it 
shows error 403 forbidden (csrf token missing or incorrect)
can anyone plz help me.

-- 
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/012ee0bb-9fe8-4e0c-ab61-da55e79c3152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regarding internship opportunity in Bangalore

2019-03-28 Thread Akash Purandare
Hey Sachin

If you might be interested in Full Stack Development of a Website, please 
do send me your CV. 

We work in a startup called Oversight.

Regards
Akash Purandare
akash.p1...@gmail.com

On Thursday, March 28, 2019 at 11:24:18 PM UTC+5:30, sachin thakur wrote:
>
> Hi Folks 
> This email is regarding internship opportunity if there are any internship 
> opportunity please do let me know I am already working on django also I 
> developed web based applications using jsp servlet and hibernate. Please do 
> let me know if any opportunity is available
>

-- 
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/28a17b1a-d92b-47c7-acd0-ab79fe9c22b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Looking for a Django Intern in India

2019-03-28 Thread Akash Purandare
Hello Django Developers

We would like to provide you with opportunities to work in a live project 
on Django. This is an internship which requires you to collaborate 
effectively with other members of the team based in India.

Requirements:
Good Knowledge of Django
Basic Knowledge of React
Proficiency in Git and Heroku

Interested developers can send their CV to the E-mail Akash Purandare 
.
Vacancies: 2

Regards
Akash Purandare
Oversight
akash.p1...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a3a73d40-c532-46f7-8da9-35178362cd63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image Upload in admin panel

2019-02-14 Thread Akash Purandare
Hey Surajeet

At first, you will need to create a model with the Field `ImageField`(do 
not forget to install pillow using `pip install pillow`) in the models.py 
of your app.
Then, you will need to register that model to admin.py of the app and then 
start the webserver. So, you will be able to see the model in your admin 
panel and thus upload the image there.
To show an image in the HTML page, you will need to create a view function 
and pass a context with {item: } and then write 
in your template code ``

Regards
Akash Purandare

On Friday, February 15, 2019 at 12:07:04 AM UTC+5:30, Surajeet Das wrote:
>
> How do I upload images from admin panel and retrieve from a html page ?
>

-- 
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/80b77d97-7eb4-46f2-bf58-28a120b9d60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Authorization not working on production server

2018-12-07 Thread Akash utreja
Hi,
I am building authorization in django framework using python.. The problem 
is that my code is working fine on local server but when I run the same in 
production it returns "Anonymous User" 

Am I doing it right?

if request.user.has_perm('auth.access_admin')
""whole code""
else:
   return Response({'error': 'Unauthorized'},
status=status.HTTP_401_UNAUTHORIZED)

My request.user.has_perm return false because request.user is Anonymous.I 
also try to return my request.user.username it is also coming 
blank.Please help me out!
Thanks
Akash

-- 
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/cf25f56b-1fc6-45df-bf4b-ba0b01729b04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: file URL missing project name

2018-11-20 Thread Akash Purandare
Hey Jeff

It is completely alright to try until we find a solution to this.
I quote from the Django Documentation:
Note that request.FILES 
<https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.HttpRequest.FILES>
 will 
only contain data if the request method was POST and the  that posted 
the request has the attribute enctype="multipart/form-data". Otherwise, 
request.FILES will be empty.

Can you ensure that the particular requirements are fulfilled?

Also, I would like to ask you to try to upload a file from the Django admin 
panel and tell me if it is working. If not, can you send me the URL and the 
uploaded path of the Admin panel uploaded file?

Regards
Akash Purandare

On Sunday, November 18, 2018 at 8:48:04 PM UTC+5:30, Jeff Williams wrote:
>
> Hi All,
> I'm new to django, so sorry if this is a newbie issue.
>
> I've managed to upload an ImageFieldbut when I try to display it in my 
> template using object.pic.url...the URL I'm getting back is missing my 
> project name from the URL and the pic is not loading.
>
> Specifically I'm getting 
> http://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>  back.and 
> I need 
>
> http://127.0.0.1:8000/*oldgrub*
> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>
> back to have it work.  
>
> What am I missing?  I've poured over my configs.
> Jeff 
>

-- 
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/7a1672c8-0f53-41f3-88c0-e3d7a70e7ae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: file URL missing project name

2018-11-19 Thread Akash Purandare
Hey Jeff

Can you send me the URL of the file and the Location of the uploaded media 
file?

Regards
Akash Purandare

On Sunday, November 18, 2018 at 8:48:04 PM UTC+5:30, Jeff Williams wrote:
>
> Hi All,
> I'm new to django, so sorry if this is a newbie issue.
>
> I've managed to upload an ImageFieldbut when I try to display it in my 
> template using object.pic.url...the URL I'm getting back is missing my 
> project name from the URL and the pic is not loading.
>
> Specifically I'm getting 
> http://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>  back.and 
> I need 
>
> http://127.0.0.1:8000/*oldgrub*
> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>
> back to have it work.  
>
> What am I missing?  I've poured over my configs.
> Jeff 
>

-- 
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/5c9ebd72-bb98-49b8-81eb-dd9da3e7796e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django token base authentication using python

2018-11-18 Thread Akash utreja
Hi I am trying to build an authentication system. I have added following in 
my setting.py file
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 
'rest_framework.pagination.LimitOffsetPagination'
}
And I also added decorators in my each api functional views as following
@permission_classes((IsAuthenticated,))
Now I am making request to api using token so some them are accessible but 
some get unauthorized.And these api which get unathorized are random mean 
not a particular api get unauthorized. 
Am I missing something?Please help me out here!
Thanks
Akash

-- 
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/e8fd147e-6090-4805-9369-127dc3329485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: file URL missing project name

2018-11-18 Thread Akash Purandare
Hey Jeff

I tried the models that you were creating and I found out the error that 
you are having is with the Model. The upload_to of the pic variable is set 
to 'media/', which uploads the file to the url 
http://localhost:8000/oldgrub/media/media/56288852088__208FCEF9-5890-
4633-8BF6-C5C9A82D87EE.JPG. So if you change the upload_to to '', the URL 
will be http://localhost:8000/oldgrub/media/56288852088__208FCEF9-5890-
4633-8BF6-C5C9A82D87EE.JPG.

Hope this fixes the issue that you are facing.

Regards
Akash Purandare

On Sunday, November 18, 2018 at 10:57:31 PM UTC+5:30, Jeff Williams wrote:
>
> Nope.  Same error.  I can see the file being loaded.  Doesn't like the URL 
> still. 
>
> On Sun, Nov 18, 2018 at 11:30 AM Akash Purandare  > wrote:
>
>> Hey Jeff
>>
>> I think that you might need to upload the file again and try.
>>
>> Let me know if it works out.
>>
>> Regards
>> Akash Purandare
>>
>>
>> On Sunday, November 18, 2018 at 9:56:13 PM UTC+5:30, Jeff Williams wrote:
>>
>>> OK this is almost fixed:
>>>
>>> Why isn't this path matching?
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: 
>>> http://127.0.0.1:8000/oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG
>>>
>>> Using the URLconf defined in familyrecipies.urls, Django tried these 
>>> URL patterns, in this order:
>>>
>>>1. admin/
>>>2. oldgrub/ [name='index']
>>>3. oldgrub/ cookbooks/ [name='cookbooks']
>>>4. oldgrub/ cookbook/ [name='cookbook']
>>>5. oldgrub/ recipe/ [name='recipes']
>>>6. oldgrub/ recipe/ [name='recipe']
>>>7. oldgrub/ family/ [name='family']
>>>8. oldgrub/ recipe/add/ [name='addrecipe']
>>>9. oldgrub/ ^oldgrub/media/(?P.*)$
>>>10. 
>>>11. accounts/
>>>
>>> The current path, 
>>> oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG, 
>>> didn't match any of these.
>>>
>>> On Sun, Nov 18, 2018 at 11:08 AM Jeff Williams  
>>> wrote:
>>>
>> Thanks Akash.
>>>> Haven't quite fixed it yet but this is definitely the right area.  
>>>> Jeff 
>>>>
>>>> On Sun, Nov 18, 2018 at 10:52 AM Akash Purandare  
>>>> wrote:
>>>>
>>> Hi Jeff
>>>>>
>>>>> I believe that the URL that you want to show is completely irrelevant 
>>>>> as the Django's FileField does that for you. However, in case you really 
>>>>> want your project name to be included in your URL, you can change the 
>>>>> MEDIA_URL in your settings.py to '/oldgrub/media' to reflect the 
>>>>> necessary 
>>>>> changes for you.
>>>>>
>>>>> Also, I believe that the problem you are facing is because you want to 
>>>>> serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence, you 
>>>>> must add this URL pattern at the end of your urls.py file of your main 
>>>>> project folder.
>>>>>
>>>>> from django.conf import settings
>>>>> from django.conf.urls.static import static
>>>>> urlpatterns = [
>>>>> ...(Your Urls)
>>>>> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>>>>>
>>>>> Regards
>>>>> Akash Purandare
>>>>>
>>>>>
>>>>> On Sunday, November 18, 2018 at 8:48:04 PM UTC+5:30, Jeff Williams 
>>>>> wrote:
>>>>>>
>>>>>> Hi All,
>>>>>> I'm new to django, so sorry if this is a newbie issue.
>>>>>>
>>>>>> I've managed to upload an ImageFieldbut when I try to display it 
>>>>>> in my template using object.pic.url...the URL I'm getting back is 
>>>>>> missing 
>>>>>> my project name from the URL and the pic is not loading.
>>>>>>
>>>>>> Specifically I'm getting 
>>>>>> http://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>>>  back.and 
>>>>>> I need 
>>>>>>
>>>>>> http://127.0.0.1:8000/*oldgrub*
>>>>>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>>>
>>>>>> back to have it work.  
>>>>>>
>>>>>> What am I missing?  I've poured o

Re: file URL missing project name

2018-11-18 Thread Akash Purandare
Hey Jeff

I think that you might need to upload the file again and try.

Let me know if it works out.

Regards
Akash Purandare

On Sunday, November 18, 2018 at 9:56:13 PM UTC+5:30, Jeff Williams wrote:
>
> OK this is almost fixed:
>
> Why isn't this path matching?
>
> Page not found (404)
> Request Method: GET
> Request URL: 
> http://127.0.0.1:8000/oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG
>
> Using the URLconf defined in familyrecipies.urls, Django tried these URL 
> patterns, in this order:
>
>1. admin/
>2. oldgrub/ [name='index']
>3. oldgrub/ cookbooks/ [name='cookbooks']
>4. oldgrub/ cookbook/ [name='cookbook']
>5. oldgrub/ recipe/ [name='recipes']
>6. oldgrub/ recipe/ [name='recipe']
>7. oldgrub/ family/ [name='family']
>8. oldgrub/ recipe/add/ [name='addrecipe']
>9. oldgrub/ ^oldgrub/media/(?P.*)$
>10. 
>11. accounts/
>
> The current path, 
> oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG, 
> didn't match any of these.
>
> On Sun, Nov 18, 2018 at 11:08 AM Jeff Williams  > wrote:
>
>> Thanks Akash.
>> Haven't quite fixed it yet but this is definitely the right area.  
>> Jeff 
>>
>> On Sun, Nov 18, 2018 at 10:52 AM Akash Purandare > > wrote:
>>
>>> Hi Jeff
>>>
>>> I believe that the URL that you want to show is completely irrelevant as 
>>> the Django's FileField does that for you. However, in case you really want 
>>> your project name to be included in your URL, you can change the MEDIA_URL 
>>> in your settings.py to '/oldgrub/media' to reflect the necessary changes 
>>> for you.
>>>
>>> Also, I believe that the problem you are facing is because you want to 
>>> serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence, you 
>>> must add this URL pattern at the end of your urls.py file of your main 
>>> project folder.
>>>
>>> from django.conf import settings
>>> from django.conf.urls.static import static
>>> urlpatterns = [
>>> ...(Your Urls)
>>> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>>>
>>> Regards
>>> Akash Purandare
>>>
>>>
>>> On Sunday, November 18, 2018 at 8:48:04 PM UTC+5:30, Jeff Williams wrote:
>>>>
>>>> Hi All,
>>>> I'm new to django, so sorry if this is a newbie issue.
>>>>
>>>> I've managed to upload an ImageFieldbut when I try to display it in 
>>>> my template using object.pic.url...the URL I'm getting back is missing my 
>>>> project name from the URL and the pic is not loading.
>>>>
>>>> Specifically I'm getting 
>>>> http://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>  back.and 
>>>> I need 
>>>>
>>>> http://127.0.0.1:8000/*oldgrub*
>>>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>
>>>> back to have it work.  
>>>>
>>>> What am I missing?  I've poured over my configs.
>>>> Jeff 
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com .
>>> To post to this group, send email to django...@googlegroups.com 
>>> .
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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/d4970488-eae4-4298-96ad-617fac29ae08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Exception Value: fe_sendauth: no password supplied

2018-11-18 Thread Akash Purandare
Hi Akash

Can you specify as to what error you are facing? Also, I believe that the 
ENGINE that you are using must be 'django.db.backends.postgresql' as given 
in the official docs of 
Django: 
https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-DATABASE-ENGINE

Regards
Akash Purandare

On Sunday, November 18, 2018 at 7:45:38 PM UTC+5:30, akash wrote:
>
> hi all i am trying to connect to postgres db and display records on 
> webpage i have set up dyango project but not sure why i am getting this 
> error.
>
> settings.py
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'test',
> 'USER': 'abtech',
> 'PASSWORD': 'abtech',
> 'HOST': 'localhost',
> 'PORT': '5432',
> }
> }
>
>
>
>

-- 
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/a6a47561-8970-422d-8265-e9534171828a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: file URL missing project name

2018-11-18 Thread Akash Purandare
Hi Jeff

I believe that the URL that you want to show is completely irrelevant as 
the Django's FileField does that for you. However, in case you really want 
your project name to be included in your URL, you can change the MEDIA_URL 
in your settings.py to '/oldgrub/media' to reflect the necessary changes 
for you.

Also, I believe that the problem you are facing is because you want to 
serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence, you 
must add this URL pattern at the end of your urls.py file of your main 
project folder.

from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
...(Your Urls)
]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Regards
Akash Purandare

On Sunday, November 18, 2018 at 8:48:04 PM UTC+5:30, Jeff Williams wrote:
>
> Hi All,
> I'm new to django, so sorry if this is a newbie issue.
>
> I've managed to upload an ImageFieldbut when I try to display it in my 
> template using object.pic.url...the URL I'm getting back is missing my 
> project name from the URL and the pic is not loading.
>
> Specifically I'm getting 
> http://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>  back.and 
> I need 
>
> http://127.0.0.1:8000/*oldgrub*
> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>
> back to have it work.  
>
> What am I missing?  I've poured over my configs.
> Jeff 
>

-- 
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/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Exception Value: fe_sendauth: no password supplied

2018-11-18 Thread akash
hi all i am trying to connect to postgres db and display records on webpage 
i have set up dyango project but not sure why i am getting this error.

settings.py

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test',
'USER': 'abtech',
'PASSWORD': 'abtech',
'HOST': 'localhost',
'PORT': '5432',
}
}



-- 
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/fdba2734-889d-4187-89c7-c9ea21e9ae9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I can't start django

2018-11-16 Thread Akash Purandare
Can you show the output of pip freeze in your virtual environment?

-- 
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/72a96826-4c1c-474b-afc7-2facf4a1e338%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


using permission required

2018-11-14 Thread Akash utreja
I am trying to use permission required decorator using authorization 
header.And it always gives me 302 error. although my user has permission 
for it.Kindly help I am beginner to django.
Here is my code

@permission_required('access_admin', login_url=None)
@permission_classes((IsAuthenticated,))
@api_view(['POST','GET'])
def actionLibrary(request):
if request.method == 'GET':
print(request.user.has_perm("api.access_admin")) #it print true if 
I remove permission_required decorator
queryset=ActionLibrary.objects.all()
serializer=ActionLibrarySerailizer(queryset,many=True)
return Response(serializer.data)

-- 
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/7952f118-107c-489b-a9e0-a94cc3441337%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: hi everyone

2018-11-11 Thread akash kandpal
I mean we can see some working projects and learn from it by implementing
them ourselves and thus it will be more of a learning opportunity for us.


Regards,
Akash Kandpal.

On Mon, Nov 12, 2018, 12:22 PM Joel  I don't really understand what you mean. How can you put something on your
> resume when you haven't contributed to it?
>
> On Mon, 12 Nov, 2018, 12:06 PM ramakurthy swamy  wrote:
>
>> hi sir thank u for giving reply and the real time means what the present
>> projects are going on company based on python and django,,,
>> And i have a two years gap in my academic period based on that project i
>> want to fill-up that gap so plz kindly help
>>
>> On Sun, Nov 11, 2018 at 7:45 PM PASCUAL Eric 
>> wrote:
>>
>>> Hi,
>>>
>>>
>>> What do you mean exactly by "real time" ? Can you describe the project
>>> you are thinking about ?
>>>
>>>
>>> "Real time" relates to a very specific class of software, which one of
>>> the characteristics is to react to external events in a (most often) short
>>> and, *deterministic* time. For sure, neither Python nor Django fulfill
>>> the involved technical requirements, especially considering the
>>> deterministic property which is one of the RT non negotiable aspect.
>>>
>>>
>>> BTW can you elaborate a bit on what you mean by "i want to keep that
>>> project in my resume" ?
>>>
>>>
>>> Regards
>>>
>>>
>>> Eric
>>> --
>>> *From:* django-users@googlegroups.com 
>>> on behalf of ramakurthy swamy 
>>> *Sent:* Sunday, November 11, 2018 2:29:51 PM
>>> *To:* Django users
>>> *Subject:* hi everyone
>>>
>>> i am looking for real time project based on python and django plz help
>>> `me and i want to keep that project in my resume plz help me guiess
>>>
>>> --
>>> 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/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> 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/VI1P193MB04326D4B9AAA3A7EA2A856348CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM
>>> <https://groups.google.com/d/msgid/django-users/VI1P193MB04326D4B9AAA3A7EA2A856348CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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/CAHa6oC9WoybinQcMjYR2FvzcSohAfz6Yk_99xAP5_zB669MvAg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHa6oC9WoybinQcMjYR2FvzcSohAfz6Yk_99xAP5_zB669MvAg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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, 

Re: hi everyone

2018-11-11 Thread akash kandpal
I am also looking for some example with  code on such projects.Specially, I
am  looking for some complete websites or working projects on django to
learn it's backend part and connectivity with database. If any such project
is found, please infrom me too. @ramakurthy Here is my whatsaap no
9654263057. We can work on such projects together, I am  final year
undergrad from Delhi,  India.

On Mon, Nov 12, 2018 at 12:06 PM ramakurthy swamy 
wrote:

> hi sir thank u for giving reply and the real time means what the present
> projects are going on company based on python and django,,,
> And i have a two years gap in my academic period based on that project i
> want to fill-up that gap so plz kindly help
>
> On Sun, Nov 11, 2018 at 7:45 PM PASCUAL Eric  wrote:
>
>> Hi,
>>
>>
>> What do you mean exactly by "real time" ? Can you describe the project
>> you are thinking about ?
>>
>>
>> "Real time" relates to a very specific class of software, which one of
>> the characteristics is to react to external events in a (most often) short
>> and, *deterministic* time. For sure, neither Python nor Django fulfill
>> the involved technical requirements, especially considering the
>> deterministic property which is one of the RT non negotiable aspect.
>>
>>
>> BTW can you elaborate a bit on what you mean by "i want to keep that
>> project in my resume" ?
>>
>>
>> Regards
>>
>>
>> Eric
>> --
>> *From:* django-users@googlegroups.com  on
>> behalf of ramakurthy swamy 
>> *Sent:* Sunday, November 11, 2018 2:29:51 PM
>> *To:* Django users
>> *Subject:* hi everyone
>>
>> i am looking for real time project based on python and django plz help
>> `me and i want to keep that project in my resume plz help me guiess
>>
>> --
>> 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/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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/VI1P193MB04326D4B9AAA3A7EA2A856348CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM
>> <https://groups.google.com/d/msgid/django-users/VI1P193MB04326D4B9AAA3A7EA2A856348CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/CAHa6oC9WoybinQcMjYR2FvzcSohAfz6Yk_99xAP5_zB669MvAg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHa6oC9WoybinQcMjYR2FvzcSohAfz6Yk_99xAP5_zB669MvAg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
<https://about.me/akashkandpal?promo=email_sig_source=product_medium=email_sig_campaign=edit_panel_content=thumb>
Akash Kandpal
about.me/akashkandpal
<https://about.me/akashkandpal?promo=email_sig_source=product_medium=email_sig_campaign=edit_panel_content=thumb>

-- 
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/CAPND-h5Ta0b7%3DyUpKKhjBpoHHqc46witdyOEjbb4_vnNHZaPZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Library not loaded: libssl.1.0.0.dylib New Mac on Mohave

2018-11-11 Thread Akash Purandare
Hey Andrew

Can you show the output of pip freeze?

On Saturday, November 10, 2018 at 4:38:59 PM UTC+5:30, Andrew Troiano wrote:
>
> Hey,
>
> I am trying to get my app running on a new Mac.  It's on Mohave, python 
> 2.7, here is the stack trace. https://dpaste.de/m9WO .  We are getting 
> Library not loaded: libssl.1.0.0.dylib when trying to connect to remote 
> mysql database.
>
> Thanks!
>

-- 
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/f6795ad3-3c00-4612-8faa-a6bbd2b6a758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Akash Purandare
Thank you for the fast reply.

However the issue is not with Whitenoise. Whitenoise can be used to serve 
static files, yes. But how do I use it to serve media assets in the project?

On Monday, October 22, 2018 at 9:11:02 PM UTC+5:30, Andrew Pinkham wrote:
>
> https://devcenter.heroku.com/articles/django-assets 
> 
>  
> http://whitenoise.evans.io/en/stable/django.html 
>
>

-- 
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/64d5e24a-7115-409e-b328-c45a0875f5b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need help with CDN on Django App using heroku

2018-10-22 Thread Akash Purandare
I am trying to serve both static and media files on Heroku by using an S3 
bucket, but I do not know how to properly configure the settings.py for the 
same.
Does anyone know how to do it? If you do, please direct me to the correct 
set of information.

-- 
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/c3db0ad0-9342-4ca1-ba6d-2c1895b6790a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cannot deploy Django project on Heroku from a Ubuntu 18.04 laptop

2018-10-22 Thread Akash Purandare
You can use Pipenv to specify the version of python to Heroku. Personally, 
I have used upto Python 3.7 to deploy my Django projects, seems to work 
best with Pipenv

On Monday, October 22, 2018 at 5:52:05 PM UTC+5:30, Mo-rema07 wrote:
>
> Hello people,
>
> Can I please get help? I am a noob using a Lenovo V110 running Ubuntu 
> 18.04. I am getting an  error that I am using python 3.6.5 instead of 
> 3.6.6. However when I check the python version using "python3 --version" I 
> find that my version is 3.6.6. Can someone please help I have been 
> struggling with this issue for about 2 weeks and I cannot find the solution 
> online.
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef1f17c4-82e8-4862-b7f9-4bddb0250f51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Urls in Django model for dynamic template loading

2018-10-19 Thread Akash Purandare
I am creating a website in django and I was wondering how I can add a url 
to Django Model and then retrieve that url to provide to the {% url 
'url_in_db'%} in the templates. If not, can anyone give me any other 
suggestions to achieve this?

-- 
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/9d7b6ce9-5c3a-461d-a45f-3efe1d6ef3df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ManyToMany relationship with through_fields and Admin

2018-08-28 Thread akash kandpal
What changes you did ?

Regards,
Akash Kandpal.

On Wed, Aug 29, 2018, 12:34 AM Vincent  wrote:

> I figured it out :
>
> from django.db import models
> from django.contrib.auth.models import User
>
>
> # Create your models here.
> class Events(models.Model):
>  Name = models.CharField(max_length=64)
>  Date = models.DateTimeField()
>  Description = models.CharField(max_length=200)
>  Admin = models.ForeignKey(User, models.SET_NULL, blank=True, null=True,
> related_name='event_admin')
>  Status = models.PositiveIntegerField(default=0)
>  Attendees = models.ManyToManyField(User, through='Attend',through_fields
> =('events','attendees'))
>
>  def __str__(self):
>  return self.Name
>
>
>
>
> class Attend(models.Model):
>  events = models.ForeignKey(Events, on_delete=models.CASCADE)
>  attendees = models.ForeignKey(User, on_delete=models.CASCADE,
> related_name='attendees')
>  PlusOne = models.ForeignKey(User, on_delete=models.CASCADE, related_name=
> 'PlusOne')
>
>  class Meta:
>  unique_together = (('events', 'attendees'),)
>
> from django.contrib import admin
> from .models import Events
> from .models import Attend
> from django.contrib.auth.models import User
>
>
>
>
> # Register your models here.
>
>
> class AttendInline(admin.TabularInline):
>  model = Attend
>  extra = 1
>
>
> class EventsAdmin(admin.ModelAdmin):
>  inlines = [ AttendInline, ]
>
>
>
>
> admin.site.register(Events, EventsAdmin)
>
>
>
> Le mardi 28 août 2018 00:44:49 UTC+2, Vincent a écrit :
>>
>> Hello,
>>
>> I'm new to Django and i'm trying to made a simple app in which users can
>> attend to an event. I'm trying to have this manageable through the admin
>> site but i get the following error :
>> : (admin.E202) fk_name 'attendees'
>> is not a ForeignKey to 'evenement.Events'.
>>
>> My goal is to have an interface to create the event and add users in the
>> event.
>>
>> Here are my models :
>>
>> from django.db import models
>> from django.contrib.auth.models import User
>>
>>
>> # Create your models here.
>> class Events(models.Model):
>>  Name = models.CharField(max_length=64)
>>  Date = models.DateTimeField()
>>  Description = models.CharField(max_length=200)
>>  Admin = models.ForeignKey(User, models.SET_NULL, blank=True, null=True,
>> related_name='event_admin')
>>  Status = models.PositiveIntegerField(default=0)
>>  Attendees = models.ManyToManyField(User, through='Attend',through_fields
>> =('events','attendees'))
>>
>>  def __str__(self):
>>  return self.Name
>>
>>
>> class Attend(models.Model):
>>  events = models.ForeignKey(Events, on_delete=models.CASCADE)
>>  attendees = models.ForeignKey(User, on_delete=models.CASCADE)
>>  PlusOne = models.ForeignKey(User, on_delete=models.CASCADE, related_name
>> ='PlusOne')
>>
>> And the admin.py
>>
>> from django.contrib import admin
>> from .models import Events
>> from .models import Attend
>> from django.contrib.auth.models import User
>>
>>
>>
>>
>> # Register your models here.
>>
>>
>> class AttendInline(admin.TabularInline):
>>  model = Attend
>>  fk_name = "attendees"
>>  extra = 1
>>
>>
>> class UserAdmin(admin.ModelAdmin):
>>  inlines = [ AttendInline, ]
>>
>>
>> class EventsAdmin(admin.ModelAdmin):
>>  inlines = [ AttendInline, ]
>>
>>
>>
>>
>> admin.site.unregister(User)
>> admin.site.register(User, UserAdmin)
>>
>>
>> admin.site.register(Events, EventsAdmin)
>>
>>
>> Your help will be much appreciated !
>>
>> Thank you
>>
>> Vincent
>>
> --
> 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/690d5956-6348-4ae3-99bf-030e7df91cdb%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/690d5956-6348-4ae3-99bf-030e7df91cdb%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPND-h6%2BfhTXF_vzKLjHofXjg%2BTWrD0NpyefaVKW0Q4q55%3DbPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: syntax error

2018-07-25 Thread akash kandpal
In the she'll try this
python
import django
print (django.VERSION)


On Wed, Jul 25, 2018, 4:54 PM Akhil Reddy  wrote:

> So what is the solution for this pblm..
>
>
> On Wed 25 Jul, 2018 7:38 am deepali pandey, 
> wrote:
>
>> $ python -m django --version showing syntax error? also i am unable to
>> create a file.. i am using python 3.7 and django is already installed in my
>> system, version of django is 2.0.7(which is compatible with python 3.7
>>
>> --
>> 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/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/CAMeUrx_Qia08dttTnNd7ZZ9%3DRXegXVyHc9N00O6K8owhf%2BMHfw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPND-h7fpu%3D8c9mW27uiGBqt5yn-uKfj4GgKk0fcSB%3Dsbb2ryA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread akash . sharma
Hi, i haven't used other db's but agree with Mike. It's good enough. 

On 15-01-2018 05:40 PM, Mike Dewhirst wrote:

> Since no-one has suggested avoiding MySQL I should say that I have a few 
> small websites and every time I check the logs they are full of uglies trying 
> to access phpmyadmin. Every time I see that I'm glad I went for PostgreSQL.
> 
> From my research it seems Postgres is probably the best option for Django if 
> you want stability with scalability and atomicity.
> 
> YMMV
> 
> Mike
> 
> On 15/01/2018 10:44 PM, Julio Biason wrote: 
> 
>> Hi Daniel,
>> 
>> Well, in simple terms, all you need to do is change the DATABASE setting in 
>> your settings (here 
>> https://www.coderedcorp.com/blog/django-settings-for-multiple-environments/ 
>> is an example of way to keep two different configurations, so you can have a 
>> production setting pointing to MySQL while keeping your dev setting using 
>> SQLite). You may need to create the user and a database for it, but that's 
>> more of a MySQL-specific question than Django.
>> 
>> If you want to migrate your data from SQLite to MySQL, you can use 
>> `dumpdata` to "export" the data from your dev enviroment and `loaddata` to 
>> load it back to the production data. Both are part of the default manage.py: 
>> https://docs.djangoproject.com/en/2.0/ref/django-admin/#dumpdata
>> 
>> On Sun, Jan 14, 2018 at 12:09 PM, Daniel Cîrstea > > wrote:
>> 
>> Hello. I am new to Django and I am trying to use it for my
>> bachelor thesis. Thing is, I want to use MySQL insted of SQLite.
>> How do I exactly do it.. I can't find a step-by-step tutorial on
>> the internet.
>> Also, I want to deploy project later on Heroku. Can I work on
>> SQLite on local machine and then is possible to change to MySQL on
>> Heroku ? In any case, I want to know how to do both, if possible.
>> 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 https://groups.google.com/group/django-users
>> .
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/a7decab1-334e-4f04-a6e9-6ad7bc2cd78b%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout
>> .
>> 
>> -- *Julio Biason*,Sofware Engineer
>> *AZION*  | Deliver. Accelerate. Protect.
>> Office: +55 51 3083 8101   |  Mobile: +55 51 
>> _99907 0554_
>> -- 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/CAEM7gE32Kg9zKb5t4JzBdoshYA3sCk5Q6xuckwPNtSHt1zuYKA%40mail.gmail.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout.

-- 
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/2670921872bbe15ed41827613780%40tiss.edu.
For more options, visit https://groups.google.com/d/optout.


ModuleNotFoundError: No module named 'C:\\Program Files (x86)\\Python36-32\\Lib\\site-packages\\Django-1'

2017-08-04 Thread Akash Singh
Hi,

I am starting to learn Django.

When I installed django for the first time, it was working fine, when i 
restarted my system it is giving the above mentioned error. I tried editing 
the *path* environment variable but still it doesn't work.

*django-admin.py* file is in *C:\Program Files 
(x86)\Python36-32\Lib\site-packages\Django-1.11.4-py3.6.egg\django\bin*


On mentioning above path in *PATH* environment variable, it is giving the 
above mentioned errorAny help ?

-- 
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/999d0398-7e15-42a5-9c45-9f8a14b144b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


testing in django

2017-05-23 Thread Akash Tomar
class SignUpTest(TestCase):
def test_createAccount(self):
my_data = {'username': 'akash.tomar107', 'password': 
'akashtomar',"email":"akash.tomar...@gmail.com", 
"confirm_password":"akashtomar", "type_of_user":"1", "first_name":"akash", 
"last_name":"tomar"}
response = self.client.post('/signup/', json.dumps(my_data), 
content_type='application/json')
self.assertIs(json.loads(response.content)["success"], True)

class LoginTest(TestCase):
def test_login(self):
my_data = {'username': 'akash.tomar107', 'password': 'akashtomar'}
response = self.client.post('/login/', json.dumps(my_data), 
content_type='application/json')
# import pdb; pdb.set_trace()
self.assertIs(json.loads(response.content)["login"], True)


I want to be able to use the data created while running SignUpTest in the 
LoginTest. How do I achieve that? Please help.

-- 
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/a3625070-4f46-4c68-b912-888b91e42c82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


passing list of objects as manytomany field type in django

2016-01-06 Thread Akash Tomar


I want to know if we can pass a list of objects (in this case list of blog 
objects to the Entry model as the manytomany object parameter). On doing so 
i am not getting the desired result. Please help.

models.py

class Blog(models.Model):
id=models.AutoField(primary_key=True)
class Entry(models.Model):
id=models.AutoField(primary_key=True)
blogs=models.ManyToManyField(Blog)

views.py

def something(request):
list=[]
for i in range(10):
list.append(Blog.objects.get(pk=i))
ans=Entry.objects.filter(blogs=list)
print(ans)
#some other work.

-- 
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/87b878aa-da70-454f-98fb-035d1222c266%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Input using barcode scanner

2015-12-04 Thread Akash Tomar
I want to take input in my html page using the barcode scanner. How do i do 
this in django???..do i need some additional module or package to do 
so?..or django itself is strong enough to do that...please help me with a 
sample code for implementing 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/76cff047-6ee8-4ce6-87f2-0ee54f9ce8f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No exception supplied error while resizing image by using blobproperty

2015-05-19 Thread akash . patni
Hi guys,
I am resizing image using blobproperty but it s giving BadImageError with 
no exception supllied.

Here is my code for resizing:

*bg_image = request.FILES['bg_image'].read(*)

*obj_partner.bg_image = db.Blob(images.resize(bg_image,1400,758)) // 
error line*

and i am uploading image which is less then 1Mb and whose resolution is 
(1400 x 762)

and the field i am taking is Filefield.

Please reply...

-- 
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/4a2a1c33-3501-4d9f-8f4f-a821fa0f7f56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TIMEZONE

2015-04-08 Thread akash . patni
Hi to all ,

Previously my settings.py file was having time zone as

TIME_ZONE = 'America/Chicago'

now i have changed to 
TIME_ZONE = 'Europe/London'

that not getting reflected means date and time are getting stored in 
database as of previous timezone...


Please suggest.

-- 
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/2f325769-40db-480d-afbc-336dc948878e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Textarea taking htnml tags

2015-03-30 Thread Akash Patni
hi
for removing html tags i have used the following function but it is not
working...Please suggest

class NotesForm(forms.Form):
''' Notes '''
note_title=forms.CharField(label="Note Title *:",max_length=100)
note=forms.CharField(widget=forms.Textarea,label="Note:",required=False)
def clean(self):
from django.utils.html import strip_tags
cleaned_data = super(NotesForm, self).clean()
cleaned_data['note'] = strip_tags(cleaned_data.get('note'))
return cleaned_data

and this is my html

 

  {% for field in form %}
  {%if field.name == 'note' %}
  
  {{ field.label_tag }}
  {{ field}}
  
  {% else %}
  
  {{ field.label_tag }}{{ field }}
{% for error in field.errors %}
{{ error }}
{% endfor %}

{% endif %}
{% endfor %}


I had also used striptag filter and this is also not working...

On Mon, Mar 30, 2015 at 9:11 AM, Akash Patni <akash.pa...@ranosys.com>
wrote:

> *Hi,*
> *This my template*
> {% block content %}
>
> 
>
>   
>  src="/site_media/images/digital-assets-note-icon.png" alt="Notes" />
> View Notes
> See your notes details.
>   
>   
>
> {% for i in result %}
> 
> Note Title
> {{i.note_title}}
> 
> 
> 
> Note
>  *{{i.note}}*
>
> 
> 
>
> 
> Beneficiaries
> 
> {% if all_nominees %}
> {% for nominee in all_nominees %}
> {% if nominee.1 %}
> {{nominee.0.first_name}} {% if nominee.last_name
> %}{{nominee.last_name}}{% endif %} {% if nominee.0.is_charity %}(charity){%
> else %}(individual){% endif %}
> 
> {% endif %}
> {% endfor %}
> {% else %}
> No beneficiaries at the moment.
> {% endif %}
> 
> 
> 
>
> 
> Action
> 
>  href="/user/notes/edit?id={{i.key}}">Edit
>  href="/user/notes/delete?id={{i.key}}" onclick="return
> deleteConfirmation();">Delete
> 
> 
> 
>   {% endfor %}
>
> {% endblock %}
>
>
> On Fri, Mar 27, 2015 at 11:30 PM, aRkadeFR <cont...@arkade.info> wrote:
>
>>  Hey,
>>
>> He doubled post. A thread already exists about this called:
>> "textarea showing image instead of code"
>>
>>
>>
>> On 03/27/2015 03:54 PM, Filipe Ximenes wrote:
>>
>> Can you send us the code of the view and the template of this form?
>>
>> On Fri, Mar 27, 2015 at 3:27 AM, <akash.pa...@ranosys.com> wrote:
>>
>>> Hie to all,
>>> In one of my template i am using text area. The issue is that when i
>>> write html tags with some image link using img tag, when i am saving this i
>>> am getting image on the desription field.
>>>
>>> Actual-Image is comming
>>>
>>> Expected-I want HTML code to be displayed in the discription.
>>>
>>> Please suggest
>>>  --
>>> 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/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>>  --
>>
>>
>> *Filipe Ximenes *+55 (81) 8245-9204
>>
>> *Vinta Software Studio *http://www.vinta.com.br
>>   --
>> 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/CAA-QWB3OPdmK11XzPFf--2MBT6evTDu-RuRrPArem1PbZT2FmA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA-QWB3OPdmK11XzPFf--2MBT6evTDu-RuRrPArem1PbZT2FmA%40mail.gmail.com?utm_

Re: Textarea taking htnml tags

2015-03-29 Thread Akash Patni
*Hi,*
*This my template*
{% block content %}



  

View Notes
See your notes details.
  
  

{% for i in result %}

Note Title
{{i.note_title}}



Note
 *{{i.note}}*





Beneficiaries

{% if all_nominees %}
{% for nominee in all_nominees %}
{% if nominee.1 %}
{{nominee.0.first_name}} {% if nominee.last_name
%}{{nominee.last_name}}{% endif %} {% if nominee.0.is_charity %}(charity){%
else %}(individual){% endif %}

{% endif %}
{% endfor %}
{% else %}
No beneficiaries at the moment.
{% endif %}





Action

Edit
Delete



  {% endfor %}

{% endblock %}


On Fri, Mar 27, 2015 at 11:30 PM, aRkadeFR <cont...@arkade.info> wrote:

>  Hey,
>
> He doubled post. A thread already exists about this called:
> "textarea showing image instead of code"
>
>
>
> On 03/27/2015 03:54 PM, Filipe Ximenes wrote:
>
> Can you send us the code of the view and the template of this form?
>
> On Fri, Mar 27, 2015 at 3:27 AM, <akash.pa...@ranosys.com> wrote:
>
>> Hie to all,
>> In one of my template i am using text area. The issue is that when i
>> write html tags with some image link using img tag, when i am saving this i
>> am getting image on the desription field.
>>
>> Actual-Image is comming
>>
>> Expected-I want HTML code to be displayed in the discription.
>>
>> Please suggest
>>  --
>> 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/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>  --
>
>
> *Filipe Ximenes *+55 (81) 8245-9204
>
> *Vinta Software Studio *http://www.vinta.com.br
>   --
> 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/CAA-QWB3OPdmK11XzPFf--2MBT6evTDu-RuRrPArem1PbZT2FmA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA-QWB3OPdmK11XzPFf--2MBT6evTDu-RuRrPArem1PbZT2FmA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/cpx4qG6daPU/unsubscribe.
> To unsubscribe from this group and all its topics, 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/55159AA1.9070605%40arkade.info
> <https://groups.google.com/d/msgid/django-users/55159AA1.9070605%40arkade.info?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Best Regards,*
Akash Patni
Software Engineer




*[image: ranosys] <http://ranosys.com/>  [image: facebook]
<https://www.facebook.com/ranosys>[image: twitter]
<https://twitter.com/ranosys>[image: linkedin]
<https://www.linkedin.com/company/741079?trk=prof-exp-company-name>[image:
googleplus] <https://plus.google.com/+Ranosys> Head Office: Oxley Bizhub,
#06-48 | 73 Ubi Road 1 | Singapore - 408733Tel: +65 66331556  |  HP: +65
98573420Global Offices:San Francisco, USA | Jaipur, India | Bikaner, India*

-- 
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/CANSMZiQo%3DM0RaBbawUNrsvO%2BLZpTQD%3DHtXCZsJDjnUE8zCFjRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: textarea showing image instead of code

2015-03-27 Thread Akash Patni
Hi This is my html

{% block content %}



  

View Notes
See your notes details.
  
  

{% for i in result %}

Note Title
{{i.note_title}}



Note
*{{i.note}*





Beneficiaries

{% if all_nominees %}
{% for nominee in all_nominees %}
{% if nominee.1 %}
{{nominee.0.first_name}} {% if nominee.last_name
%}{{nominee.last_name}}{% endif %} {% if nominee.0.is_charity %}(charity){%
else %}(individual){% endif %}

{% endif %}
{% endfor %}
{% else %}
No beneficiaries at the moment.
{% endif %}





Action

Edit
Delete



  {% endfor %}

{% endblock %}

This is my model

class AssetNotes(db.Model):
user_id = db.ReferenceProperty(User)
written_on = db.DateProperty(verbose_name="Note Date")
note_title = db.StringProperty(verbose_name = "Note Title *")
note = db.TextProperty(verbose_name = "Note")
add_date = db.DateTimeProperty(verbose_name=None, auto_now_add=True)
update_date = db.DateTimeProperty(verbose_name=None, auto_now=True)
client_id = db.StringProperty(verbose_name = "Client ID", default="")
def __unicode__(self):
return self.note_title
I want to show only code but instead of that it is showing image in
descrption field.

and the code contains image url.

On Fri, Mar 27, 2015 at 2:41 PM, aRkadeFR <cont...@arkade.info> wrote:

>  Hello,
>
> You could provide us more information when asking for
> help please. Your template and view code at least.
>
> I guess your problem is in your HTML but to be sure, please
> dump your information at the POST request to see what
> is send. Then review your template. Maybe there's a "name"
> attribute on the img tag?
>
> Have a good one
>
> On 03/27/2015 08:36 AM, akash.pa...@ranosys.com wrote:
>
> Hie to all,
> In one of my template i am using text area. The issue is that when i write
> html tags with some image link using img tag, when i am saving this i am
> getting image on the desription field.
>
> Actual-Image is comming
>
> Expected-I want HTML code to be displayed in the discription.
>
> Please suggest
>
>  --
> 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/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/6bheSzmXFGc/unsubscribe.
> To unsubscribe from this group and all its topics, 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/55151EC7.3090403%40arkade.info
> <https://groups.google.com/d/msgid/django-users/55151EC7.3090403%40arkade.info?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Best Regards,*
Akash Patni
Software Engineer




*[image: ranosys] <http://ranosys.com/>  [image: facebook]
<https://www.facebook.com/ranosys>[image: twitter]
<https://twitter.com/ranosys>[image: linkedin]
<https://www.linkedin.com/company/741079?trk=prof-exp-company-name>[image:
googleplus] <https://plus.google.com/+Ranosys> Head Office: Oxley Bizhub,
#06-48 | 73 Ubi Road 1 | Singapore - 408733Tel: +65 66331556  |  HP: +65
98573420Global Offices:San Francisco, USA | Jaipur, India | Bikaner, India*

-- 
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/CANSMZiRzDaCqCJG-QF-t6Bk6ckKsk4fgZFcTq%3DbgVYNPVrHiMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


textarea showing image instead of code

2015-03-27 Thread akash . patni
Hie to all,
In one of my template i am using text area. The issue is that when i write 
html tags with some image link using img tag, when i am saving this i am 
getting image on the desription field.

Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest

-- 
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/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Textarea taking htnml tags

2015-03-27 Thread akash . patni
Hie to all,
In one of my template i am using text area. The issue is that when i write 
html tags with some image link using img tag, when i am saving this i am 
getting image on the desription field.

Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest

-- 
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/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image resizing

2015-03-26 Thread Akash Patni
*Hi,*
*Resizing is now working properly but the issue is that it is giving key
error.*
*it is taking all files for eg(images.bmp,xx.jpeg) but is giving error when
i am tryint to upload the file  (luzern-bridge-8q4_small.jpg) In short it
is giving error for jpg format. Please suggest*


def edit_profile(request):
# data = Thumbnail.objects.get(pk=id)
if 'username' in request.session:
#user_id=request.POST.get('id')
user_id=request.GET.get('id')
usr_obj=User.objects.get(id=int(user_id))
if request.method=="POST":


regform=Edit_Registration(instance=usr_obj,data=request.POST)

if regform.is_valid():
 image_file =
StringIO.StringIO(request.FILES['image'].read())

 imagename=request.FILES['image'].name

 ext = imagename.split('.')[-1]

 image = Image.open(image_file)

 imageresize = image.resize((100,100), Image.ANTIALIAS)

 filename =
hashlib.md5(image_file.getvalue()).hexdigest()+'.'+ext

*
imageresize.save("/home/ranosys-akash/workspace/mysite/src/media/"+filename,
ext, quality=75)*
* error at above line(key error...*u'JPG'*)*

 usr_obj.image=filename

 regform.save();
 return HttpResponseRedirect('/index/')
else:
 regform=Edit_Registration(instance=usr_obj)
 return
render_to_response("edit_profile.html",{"form":regform,})
else:
#user_id=request.GET.get('id')
#usr_obj=User.objects.get(id=int(user_id))

 
#temp_data={'first_name':user_id.first_name,'last_name':user_id.last_name,'email':user_id.email,'password':user_id.password,'dob':user_id.dob,'mobileno':user_id.mobileno,'houseno':user_id.houseno,'address1':user_id.address1,'city':user_id.city,'state':user_id.state,'pincode':user_id.pincode,'country':user_id.country,'comment':user_id.comment,'sex':user_id.sex}
regform=Edit_Registration(instance=usr_obj)
return
render_to_response("edit_profile.html",{"form":regform,"user_id":user_id})
else:
return HttpResponseRedirect('/login/')



On Thu, Mar 26, 2015 at 9:37 AM, Akash Patni <akash.pa...@ranosys.com>
wrote:

> if regform.is_valid():
>
> image_file =
> StringIO.StringIO(request.FILES['image'].read())
> image = Image.open(image_file)
>
> imageresize = image.resize((100,100), Image.ANTIALIAS)
> *imageresize.save( 'abc.JPEG', quality=75)*
> regform.save();
> return HttpResponseRedirect('/index/')
> else:
> regform=Edit_Registration(instance=usr_obj)
> return
> render_to_response("edit_profile.html",{"form":regform,})
> else:
> #user_id=request.GET.get('id')
> #usr_obj=User.objects.get(id=int(user_id))
>
>  
> #temp_data={'first_name':user_id.first_name,'last_name':user_id.last_name,'email':user_id.email,'password':user_id.password,'dob':user_id.dob,'mobileno':user_id.mobileno,'houseno':user_id.houseno,'address1':user_id.address1,'city':user_id.city,'state':user_id.state,'pincode':user_id.pincode,'country':user_id.country,'comment':user_id.comment,'sex':user_id.sex}
> regform=Edit_Registration(instance=usr_obj)
> return
> render_to_response("edit_profile.html",{"form":regform,"user_id":user_id})
> else:
> return HttpResponseRedirect('/login/')
>
> Hey ,
> I am using the above method and able to resize the image but it is only
> taking JPEG format and i want other format also. Can u please suggest
> *imageresize.save( 'abc.JPEG', quality=75) it can take three
> parameters..name, format and quality*
>
> On Wed, Mar 25, 2015 at 1:29 PM, Andreas Kuhne <andreas.ku...@suitopia.com
> > wrote:
>
>> Hi,
>>
>> Again, you should really put this in your database model instead of in
>> the view. If you use your overriden save function, you would be able to add
>> this there. Also, you check if the image is not an L or RGB image (don't
>> know what L is) and resize it ONLY if it is on of them.
>>
>> Regards,
>>
>> Andréas
>>
>> 2015-03-25 8:26 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>>
>>> For image resizing i have used the following function*(in bold).*Is it
>>> right??
>>>
>>> def edit_profile(request):
>>>
>>> if 'username' in request.session:
>>> #user_id=req

Re: Image resizing

2015-03-25 Thread Akash Patni
if regform.is_valid():

image_file =
StringIO.StringIO(request.FILES['image'].read())
image = Image.open(image_file)

imageresize = image.resize((100,100), Image.ANTIALIAS)
*imageresize.save( 'abc.JPEG', quality=75)*
regform.save();
return HttpResponseRedirect('/index/')
else:
regform=Edit_Registration(instance=usr_obj)
return
render_to_response("edit_profile.html",{"form":regform,})
else:
#user_id=request.GET.get('id')
#usr_obj=User.objects.get(id=int(user_id))

 
#temp_data={'first_name':user_id.first_name,'last_name':user_id.last_name,'email':user_id.email,'password':user_id.password,'dob':user_id.dob,'mobileno':user_id.mobileno,'houseno':user_id.houseno,'address1':user_id.address1,'city':user_id.city,'state':user_id.state,'pincode':user_id.pincode,'country':user_id.country,'comment':user_id.comment,'sex':user_id.sex}
regform=Edit_Registration(instance=usr_obj)
return
render_to_response("edit_profile.html",{"form":regform,"user_id":user_id})
else:
return HttpResponseRedirect('/login/')

Hey ,
I am using the above method and able to resize the image but it is only
taking JPEG format and i want other format also. Can u please suggest
*imageresize.save( 'abc.JPEG', quality=75) it can take three
parameters..name, format and quality*

On Wed, Mar 25, 2015 at 1:29 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> Hi,
>
> Again, you should really put this in your database model instead of in the
> view. If you use your overriden save function, you would be able to add
> this there. Also, you check if the image is not an L or RGB image (don't
> know what L is) and resize it ONLY if it is on of them.
>
> Regards,
>
> Andréas
>
> 2015-03-25 8:26 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>
>> For image resizing i have used the following function*(in bold).*Is it
>> right??
>>
>> def edit_profile(request):
>>
>> if 'username' in request.session:
>> #user_id=request.POST.get('id')
>> user_id=request.GET.get('id')
>> usr_obj=User.objects.get(id=int(user_id))
>> if request.method=="POST":
>> if(request.POST['houseno']!=''):
>>   houseno=request.POST['houseno']
>> else:
>>   houseno=None
>> if(request.POST['address1']!=''):
>>   address1=request.POST['address1']
>> else:
>>   address1=None
>> if(request.POST['city']!=''):
>>   city=request.POST['city']
>> else:
>>   city=None
>> if(request.POST['state']!=''):
>>   state=request.POST['state']
>> else:
>>   state=None
>> if(request.POST['pincode']!=''):
>>   pincode=request.POST['pincode']
>> else:
>>   pincode=None
>> if(request.POST['country']!=''):
>>   country=request.POST['country']
>> else:
>>   country=None
>> if(request.POST['comment']!=''):
>>   comment=request.POST['comment']
>> else:
>>   comment=None
>>
>> regform=Edit_Registration(instance=usr_obj,data=request.POST)
>>
>> if regform.is_valid():
>>   *  try:*
>> *from PIL import Image, ImageOps*
>> *except ImportError:*
>> *import Image*
>> *import ImageOps*
>> *imagecontent=request.FILES['image']---At this point
>> it is giving MultiValueDicitionayKeyError(though the field name is same
>> that is image)*
>> *if imagecontent.mode not in ("L", "RGB"):*
>> *image = imagecontent.convert("RGB")*
>> *imageresize = image.resize((100,100),
>> Image.ANTIALIAS) *
>> *imageresize.save( 'JPEG', quality=75)*
>> *regform.save();*
>> return HttpResponseRedirect('/index/')
>> else:
>> 

Re: image handling

2015-03-25 Thread Akash Patni
Hi..
ok will not give storage parameter, but how the function save will
called.Will it be called automatically when i edit image.

I have used upload function to call a function which change the name of the
image and save it to the database.

On Wed, Mar 25, 2015 at 1:44 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> Hi,
>
> No, that is not correct. The storage parameter has nothing to do with
> this. Also, why are you not using an ImageField instead of the FileField?
> Also you have to put all methods with "self" as a parameter with the class
> itself. Self is a pointer to the instance of the class, so it needs to be
> within the class.
>
> You should do it this way:
>
> class User:
> image = models.ImageField(verbose_name="Image (limit 1Mb) *",
> blank=True, upload_to='var/user/images')
>
> def save(self, *args, **kwargs):
> try:
> original_image = User.objects.get(id=self.id)
> if original_image.image != self.image:
> original_image.image.delete()
> except:
> pass
> super(User, self).save(*args, **kwargs)
>
> Of course the other parts of the user object needs to be added as well. As
> you can see, I have also set a path for upload_to instead of a function,
> because using a function is only necessary when you want to set a unique
> path for each image (for example using the id for it).
>
> Regards,
>
> Andréas
>
> 2015-03-25 5:26 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>
>> Hi,
>> Can i use this method in my model.py
>>
>> def save(self, *args, **kwargs):
>> try:
>> this = MyModelName.objects.get(id=self.id)
>> if this.MyImageFieldName != self.MyImageFieldName:
>> this.MyImageFieldName.delete()
>> except: pass
>> super(MyModelName, self).save(*args, **kwargs)
>>
>>
>> class User(models.Model):
>>
>>   image=models.FileField(verbose_name = "Image(limit 1Mb) 
>> *",blank=True,upload_to=path_and_rename('')*,storage=save('self')*)
>>
>>   def __unicode__(self):
>> return self.first_name
>> i have doubt about storage in my file field which i have highlighted. Is 
>> it right, Please sugges.
>>
>>
>>
>> On Wed, Mar 25, 2015 at 9:28 AM, Akash Patni <akash.pa...@ranosys.com>
>> wrote:
>>
>>> Hi,
>>> I have added the code to my  __init__.py file but still its not working.
>>>
>>> __init__.py
>>> from django.core.files.storage import default_storage as storage
>>> from django.db.models.signals import pre_save
>>> from django.db import models
>>> import django.forms as forms
>>> from django.contrib.auth.models import User
>>>
>>> def image_delete(sender, instance, *args, **kwargs):
>>>   if instance.pk:
>>> old_instance = User.objects.get(pk=instance.pk)
>>>
>>> if old_instance.image != instance.image and instance.image:
>>>   storage.delete(old_instance.image.name)
>>>   pre_save.connect(image_delete, sender=User)
>>>
>>> model.py
>>>
>>> class User(models.Model):
>>> first_name=models.CharField(verbose_name = "First Name
>>> *",max_length=20,blank=False)
>>> last_name=models.CharField(verbose_name = "Last Name
>>> *",max_length=20,blank=False)
>>> username=models.EmailField(verbose_name = "Email
>>> *",max_length=30,blank=False)
>>> password=models.CharField(verbose_name = "Password
>>> *",max_length=15,blank=False)
>>> dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
>>> mobileno=models.CharField(verbose_name = "Mobile No
>>> *",max_length=20,blank=False)
>>> houseno=models.CharField(verbose_name = "House
>>> No",max_length=10,blank=True)
>>> address1=models.CharField(verbose_name =
>>> "Adress1",max_length=30,blank=True)
>>> city=models.CharField(verbose_name = "City",max_length=20,blank=True)
>>> state=models.CharField(verbose_name =
>>> "State",max_length=30,blank=True)
>>> pincode=models.CharField(verbose_name =
>>> "Pincode",max_length=20,blank=True)
>>> country=models.CharField(verbose_name =
>>> "Country",max_length=30,blank=True)
>>> comment=models.CharField(verbose_name =
>>> "Comment",max_length=200,blank=True)
>>>

Re: Image resizing

2015-03-25 Thread Akash Patni
For image resizing i have used the following function*(in bold).*Is it
right??

def edit_profile(request):

if 'username' in request.session:
#user_id=request.POST.get('id')
user_id=request.GET.get('id')
usr_obj=User.objects.get(id=int(user_id))
if request.method=="POST":
if(request.POST['houseno']!=''):
  houseno=request.POST['houseno']
else:
  houseno=None
if(request.POST['address1']!=''):
  address1=request.POST['address1']
else:
  address1=None
if(request.POST['city']!=''):
  city=request.POST['city']
else:
  city=None
if(request.POST['state']!=''):
  state=request.POST['state']
else:
  state=None
if(request.POST['pincode']!=''):
  pincode=request.POST['pincode']
else:
  pincode=None
if(request.POST['country']!=''):
  country=request.POST['country']
else:
  country=None
if(request.POST['comment']!=''):
  comment=request.POST['comment']
else:
  comment=None

regform=Edit_Registration(instance=usr_obj,data=request.POST)

if regform.is_valid():
  *  try:*
*from PIL import Image, ImageOps*
*except ImportError:*
*import Image*
*import ImageOps*
*imagecontent=request.FILES['image']---At this point it
is giving MultiValueDicitionayKeyError(though the field name is same that
is image)*
*if imagecontent.mode not in ("L", "RGB"):*
*image = imagecontent.convert("RGB")*
*imageresize = image.resize((100,100),
Image.ANTIALIAS) *
*imageresize.save( 'JPEG', quality=75)*
*regform.save();*
return HttpResponseRedirect('/index/')
else:
return
render_to_response("edit_profile.html",{"form":regform,})
else:


regform=Edit_Registration(instance=usr_obj)
return
render_to_response("edit_profile.html",{"form":regform,"user_id":user_id})
else:
return HttpResponseRedirect('/login/')

Please Suggest..

On Tue, Mar 24, 2015 at 6:41 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> You can use Pillow to change the size of the images yourself. That is
> however pretty complicated and IMO not really worth the effort. I would go
> with easy_thumbnails.
>
> Regards,
>
> Andréas
>
> 2015-03-24 14:04 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>
>> can you please suggest me another answer...
>>
>> On Tue, Mar 24, 2015 at 6:13 PM, Andreas Kuhne <
>> andreas.ku...@suitopia.com> wrote:
>>
>>> Hi,
>>>
>>> Check out the easy_thumbnails plugin.
>>> http://easy-thumbnails.readthedocs.org/en/2.1/
>>>
>>> It automatically resizes all images to the size you want if you use it
>>> correctly.
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>> 2015-03-24 11:07 GMT+01:00 <akash.pa...@ranosys.com>:
>>>
>>>> Hi..
>>>> can anyone please tell me how to resize the uploaded image
>>>> This is my model
>>>> class User(models.Model):
>>>> first_name=models.CharField(
>>>> verbose_name = "First Name *",max_length=20,blank=False)
>>>> last_name=models.CharField(verbose_name = "Last Name
>>>> *",max_length=20,blank=False)
>>>> username=models.EmailField(verbose_name = "Email
>>>> *",max_length=30,blank=False)
>>>> password=models.CharField(verbose_name = "Password
>>>> *",max_length=15,blank=False)
>>>> dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
>>>> mobileno=models.CharField(verbose_name = "Mobile No
>>>> *",max_length=20,blank=False)
>>>> houseno=models.CharField(verbose_name = "House
>>>> No",max_length=10,blank=True)
>>>> address1=models.CharField(verbose_name =
>>>> "Adress1",max_length=30,blank=True)
>>>> city=models.CharFiel

Re: image handling

2015-03-24 Thread Akash Patni
Hi,
Can i use this method in my model.py

def save(self, *args, **kwargs):
try:
this = MyModelName.objects.get(id=self.id)
if this.MyImageFieldName != self.MyImageFieldName:
this.MyImageFieldName.delete()
except: pass
super(MyModelName, self).save(*args, **kwargs)


class User(models.Model):

  image=models.FileField(verbose_name = "Image(limit 1Mb)
*",blank=True,upload_to=path_and_rename('')*,storage=save('self')*)

  def __unicode__(self):
return self.first_name
i have doubt about storage in my file field which i have
highlighted. Is it right, Please sugges.



On Wed, Mar 25, 2015 at 9:28 AM, Akash Patni <akash.pa...@ranosys.com>
wrote:

> Hi,
> I have added the code to my  __init__.py file but still its not working.
>
> __init__.py
> from django.core.files.storage import default_storage as storage
> from django.db.models.signals import pre_save
> from django.db import models
> import django.forms as forms
> from django.contrib.auth.models import User
>
> def image_delete(sender, instance, *args, **kwargs):
>   if instance.pk:
> old_instance = User.objects.get(pk=instance.pk)
>
> if old_instance.image != instance.image and instance.image:
>   storage.delete(old_instance.image.name)
>   pre_save.connect(image_delete, sender=User)
>
> model.py
>
> class User(models.Model):
> first_name=models.CharField(verbose_name = "First Name
> *",max_length=20,blank=False)
> last_name=models.CharField(verbose_name = "Last Name
> *",max_length=20,blank=False)
> username=models.EmailField(verbose_name = "Email
> *",max_length=30,blank=False)
> password=models.CharField(verbose_name = "Password
> *",max_length=15,blank=False)
> dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
> mobileno=models.CharField(verbose_name = "Mobile No
> *",max_length=20,blank=False)
> houseno=models.CharField(verbose_name = "House
> No",max_length=10,blank=True)
> address1=models.CharField(verbose_name =
> "Adress1",max_length=30,blank=True)
> city=models.CharField(verbose_name = "City",max_length=20,blank=True)
> state=models.CharField(verbose_name = "State",max_length=30,blank=True)
> pincode=models.CharField(verbose_name =
> "Pincode",max_length=20,blank=True)
> country=models.CharField(verbose_name =
> "Country",max_length=30,blank=True)
> comment=models.CharField(verbose_name =
> "Comment",max_length=200,blank=True)
> sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False)
> image=models.FileField(verbose_name = "Image(limit 1Mb)
> *",blank=True,upload_to=path_and_rename(''))
>
> def __unicode__(self):
> return self.first_name
>
>
> On Tue, Mar 24, 2015 at 7:44 PM, Andreas Kuhne <andreas.ku...@suitopia.com
> > wrote:
>
>> First, make sure that the whitespace is the same in all of your methods
>> (in python whitespace is significant, which means that you should indent
>> all files the same amount, I wrote my example in my email, so I only
>> indented twice, you seem to have 4 blankspaces in your file, so make sure
>> the indentation is the same).
>>
>> Secondly, I think that you should add the code I sent to the __init__.py
>> file in the project itself (in the same directory that you have you
>> models.py). That way it will be run during startup (which needs to be done).
>>
>> Regards,
>>
>> Andréas
>>
>> 2015-03-24 14:20 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>>
>>> i had made the changes in model .py but its not working
>>>
>>> here is model.py
>>>
>>>
>>> from django.db import models
>>> import django.forms as forms
>>> from virtualenv import REQUIRED_FILES
>>> from _mysql import NULL
>>> from datetime import datetime, date, time, timedelta
>>> import time
>>> import calendar
>>> from django.contrib.auth.models import User
>>> import os
>>> from uuid import uuid4
>>> from django.core.files.storage import default_storage as storage
>>> from django.db.models.signals import pre_save
>>>
>>>
>>> def path_and_rename(path):
>>> def wrapper(instance, filename):
>>> ext = filename.split('.')[-1]
>>> # get filename
>>> if instance.pk:
>>> filename = '{}.{}'.format(instance.pk, ext)
>>> else:
>>> # set filename as rando

Re: image handling

2015-03-24 Thread Akash Patni
Hi,
I have added the code to my  __init__.py file but still its not working.

__init__.py
from django.core.files.storage import default_storage as storage
from django.db.models.signals import pre_save
from django.db import models
import django.forms as forms
from django.contrib.auth.models import User

def image_delete(sender, instance, *args, **kwargs):
  if instance.pk:
old_instance = User.objects.get(pk=instance.pk)

if old_instance.image != instance.image and instance.image:
  storage.delete(old_instance.image.name)
  pre_save.connect(image_delete, sender=User)

model.py

class User(models.Model):
first_name=models.CharField(verbose_name = "First Name
*",max_length=20,blank=False)
last_name=models.CharField(verbose_name = "Last Name
*",max_length=20,blank=False)
username=models.EmailField(verbose_name = "Email
*",max_length=30,blank=False)
password=models.CharField(verbose_name = "Password
*",max_length=15,blank=False)
dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
mobileno=models.CharField(verbose_name = "Mobile No
*",max_length=20,blank=False)
houseno=models.CharField(verbose_name = "House
No",max_length=10,blank=True)
address1=models.CharField(verbose_name =
"Adress1",max_length=30,blank=True)
city=models.CharField(verbose_name = "City",max_length=20,blank=True)
state=models.CharField(verbose_name = "State",max_length=30,blank=True)
pincode=models.CharField(verbose_name =
"Pincode",max_length=20,blank=True)
country=models.CharField(verbose_name =
"Country",max_length=30,blank=True)
comment=models.CharField(verbose_name =
"Comment",max_length=200,blank=True)
sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False)
image=models.FileField(verbose_name = "Image(limit 1Mb)
*",blank=True,upload_to=path_and_rename(''))

def __unicode__(self):
return self.first_name


On Tue, Mar 24, 2015 at 7:44 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> First, make sure that the whitespace is the same in all of your methods
> (in python whitespace is significant, which means that you should indent
> all files the same amount, I wrote my example in my email, so I only
> indented twice, you seem to have 4 blankspaces in your file, so make sure
> the indentation is the same).
>
> Secondly, I think that you should add the code I sent to the __init__.py
> file in the project itself (in the same directory that you have you
> models.py). That way it will be run during startup (which needs to be done).
>
> Regards,
>
> Andréas
>
> 2015-03-24 14:20 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>
>> i had made the changes in model .py but its not working
>>
>> here is model.py
>>
>>
>> from django.db import models
>> import django.forms as forms
>> from virtualenv import REQUIRED_FILES
>> from _mysql import NULL
>> from datetime import datetime, date, time, timedelta
>> import time
>> import calendar
>> from django.contrib.auth.models import User
>> import os
>> from uuid import uuid4
>> from django.core.files.storage import default_storage as storage
>> from django.db.models.signals import pre_save
>>
>>
>> def path_and_rename(path):
>> def wrapper(instance, filename):
>> ext = filename.split('.')[-1]
>> # get filename
>> if instance.pk:
>> filename = '{}.{}'.format(instance.pk, ext)
>> else:
>> # set filename as random string
>> filename = '{}.{}'.format(uuid4().hex, ext)
>> # return the whole path to the file
>> return os.path.join(path, filename)
>> return wrapper
>>
>> def image_delete(sender, instance, *args, **kwargs):
>>   if instance.pk:
>> old_instance = User.objects.get(pk=instance.pk)
>>
>> if old_instance.image != instance.image and instance.image:
>>   storage.delete(old_instance.image.name)
>>
>> pre_save.connect(image_delete, sender=User)
>>
>> class Publisher(models.Model):
>> name = models.CharField(max_length=30)
>> address = models.CharField(max_length=50)
>> city = models.CharField(max_length=60)
>> state_province = models.CharField(max_length=30)
>> country = models.CharField(max_length=50)
>> website = models.URLField()
>>
>> def __unicode__(self):
>> return self.name
>>
>> class Author(models.Model):
>> first_name = models.CharField(max_length=30)
>> last_name = models.CharField(max_length=40)

Re: image handling

2015-03-24 Thread Akash Patni
i had made the changes in model .py but its not working

here is model.py


from django.db import models
import django.forms as forms
from virtualenv import REQUIRED_FILES
from _mysql import NULL
from datetime import datetime, date, time, timedelta
import time
import calendar
from django.contrib.auth.models import User
import os
from uuid import uuid4
from django.core.files.storage import default_storage as storage
from django.db.models.signals import pre_save


def path_and_rename(path):
def wrapper(instance, filename):
ext = filename.split('.')[-1]
# get filename
if instance.pk:
filename = '{}.{}'.format(instance.pk, ext)
else:
# set filename as random string
filename = '{}.{}'.format(uuid4().hex, ext)
# return the whole path to the file
return os.path.join(path, filename)
return wrapper

def image_delete(sender, instance, *args, **kwargs):
  if instance.pk:
old_instance = User.objects.get(pk=instance.pk)

if old_instance.image != instance.image and instance.image:
  storage.delete(old_instance.image.name)

pre_save.connect(image_delete, sender=User)

class Publisher(models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_length=50)
city = models.CharField(max_length=60)
state_province = models.CharField(max_length=30)
country = models.CharField(max_length=50)
website = models.URLField()

def __unicode__(self):
return self.name

class Author(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=40)
email = models.EmailField()

def __unicode__(self):
return u'%s %s' % (self.first_name, self.last_name)

class Book(models.Model):
title = models.CharField(max_length=100)
authors = models.ManyToManyField(Author)
publisher = models.ForeignKey(Publisher)
publication_date = models.DateField()

def __unicode__(self):
return self.title

class User(models.Model):
first_name=models.CharField(verbose_name = "First Name
*",max_length=20,blank=False)
last_name=models.CharField(verbose_name = "Last Name
*",max_length=20,blank=False)
username=models.EmailField(verbose_name = "Email
*",max_length=30,blank=False)
password=models.CharField(verbose_name = "Password
*",max_length=15,blank=False)
dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
mobileno=models.CharField(verbose_name = "Mobile No
*",max_length=20,blank=False)
houseno=models.CharField(verbose_name = "House
No",max_length=10,blank=True)
address1=models.CharField(verbose_name =
"Adress1",max_length=30,blank=True)
city=models.CharField(verbose_name = "City",max_length=20,blank=True)
state=models.CharField(verbose_name = "State",max_length=30,blank=True)
pincode=models.CharField(verbose_name =
"Pincode",max_length=20,blank=True)
country=models.CharField(verbose_name =
"Country",max_length=30,blank=True)
comment=models.CharField(verbose_name =
"Comment",max_length=200,blank=True)
sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False)
image=models.FileField(verbose_name = "Image(limit 1Mb)
*",blank=True,upload_to=path_and_rename(''))

def __unicode__(self):
return self.first_name




On Tue, Mar 24, 2015 at 6:47 PM, Akash Patni <akash.pa...@ranosys.com>
wrote:

> is there any other changes that i have to made in model like how this
> above mentioned function will be call.
>
> Please suggest
>
> On Tue, Mar 24, 2015 at 6:43 PM, Andreas Kuhne <andreas.ku...@suitopia.com
> > wrote:
>
>> Hi,
>>
>> You shouldn't do it in the view, do it in the database model instead. It
>> won't do anything to any other fields than the image field the way I wrote
>> the function (all other fields are untouched).
>>
>> The reason you shouldn't do it in the view, is because if you were to
>> update the image any other place than via the view, the code wouldn't run.
>> It's more sensible and more DRY to do it in the model.
>>
>> Regards,
>>
>> Andréas
>>
>> 2015-03-24 14:10 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>>
>>> Hey,
>>> I am new to django. I have other feilds also other than image field in
>>> my form, so will you please tell me how to use above mentioned function in
>>> edit_profile function in view, Can i call another function from another
>>> function in views.py, if yes please tell me
>>>
>>> On Tue, Mar 24, 2015 at 6:11 PM, Andreas Kuhne <
>>> andreas.ku...@suitopia.com> wrote:
>>>
>>>> Hi,
>>>>
>&g

Re: image handling

2015-03-24 Thread Akash Patni
is there any other changes that i have to made in model like how this above
mentioned function will be call.

Please suggest

On Tue, Mar 24, 2015 at 6:43 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> Hi,
>
> You shouldn't do it in the view, do it in the database model instead. It
> won't do anything to any other fields than the image field the way I wrote
> the function (all other fields are untouched).
>
> The reason you shouldn't do it in the view, is because if you were to
> update the image any other place than via the view, the code wouldn't run.
> It's more sensible and more DRY to do it in the model.
>
> Regards,
>
> Andréas
>
> 2015-03-24 14:10 GMT+01:00 Akash Patni <akash.pa...@ranosys.com>:
>
>> Hey,
>> I am new to django. I have other feilds also other than image field in my
>> form, so will you please tell me how to use above mentioned function in
>> edit_profile function in view, Can i call another function from another
>> function in views.py, if yes please tell me
>>
>> On Tue, Mar 24, 2015 at 6:11 PM, Andreas Kuhne <
>> andreas.ku...@suitopia.com> wrote:
>>
>>> Hi,
>>>
>>> Ok, so what you should do is add a signal to pre save and then delete
>>> the old image if the new image is attached.
>>>
>>> Something like this should work:
>>>
>>> from django.core.files.storage import default_storage as storage
>>> from django.db.models.signals import pre_save
>>>
>>>
>>> def image_delete(sender, instance, *args, **kwargs):
>>>   if instance.pk:
>>> old_instance = User.objects.get(pk=instance.pk)
>>>
>>> if old_instance.image != instance.image and instance.image:
>>>   storage.delete(old_instance.image.name)
>>>
>>> pre_save.connect(image_delete, sender=User)
>>>
>>> You can see more information about signals here:
>>> https://docs.djangoproject.com/en/1.7/topics/signals/
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>> 2015-03-24 11:40 GMT+01:00 <akash.pa...@ranosys.com>:
>>>
>>>> When i edit image that is when i upload new image,the old image should
>>>> get deleted
>>>>
>>>> On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com
>>>> wrote:
>>>>>
>>>>> hi..
>>>>> Can anyone please tell me how to handle old image after uploading new
>>>>> image.
>>>>>
>>>>  --
>>>> 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/ca9fa002-cbd5-4bbf-b42c-2a6ce88e8e0c%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/ca9fa002-cbd5-4bbf-b42c-2a6ce88e8e0c%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/oZrAdWgzwo0/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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/CALXYUbkpM6op303LMxA2iGNuzqgzB%3DjBPWw2KXkpjwdaho2Z%2BQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CALXYUbkpM6op303LMxA2iGNuzqgzB%3DjBPWw2KXkpjwdaho2Z%2BQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> *Best Regards,*
>> Akash Patni
>> Software Engineer
>>
>>
>>
>>
>> *[image: ranosys] <http://ranosys.com/>  [image: 

Re: image handling

2015-03-24 Thread Akash Patni
Hey,
I am new to django. I have other feilds also other than image field in my
form, so will you please tell me how to use above mentioned function in
edit_profile function in view, Can i call another function from another
function in views.py, if yes please tell me

On Tue, Mar 24, 2015 at 6:11 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> Hi,
>
> Ok, so what you should do is add a signal to pre save and then delete the
> old image if the new image is attached.
>
> Something like this should work:
>
> from django.core.files.storage import default_storage as storage
> from django.db.models.signals import pre_save
>
>
> def image_delete(sender, instance, *args, **kwargs):
>   if instance.pk:
> old_instance = User.objects.get(pk=instance.pk)
>
> if old_instance.image != instance.image and instance.image:
>   storage.delete(old_instance.image.name)
>
> pre_save.connect(image_delete, sender=User)
>
> You can see more information about signals here:
> https://docs.djangoproject.com/en/1.7/topics/signals/
>
> Regards,
>
> Andréas
>
> 2015-03-24 11:40 GMT+01:00 <akash.pa...@ranosys.com>:
>
>> When i edit image that is when i upload new image,the old image should
>> get deleted
>>
>> On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com
>> wrote:
>>>
>>> hi..
>>> Can anyone please tell me how to handle old image after uploading new
>>> image.
>>>
>>  --
>> 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/ca9fa002-cbd5-4bbf-b42c-2a6ce88e8e0c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ca9fa002-cbd5-4bbf-b42c-2a6ce88e8e0c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/oZrAdWgzwo0/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CALXYUbkpM6op303LMxA2iGNuzqgzB%3DjBPWw2KXkpjwdaho2Z%2BQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CALXYUbkpM6op303LMxA2iGNuzqgzB%3DjBPWw2KXkpjwdaho2Z%2BQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Best Regards,*
Akash Patni
Software Engineer




*[image: ranosys] <http://ranosys.com/>  [image: facebook]
<https://www.facebook.com/ranosys>[image: twitter]
<https://twitter.com/ranosys>[image: linkedin]
<https://www.linkedin.com/company/741079?trk=prof-exp-company-name>[image:
googleplus] <https://plus.google.com/+Ranosys> Head Office: Oxley Bizhub,
#06-48 | 73 Ubi Road 1 | Singapore - 408733Tel: +65 66331556  |  HP: +65
98573420Global Offices:San Francisco, USA | Jaipur, India | Bikaner, India*

-- 
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/CANSMZiTGE4rue_LtY3YrsERGqBuy%3DoFX0eJb_9o81R_us-OibQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image resizing

2015-03-24 Thread Akash Patni
can you please suggest me another answer...

On Tue, Mar 24, 2015 at 6:13 PM, Andreas Kuhne <andreas.ku...@suitopia.com>
wrote:

> Hi,
>
> Check out the easy_thumbnails plugin.
> http://easy-thumbnails.readthedocs.org/en/2.1/
>
> It automatically resizes all images to the size you want if you use it
> correctly.
>
> Regards,
>
> Andréas
>
> 2015-03-24 11:07 GMT+01:00 <akash.pa...@ranosys.com>:
>
>> Hi..
>> can anyone please tell me how to resize the uploaded image
>> This is my model
>> class User(models.Model):
>> first_name=models.CharField(
>> verbose_name = "First Name *",max_length=20,blank=False)
>> last_name=models.CharField(verbose_name = "Last Name
>> *",max_length=20,blank=False)
>> username=models.EmailField(verbose_name = "Email
>> *",max_length=30,blank=False)
>> password=models.CharField(verbose_name = "Password
>> *",max_length=15,blank=False)
>> dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
>> mobileno=models.CharField(verbose_name = "Mobile No
>> *",max_length=20,blank=False)
>> houseno=models.CharField(verbose_name = "House
>> No",max_length=10,blank=True)
>> address1=models.CharField(verbose_name =
>> "Adress1",max_length=30,blank=True)
>> city=models.CharField(verbose_name = "City",max_length=20,blank=True)
>> state=models.CharField(verbose_name = "State",max_length=30,blank=
>> True)
>> pincode=models.CharField(verbose_name =
>> "Pincode",max_length=20,blank=True)
>> country=models.CharField(verbose_name =
>> "Country",max_length=30,blank=True)
>> comment=models.CharField(verbose_name = "Comment",max_length=200,
>> blank=True)
>> sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False)
>> image=models.FileField(verbose_name = "Image(limit 1Mb)
>> *",blank=True,upload_to='media/')
>>
>> def __unicode__(self):
>> return self.first_name
>>
>>
>> this is my form
>> class Registration(forms.ModelForm):
>>   password = forms.CharField(label='Password
>> *',widget=forms.PasswordInput())
>>   image = forms.ImageField(label='Select a file *',help_text='max. 1
>> megabytes')
>>   class Meta:
>>
>> view.py
>> def registration(request):
>> #request.session.set_test_cookie()
>> if request.method == "POST":
>> regform=Registration(request.POST,request.FILES)
>> if regform.is_valid():
>>#item=resize_and_crop(img_path, modified_path, size,
>> crop_type='top')
>>regform.save();
>>return HttpResponseRedirect('/login/')
>>
>> else:
>> return render_to_response('registration.html',{"form":
>> regform})
>> else:
>> regform=Registration()
>> return render_to_response('registration.html',{"form":regform})
>>
>>
>> def show_profile(request):
>> if 'username' in request.session:
>>  obj_user=User.objects.all().order_by('-id')
>>  return
>> render_to_response("index.html",{"obj_user":obj_user,"message":"Hello
>> World"})
>> else:
>> return HttpResponseRedirect('/login/')
>>
>>  --
>> 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/5938a0d0-af8a-44aa-96c4-5d234f3e2cc4%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/5938a0d0-af8a-44aa-96c4-5d234f3e2cc4%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/XjuyFyKNnEI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubs

Re: image handling

2015-03-24 Thread akash . patni
When i edit image that is when i upload new image,the old image should get 
deleted

On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com 
wrote:
>
> hi..
> Can anyone please tell me how to handle old image after uploading new 
> image.
>

-- 
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/ca9fa002-cbd5-4bbf-b42c-2a6ce88e8e0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: image handling

2015-03-24 Thread akash . patni
hi
any answer

On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com 
wrote:
>
> hi..
> Can anyone please tell me how to handle old image after uploading new 
> image.
>

-- 
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/e3dbbee2-ebcb-4900-b833-d146ecebdbd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: image handling

2015-03-24 Thread akash . patni
This is my edit profile function in view

def edit_profile(request):  
if 'username' in request.session:
user_id=request.POST.get('id')
user_id=request.GET.get('id')
usr_obj=User.objects.get(id=int(user_id))
if request.method=="POST":
regform=Registration(instance=usr_obj,data = request.POST)
if regform.is_valid():
regform.save();
return HttpResponseRedirect('/index/')
else:
return 
render_to_response("edit_profile.html",{"form":regform,})
else:   
user_id=request.GET.get('id')
usr_obj=User.objects.get(id=int(user_id))
 
#temp_data={'first_name':user_id.first_name,'last_name':user_id.last_name,'email':user_id.email,'password':user_id.password,'dob':user_id.dob,'mobileno':user_id.mobileno,'houseno':user_id.houseno,'address1':user_id.address1,'city':user_id.city,'state':user_id.state,'pincode':user_id.pincode,'country':user_id.country,'comment':user_id.comment,'sex':user_id.sex}
regform=Registration(instance=usr_obj)
return 
render_to_response("edit_profile.html",{"form":regform,"user_id":user_id})


-- 
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/dc65c1d1-62dd-4cfe-b957-ec4b5b1278e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Image resizing

2015-03-24 Thread akash . patni
Hi..
can anyone please tell me how to resize the uploaded image
This is my model
class User(models.Model):
first_name=models.CharField(
verbose_name = "First Name *",max_length=20,blank=False)
last_name=models.CharField(verbose_name = "Last Name 
*",max_length=20,blank=False)
username=models.EmailField(verbose_name = "Email 
*",max_length=30,blank=False)
password=models.CharField(verbose_name = "Password 
*",max_length=15,blank=False)
dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
mobileno=models.CharField(verbose_name = "Mobile No 
*",max_length=20,blank=False)
houseno=models.CharField(verbose_name = "House 
No",max_length=10,blank=True)
address1=models.CharField(verbose_name = 
"Adress1",max_length=30,blank=True)
city=models.CharField(verbose_name = "City",max_length=20,blank=True)
state=models.CharField(verbose_name = "State",max_length=30,blank=True)
pincode=models.CharField(verbose_name = 
"Pincode",max_length=20,blank=True)
country=models.CharField(verbose_name = 
"Country",max_length=30,blank=True)
comment=models.CharField(verbose_name = 
"Comment",max_length=200,blank=True)
sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False)
image=models.FileField(verbose_name = "Image(limit 1Mb) 
*",blank=True,upload_to='media/')

def __unicode__(self):
return self.first_name


this is my form
class Registration(forms.ModelForm):
  password = forms.CharField(label='Password 
*',widget=forms.PasswordInput())
  image = forms.ImageField(label='Select a file *',help_text='max. 1 
megabytes')
  class Meta:

view.py
def registration(request):
#request.session.set_test_cookie()
if request.method == "POST":
regform=Registration(request.POST,request.FILES)
if regform.is_valid():
   #item=resize_and_crop(img_path, modified_path, size, 
crop_type='top')
   regform.save();
   return HttpResponseRedirect('/login/')

else:
return 
render_to_response('registration.html',{"form":regform})
else:
regform=Registration()
return render_to_response('registration.html',{"form":regform})


def show_profile(request):
if 'username' in request.session:
 obj_user=User.objects.all().order_by('-id')
 return 
render_to_response("index.html",{"obj_user":obj_user,"message":"Hello 
World"})
else:
return HttpResponseRedirect('/login/')

-- 
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/5938a0d0-af8a-44aa-96c4-5d234f3e2cc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: image handling

2015-03-24 Thread akash . patni
This is my model
class User(models.Model):
first_name=models.CharField(verbose_name = "First Name 
*",max_length=20,blank=False)
last_name=models.CharField(verbose_name = "Last Name 
*",max_length=20,blank=False)
username=models.EmailField(verbose_name = "Email 
*",max_length=30,blank=False)
password=models.CharField(verbose_name = "Password 
*",max_length=15,blank=False)
dob=models.DateField(verbose_name = "DOB *" ,blank=True,null=True)
mobileno=models.CharField(verbose_name = "Mobile No 
*",max_length=20,blank=False)
houseno=models.CharField(verbose_name = "House 
No",max_length=10,blank=True)
address1=models.CharField(verbose_name = 
"Adress1",max_length=30,blank=True)
city=models.CharField(verbose_name = "City",max_length=20,blank=True)
state=models.CharField(verbose_name = "State",max_length=30,blank=True)
pincode=models.CharField(verbose_name = 
"Pincode",max_length=20,blank=True)
country=models.CharField(verbose_name = 
"Country",max_length=30,blank=True)
comment=models.CharField(verbose_name = 
"Comment",max_length=200,blank=True)
sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False)
image=models.FileField(verbose_name = "Image(limit 1Mb) 
*",blank=True,upload_to='media/')

def __unicode__(self):
return self.first_name


this is my form
class Registration(forms.ModelForm):
  password = forms.CharField(label='Password 
*',widget=forms.PasswordInput())
  image = forms.ImageField(label='Select a file *',help_text='max. 1 
megabytes')
  class Meta:

view.py
def registration(request):
#request.session.set_test_cookie()
if request.method == "POST":
regform=Registration(request.POST,request.FILES)
if regform.is_valid():
   #item=resize_and_crop(img_path, modified_path, size, 
crop_type='top')
   regform.save();
   return HttpResponseRedirect('/login/')

else:
return 
render_to_response('registration.html',{"form":regform})
else:
regform=Registration()
return render_to_response('registration.html',{"form":regform})


can anyone please tell how to handle this means how to delete the old image

Please...

-- 
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/b8cf2d1a-ce01-431e-9e86-cac5d8103cd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: image handling

2015-03-24 Thread akash . patni
Hi ,
I want to delete the old image.

On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com 
wrote:
>
> hi..
> Can anyone please tell me how to handle old image after uploading new 
> image.
>

-- 
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/4aa4ac92-e622-4130-8ea0-dfbe46862c08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


image handling

2015-03-24 Thread akash . patni
hi..
Can anyone please tell me how to handle old image after uploading new image.

-- 
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/83341a1f-5684-4aad-8f87-268f25f15adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help in Django-contact-form

2015-01-27 Thread Akash Nimare
Hello everyone. I am using a third party app django-contact-form. It is 
working fine but the problem is it does not show my models in admin. I 
can't see the data in admin. The docs are very poor.
Here is my model.py 

from django.db import models
from contact_form.forms import ContactForm
class ContactForm(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField(max_length=200)
body = models.CharField(max_length=200)
def __str__(self):
return (self.email)

 admin.py
from django.contrib import admin
from . import models
from contact_form.models import ContactForm
class ContactFormAdmin(admin.ModelAdmin):
list_display = ("name", "body", "email")
admin.site.register(ContactForm, ContactFormAdmin)
I am using django 1.7
http://django-contact-form.readthedocs.org/en/latest/quickstart.html

-- 
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/035e8b0b-e502-4ba5-b8e2-9923afa43909%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Refactoring normal view into class based view

2015-01-22 Thread akash nayyar



Hi guys any idea how the following view could be refactored into class based 
view? I want to convert this view into more structured class based view.


def student_application(request, project_slug):
  profile = StudentProfile.objects.get(user=request.user)
  project = Project.objects.get(slug=project_slug)
  new_invitation = ProjectInvitation(student=profile, project=project, 
state_student=ProjectInvitationState.ACCEPTED,
   student_application=True)

  form_application = ProjectApplicationForm(request.POST, 
instance=new_invitation)
  form_application.fields["previous_experience"].queryset = 
profile.practical_experiences

  if form_application.is_valid():
form_application.save()
action.send(profile, verb='has applied for', target=project)
messages.add_message(request, messages.SUCCESS, 'Thank you! Your 
application for project %s was successful and '
'will be reviewed shortly.' 
% project)
return HttpResponseRedirect(reverse('invitation_index'))
  else:
messages.add_message(request, messages.ERROR, 'There was a problem with 
your application.')
return HttpResponseRedirect(reverse('project_index'))

-- 
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/db836e73-e86b-486f-a691-45900ae00e27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


i18n issue with compilemessages

2011-01-14 Thread Akash
Following are the environment I am working on:
1. Django 1.2.3
2. Python 2.4
3. wsgi
4. Centos 5.4

>From apache, I can run makemessage command, and it works. It creates
the *.po files.
I use the following statement for this.
os.system("django-admin.py makemessages -l hi")

But I am unable to do compilemessages from apache. Following are the
steps which I tried out:

os.system("django-admin.py compilemessages") AND
subprocess.Popen(["django-admin.py", "compilemessages"])

The command works fine from command line though, when run from project
location.
$django-admin.py compilemessages.

but when I do python manage.py shell and then try to run it using
os.system, I get the following error:

  File "/usr/lib/python2.4/site-packages/django/core/management/
commands/compilemessages.py", line 52, in handle
compile_messages(locale)
  File "/usr/lib/python2.4/site-packages/django/core/management/
commands/compilemessages.py", line 10, in compile_messages
basedirs.extend(settings.LOCALE_PATHS)
  File "/usr/lib/python2.4/site-packages/django/utils/functional.py",
line 276, in __getattr__
self._setup()
  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 40, in _setup
self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 74, in __init__
raise ImportError("Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
e))
ImportError: Could not import settings
'igp_distribution_manager.settings' (Is it on sys.path? Does it have
syntax errors?): No module named igp_distribution_manager.settings
256

So I am not sure If I should be using os.system for this,  or if there
is another way to run it from apache.

I am sure I am doing something wrong out here.
If someone have faced this before and have got some solution, then
please guide me to get through it.

Regards,
Akash

-- 
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 to php

2010-11-30 Thread Akash Mukherjee
Hello,

I have a webapp created in django. Now I want to convert the entire
code into PHP. Is it possible?? If yes, how?

Thanks

Akash

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



pickle error in DecimalField

2010-01-06 Thread Akash
I am using DecimalField in django table for pricing.  It works fine
sometimes but sometimes it throws an Pickle error (PicklingError:
Can't pickle : it's not the same object as decimal.Decimal).
I am importing decimal module in views also.
Have anyone encountered this issue? Can anyone help on this?
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.