Error: duplicate key value violates unique constraint

2022-09-23 Thread Salima Begum
Hi all, When I am posting data in the server here we have an issue where the primary key already exists. For example, today I posted some data . I have the same issue. I solved the issue by deleting data from that particular table and then I am able to post data. Next day if I try to post data I

Re: How to use Authentication in DRF

2022-07-21 Thread Salima Begum
more please > > -- > > Ammar Mohammed > +249 113075979 > On 21 Jul 2022 07:08, "Salima Begum" wrote: > >> Hi all, >> >> I am trying to convert my current project(It is developed in Django) to >> DRF. So, I set up DRF into my project then I wro

Re: Added new column to model and run migrations but not applied to database table

2022-06-15 Thread Salima Begum
this problem again and again. Thanks ~Salima On Mon, Aug 16, 2021 at 9:47 AM Salima Begum wrote: > Hi, > I am hitting this problem again with new code merges into the > deployment server. Last time, I fixed the issue by doing like this > > "I have tried all the ways what you guys sug

Re: Pytest coverage report 100%

2022-05-18 Thread Salima Begum
'name': > first_last_initial(email), > 'time': > settings.SESSION_IDLE_TIMEOUT, > 'some_date': > dict_act, > }) Like

Pytest coverage report 100%

2022-05-18 Thread Salima Begum
Hi all, How to write a pytest case to get coverage report to 100%. ``` def Account_security(request): try: if ((request.session.get('email') is None) or (request.session.get('email') == "")): return HttpResponseRedirect("/home") dict_act = {} email =

'str' object is not callable

2022-05-06 Thread Salima Begum
Hi all, In my project I am Django messages Framework. I am always facing 'str' object error I dont understand how to solve this problem. Previously also I face same issue. Now it is reproduced. I am using django 4.0.4 version. Python 3.9.6 ``` messages.success(request, "Welcome back") ``` ```

'str' object is not callable

2022-05-06 Thread Salima Begum
Hi all, In my project I am Django messages Framework. I am always facing 'str' object error I dont understand how to solve this problem. Previously also I face same issue. Now it is reproduced. I am using django 4.0.4 version. Python 3.9.6 ``` messages.success(request, "Welcome back") ``` ```

Re: Got an error creating the test database: database "" already exists

2022-03-17 Thread Salima Begum
are using the authentication with migrating their >>> tables with database. >>> >>> Try to run command in this sequence. This might be solve your problem. >>> >>> >>> python manage.py migrate >>> >>> python manage.py makemigrations &g

Re: Got an error creating the test database: database "" already exists

2022-03-16 Thread Salima Begum
migrate it, then structure is created in new >> database. >> >> I am sorry i have no idea how yoz can fix relation exception manual. >> >> Regards >> >> >> Salima Begum schrieb am Mi., 16. März >> 2022, 06:51: >> >>> Hi all, &g

Got an error creating the test database: database "" already exists

2022-03-15 Thread Salima Begum
Hi all, After writing test cases I run test cases I am getting an error below ``` Python manage.py behave ``` After running the above command I am getting this error. ``` Creating test database for alias 'default'... Got an error creating the test database: database "test_newDataBase" already

How to make a fix backward compatible with old data?

2021-09-21 Thread Salima Begum
Hi all, We used to allow uploading images to a market place Ad and when a user doesn't upload one of the images we present a dummy image in the UI as well as saving the same dummy image in the database. Now we added a fix for not saving dummy image and just saving whatever user uploads. That

'str' object is not callable error appears from Django Message Framework

2021-09-19 Thread Salima Begum
Hi all, Our web application prompts confirmation messages when user submits the form and users can continue to submit additional forms while they are using application and the confirmation messages are prompted fine, but 'str' object is not callable error appears randomly before prompting a

Re: TypeError: 'str' object is not callable

2021-09-13 Thread Salima Begum
e. Thanks ~Salima On Thu, Sep 2, 2021 at 10:27 AM Lalit Suthar wrote: > cool :) > > > On Tue, 31 Aug 2021 at 11:27, Salima Begum > wrote: > >> Hi all, >> Actually this error is prompting because in my deployment site I am using >> django version 3.2. In this

Re: TypeError: 'str' object is not callable

2021-08-30 Thread Salima Begum
/messages/ On Tue, Aug 31, 2021 at 11:22 AM Lalit Suthar wrote: > go like this > > messages.add_message(request, messages.WARNING, "failure message") > return HttpResponse / render > > On Tue, 31 Aug 2021 at 10:32, Salima Begum > wrote: > >> Hi, Thank y

Re: TypeError: 'str' object is not callable

2021-08-30 Thread Salima Begum
Ad is successfully posted.""") ``` Thank you ~Salima On Tue, Aug 31, 2021 at 10:19 AM Salima Begum wrote: > Hi Thomas, > > The way I defined how i have written code for confirmation message > ``` > messages.success(request, """Your Ad is successfully po

Re: TypeError: 'str' object is not callable

2021-08-30 Thread Salima Begum
eed to write > > messages.success = “Your ad is successfully posted” > > But without more information from you that is only a guess. > > How is messages.success defined? > > - Tom > > On Aug 30, 2021, at 8:57 PM, Salima Begum > wrote: > > Hi all, > In my pro

TypeError: 'str' object is not callable

2021-08-30 Thread Salima Begum
Hi all, In my project for each functionality I have written code for confirmation messages. For example ``` messages.success("Your ad is successfully posted") ``` Every functionality is breaking because of confirmation messages after deployment. How to fix it? Can anyone help me? Thank you

Re: Added new column to model and run migrations but not applied to database table

2021-08-15 Thread Salima Begum
39:56 AM UTC+8 sebasti...@gmail.com > wrote: > >> Is in settings.py also in installed app? Without that migrations don't >> work >> >> Salima Begum schrieb am Di., 20. Juli >> 2021, 19:00: >> >>> Hi , >>> Thank you for your responses. &

Re: Wish list functionality in products listing page.

2021-07-29 Thread Salima Begum
DJANGO DEVELOPER wrote: > I think you have to save the products in your wishlist feature just by > doing the same way as we do in saving things in django > > On Thu, Jul 29, 2021 at 10:07 AM Salima Begum < > salim...@rohteksolutions.com> wrote: > >> Hi all, >&g

Wish list functionality in products listing page.

2021-07-28 Thread Salima Begum
Hi all, In my project I want to implement wishlist functionality in products listing pages. Is there any django packages to implement in my project and any ideas please let me know Thank you ~Salima -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Added new column to model and run migrations but not applied to database table

2021-07-20 Thread Salima Begum
ions appname > > if this will not work then do that > > 2: delete migrations folder from your app and delete database then run > again python manage.py makemigrations > > > > > On Mon, Jul 19, 2021 at 6:07 AM Salima Begum > wrote: > >> Hi all, >> >> I have added

Re: Added new column to model and run migrations but not applied to database table

2021-07-19 Thread Salima Begum
gards, > Abhishek Choudhury > > On Mon, 19 Jul 2021 at 10:37 AM, Salima Begum < > salim...@rohteksolutions.com> wrote: > >> Hi all, >> >> I have added a new column to the existing model while developing. Then I >> run makemigrations and migrate. It is not ap

Added new column to model and run migrations but not applied to database table

2021-07-18 Thread Salima Begum
Hi all, I have added a new column to the existing model while developing. Then I run makemigrations and migrate. It is not applied to the database table which is created based on that model. How can I fix this issue? Please help me to complete this issue. The below issue I am facing in

How to parse JSON data in python and Django

2021-06-29 Thread Salima Begum
Hi all, >From below json data to parse this data to fetch categoryId and categoryName in four levels of data I used for loop for fetching data and inserting into database table. Is there any better way to do this in python and Django? Please Help me to achieve this. Let me know if you have any

How to write a v-if condition for comparing django accessed value "{{cust_package}}" and vue.js "<%radio_price%>"

2021-06-24 Thread Salima Begum
And here I am trying to write if statement and also I have interpolated a value in vue.js like "{{cust_package}}" accessed In django and <%radio_price%> accessed in vue.js for both i am trying to write a if condition like "v-if="radio_price == {{cust_package}}" So this condition is not working so

After uploading image is not displaying in production server.

2021-05-31 Thread Salima Begum
Hi all, In my project after depl;oying into production server When i have uploaded images it saves into media folder but not displaying image in template. As well as when we go to the admin site and to display an image when I click on the url of the image it is throwing an error like. url not

In Django project how to create app in subapp in apps folder.

2021-05-18 Thread Salima Begum
Hi all, We initially developed our project with the following folder structure; [image: old_folder_structure.PNG] As shown in the above image we have developed and integrated everything into a few files. Since the functionality is growing we are planning to separate each functional module as an

Re: Folder structure for a Django project that has multi functional module.

2021-05-12 Thread Salima Begum
Thank you for your opinion. On Wed, 12 May 2021, 11:37 am Ammar Mohammed, wrote: > Separating every functional module is the right way ! > You should build your website on a base module using oop and structural > method. > > Good luck > > > On Wed, May 12, 2021, 06:

Folder structure for a Django project that has multi functional module.

2021-05-11 Thread Salima Begum
Hi, We initially developed our project with the following folder structure; [image: old_folder_structure.PNG] As shown in the above image we have developed and integrated everything into a few files. Since the functionality is growing we are planning to separate each functional module as an

After user click on like button page should not refresh(redirect) and update count of likes

2021-05-04 Thread Salima Begum
When user click to like a post the web page should not refresh(redirect) and count of the likes should be updated. How can I achieve this please help me. Here is my block of code ``` ``` views.py ``` def post_comment_like(request, id): if

Re: User filling form in login session if user logout and login again data of form not to lose.

2021-04-19 Thread Salima Begum
dpoint in Django and store it into > the database. When a user's logged back in, just render the existing data > if there's any. > > On Sunday, April 18, 2021, 10:09:29 PM PDT, Salima Begum < > salim...@rohteksolutions.com> wrote: > > > Hi all, > Here we are trying. While u

User filling form in login session if user logout and login again data of form not to lose.

2021-04-18 Thread Salima Begum
Hi all, Here we are trying. While user enters a value in form input fields the value should not clear if user logout the session and navigate from one page to other. After filling the form in django if user fills some form fields and suddenly user logout and if user login again then it should

AttributeError: 'customer' object has no attribute 'is_authenticated'

2021-04-01 Thread Salima Begum
Hi all, How to solve this errors ``` AttributeError: 'customer' object has no attribute 'is_authenticated' ``` ``` AttributeError: 'customer' object has no attribute 'is_anonymous' ``` How can I solve this above errors. Help me. Thanks ~Salima -- You received this message because you are

Nested comments feature

2021-03-31 Thread Salima Begum
Hi all, We are planning to add nested comments features in our web application and are wondering whether Django FWK has a specific function or library that we can make use of and customize it according to our application. I would appreciate if you could share respective suggestions regarding

How to upload image using django backend and vuejs form in front end

2021-03-15 Thread Salima Begum
Hi all, I am trying to upload an image using vue.js and backend is django. but while I am uploading the image its is showing path as a "fakepath". So due to that i am unable to save the image at media folder. So how to solve this issue. Thanks ~Salima -- You received this message because you

how to fix in Missing statements in pytest

2021-03-05 Thread Salima Begum
Hi all, I am using pytest for testing my django application. I have written test cases for models, views, urls all test cases are running successfully but In the coverage report of pytest I am getting some missing statements. Is there any packages or plugin to resolve this missing statements

Re: Log out all sessions for current user logged in

2021-02-28 Thread Salima Begum
ror message > with full traceback. > > On February 26, 2021 6:40:28 PM CST, Salima Begum < > salim...@rohteksolutions.com> wrote: >> >> Yes. I have tried that no it is not working and giving error like "Query >> object doesn't contain flush()" >> &

Re: Log out all sessions for current user logged in

2021-02-26 Thread Salima Begum
Yes. I have tried that no it is not working and giving error like "Query object doesn't contain flush()" On Sat, 27 Feb 2021, 12:35 am Ryan Nowakowski, wrote: > Have your tried my suggestion below? Did it work? > > On February 25, 2021 9:42:55 PM CST, Sal

Re: Log out all sessions for current user logged in

2021-02-25 Thread Salima Begum
Logout all sessions belong to logged in user Can you please how can I achieve this? Thanks ~salima On Fri, Feb 26, 2021 at 4:56 AM Ryan Nowakowski wrote: > On Wed, Feb 17, 2021 at 08:23:08AM +0530, Salima Begum wrote: > > Logout all sessions based on current user id and clear django

How to use .vue files in Django project

2021-02-25 Thread Salima Begum
Hi all, I have developed a project by using django and for front end functionality I am using vuejs so, how to use .vue files in django project in my project .vue files are not accepting. Thanks ~salima -- You received this message because you are subscribed to the Google Groups "Django users"

Sorting by distance and date from classifieds page.

2021-02-24 Thread Salima Begum
Hi all, 1. After posting an Ad it will display in the classifieds page. After user logged in user zip code and based on classifieds ad zip code distance we are showing in classifieds page. 2. Based on distance and added date of Ad we need to show a listing in the classifieds page. 3. within 40

Re: Classifieds page loading is to slow

2021-02-15 Thread Salima Begum
job does the work of fetching and storing > the results. > > Benny > > On Feb 1, 2021, at 11:07 PM, Salima Begum > wrote: > >  > Thank you everyone. We identified the issue. > Basically we are using an API which calculates distance > between two different

How to design database for saving data into table

2021-02-15 Thread Salima Begum
Hi all, By using API calculating Distance between two Zip codes(post codes) But Here is my question. When user loading page always running API is not good coding so, I want to save that into one table and show that data into classifieds page( items listings). So, Here We are calculating distance

Re: Classifieds page loading is to slow

2021-02-01 Thread Salima Begum
Thank you everyone. We identified the issue. Basically we are using an API which calculates distance between two different ads using zip code value and this help us to show the distance of the ad from logged-in users location. So when classifies page is being loaded, this API is called for each

Re: Classifieds page loading is to slow

2021-01-21 Thread Salima Begum
Hi all, We are building website, Here I have written functionality for classifieds page. It is loading to slow because of We are prompting distance calculation in classifieds page. By using distance API matrix based on logged in user zip code and individual Ad zip codes from query

[no subject]

2021-01-20 Thread Salima Begum
Hi all, We are building website, Here I have written functionality for classifieds page. It is loading to slow because of We are prompting distance calculation in classifieds page. By using distance API matrix based on logged in user zip code and individual Ad zip codes from query set(database).

Classifieds page loading is to slow

2021-01-14 Thread Salima Begum
Hi all, We are building a Web application, We have a classifieds page that is loading too slow. How to fix this issue. how to reduce loading time of classifieds page. Thanks ~Salima -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Built in views how to change in django watson package.

2020-12-09 Thread Salima Begum
> There are no results to display. > > Try entering a less specific search term. > > {% else %} > > Please enter a query in the search form. > {% endif %} > > {% endif %} > > > >

Re: Built in views how to change in django watson package.

2020-12-09 Thread Salima Begum
ink for the built-in-views, > > https://github.com/etianen/django-watson/wiki/Built-in-views > > To return search results on the home page, you need to add your, > > {℅ Url "your_home_namespace" ℅} > > in > > > > On Wed, Dec 9, 2020, 9:35 AM Sal

Built in views how to change in django watson package.

2020-12-08 Thread Salima Begum
Hi all, I am using the django watson package in my project. How to achieve to change built in views to change default template rendering and to search results in the home page. This is url of django watson '''https://github.com/etianen/django-watson/wiki/Built-in-views''' Please Help me out to

How to save all fields in form in single row into the database.

2020-11-23 Thread Salima Begum
Hi, We are trying to save fields in html form into one row into a database. models.py class master(models.Model): STATUS = ( ('1', 'Active'), ('0', 'InActive'), ) question_code = models.IntegerField() question_description = models.CharField(max_length=160)

pages.models.vk_ls_product_search.DoesNotExist: vk_ls_product_search matching query does not exist.

2020-10-16 Thread Salima Begum
Hi all, I have written test case for ProductDetails_ls for views *views.py* ``` class onClickSearch(): def ProductDetails_ls(request, id): # product_ls = vk_ls_product_search.objects.get(id=id) product_ls = get_object_or_404(vk_ls_product_search, id=id) email =

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
, 2020 at 3:33:11 pm UTC+5:30 > sali...@rohteksolutions.com wrote: > >> Inside pages folder I already have views.py >> >> Thanks >> ~salima >> >> On Fri, Oct 16, 2020 at 1:28 PM Akinfolarin Stephen < >> akinfolar...@gmail.com> wrote: >> >&

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
the views.py inside of > it > > On Fri, Oct 16, 2020, 08:10 Salima Begum > wrote: > >> urls.py >> >> path('ProductDetails/', views.onClickSearch.ProductDetails, >> name='ProductDetails'), >> >> views.py >> >> >> class onClickSearch()

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
16, 2020 at 12:32 PM Dhwanil Shah wrote: > Can you post your views.py code > > On Fri, 16 Oct 2020 at 12:26, Salima Begum > wrote: > >> Hi all, >> vikreya >> mysite >> .cache >> .idea >>.pytest_cache >> logs

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Begum wrote: > Hi @Akinfolarin Stephen, > > > > On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen < > akinfolarinsteph...@gmail.com> wrote: > >> First I will like you to tell me the folder where test.py is and views.py >> >> On Fri, Oct 16, 2020

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
, Oct 16, 2020 at 12:09 PM Salima Begum wrote: > Hi @Akinfolarin Stephen, > > > > On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen < > akinfolarinsteph...@gmail.com> wrote: > >> First I will like you to tell me the folder where test.py is and views.py >>

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Hi @Akinfolarin Stephen, On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen < akinfolarinsteph...@gmail.com> wrote: > First I will like you to tell me the folder where test.py is and views.py > > On Fri, Oct 16, 2020, 06:27 Salima Begum > wrote: > >> Hi all, >

ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-15 Thread Salima Begum
Hi all, I have written test case for views for details page. Here is below code I have written ``` from django.test import RequestFactory from django.urls import reverse from django.contrib.auth.models import User from pages.models import vk_customer from mixer.backend.django import mixer import

Ajax, jQuery and Django

2020-10-05 Thread Salima Begum
Hi all, I have database of zip code for example, INSERT INTO pages_zip_code (id, zip, city, st) VALUES (1, '00501', 'Holtsville', 'NY'), (2, '00544', 'Holtsville', 'NY'), (3, '00601', 'Adjuntas', 'PR'), (4, '00602', 'Aguada', 'PR'), (5, '00603', 'Aguadilla', 'PR'), (6, '00604', 'Aguadilla', 'PR'),

Ajax, jQuery and Django

2020-10-05 Thread Salima Begum
Hi all, I have database of zip code for example, INSERT INTO pages_zip_code (id, zip, city, st) VALUES (1, '00501', 'Holtsville', 'NY'), (2, '00544', 'Holtsville', 'NY'), (3, '00601', 'Adjuntas', 'PR'), (4, '00602', 'Aguada', 'PR'), (5, '00603', 'Aguadilla', 'PR'), (6, '00604', 'Aguadilla', 'PR'),

Re: capture client side location in Django

2020-09-25 Thread Salima Begum
Hi all, I tried use https://docs.djangoproject.com/en/3.1/ref/contrib/gis/geoip2/ and This particular package requires GeoLite2-Country.mmdb.gz GeoLite2-City.mmdb.gz These databases are not free. We are looking for an open source API or package for our web application. I appreciate if someone

capture client side location in Django

2020-09-24 Thread Salima Begum
Hi all, How to capture client side location in django can any one help to achieve this? Thank you ~Salima -- 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

Account activity How to logout a particular device to logout.

2020-09-14 Thread Salima Begum
Hi all, By using python and django. 1. User Login with one account in different devices. 2. If he login into another device we sent user to email. Saying that New device login. 3. After we show user in his/her account activity page With that account how many devices are login.

Re: How to get client or user side details

2020-09-03 Thread Salima Begum
cyclarke/Detect.js > Video Tutorial : https://youtu.be/QukFW1qymSA > > All the best > > > On Thu, Sep 3, 2020 at 10:49 AM Salima Begum > wrote: > >> Hi, >> We are trying to extract new login attempts done by application users >> from new devices. Th

How to get client or user side details

2020-09-02 Thread Salima Begum
Hi, We are trying to extract new login attempts done by application users from new devices. That means if an application user tries to login other than their regular devices ( laptop, mobile phone etc.), we need to extract that particular new device details. So the details that we need are 1.

Not found media/some.jpg

2020-07-21 Thread Salima Begum
Hi all, Here, i am using three image fields in PostAd form. Images are not saved to the media folder. Can anyone help me please. In models.py class classifieds(models.Model): title = models.CharField(max_length=60) description = models.CharField(max_length=600) price =

Postgresql and mysql

2020-05-18 Thread Salima Begum
Hi , Mysql query which we used previously now we moved to postgresql, Here is the below query in mysql , Can anyone help me to write similar query in postgresql. query = "LOAD DATA LOCAL INFILE '41098_category_list.txt' INTO TABLE pages_rim_ls_categories FIELDS TERMINATED BY '|' LINES TERMINATED