Re: DjangoProject

2020-08-12 Thread S D
Hi Desh,

Welcome to Django :)

Like Adam said, you should unsubscribe from the django-developers mailing
list for now. That list is for people who are actually working on the
Django framework itself.

The django-users mailing list is the one where people who are learning to
use Django communicate.

Have fun + stay safe.


Kind regards,
~ SD


On Tue, Aug 11, 2020 at 6:54 PM Desh Deepak  wrote:

> Hello everyone, I want to developing a django project. Who wants to
> collaborate to do a project and learn django share your github user id for
> github reposetory access.
>
> Live on Heroku
> http://kidszania.herokuapp.com/
>
>
> Thanks
> Desh Deepak
> +91 7011101001
>
>
> --
> 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/CAJ0m4xi70WZ9ZsL4nBU3HmNU%2BZ8TLgNgL4BwAfS7%3DhxNZ-SxNg%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/CAH-SnCB4ab0MbAkVA_D5Ve-U%3DkCm9XtnypVB7aBtK6xEJvs5jQ%40mail.gmail.com.


Re: Necessary to learn React/ Angular with backend Django

2020-01-07 Thread S D
Hi Balaji,

You can convert your web app into a PWA to gain maximum benefit. Just look
it up.

Data shows that PWAs are the way to go.



Kind regards,
- SD

On Tue, Jan 7, 2020, 19:47 Balaji Shetty  wrote:

> Hi
>
> Currently i deployed application on pythonanywhere. It is online office
> file management system with around 100 users under 10 different department
> in hierarchical manner.
>
> User and department may increase in future.
>
> Entire application is developed in Django back end.
>
> Used bootstrap for custom report generation.
>
> question arises in My mind is
>
> Is it Necessary to learn and implement in React/ Angular for front end.
>
>
> Because I am comfortable with current implementation.
>
>
> May I know what are gains i may get or what are the disadvantage i may
> suffer in future.
>
> Kindly guide me to avoid future inconvenience.
>
>
> --
> Mr Shetty Balaji
> Asst. Prof.
> IT Department
> SGGS I&T
> Nanded. My. 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOuN%2BBsvoGZ4nBA5D9batL9UAYQ4crZGWmaMxYMJQ5X1sQ%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/CAH-SnCDPbKE3aO8Fe8u1_%2Bg10hzcyxC%2BH8ehxoFpW7mXj235Aw%40mail.gmail.com.


URL pattern for URL with query string

2020-01-13 Thread S D
Hey guys. SOS please. How do I write a URL pattern for a URL like this?

weather/?current_location=-33.927407,18.415747&booking_location=-32.927407,19.415747

When I do reverse(‘weather’, kwargs={‘current_location’: some_value,
'booking_ location’: another_value}) I am getting a NoReverseMatch
exception.


Kind regards,
- SD

-- 
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/CAH-SnCBDKO4PzcWZB-n5QqwZtd3jMx%3DDZjCZkzQ2%3D_2cf1LOCA%40mail.gmail.com.


Re: URL pattern for URL with query string

2020-01-13 Thread S D
Thanks Jason.



Kind regards,
- SD

On Mon, Jan 13, 2020, 16:28 Jason  wrote:

> The url resolver does not include GET query params in a URL, you need to
> add them manually after the string.
>
> for example
>
> url =
> f"{reverse('weather')}/?current_location={some_value}&booking_location={another_value}"
>
> --
> 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/6dd43044-909b-49b2-87fc-5344508af9e8%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/CAH-SnCDYPmVvrt_v3jb3V3%3DiLUKCmdNuHZF%2B1GFdVhXQXydf%2Bg%40mail.gmail.com.


Getting the first item in a dict

2020-01-27 Thread S D
I have a dictionary which contains one item (“current_location”, which is a
nested dict) and I would like to access that nested dict. However, I cannot
use the key as the code will break if a different key is passed, e.g.
“different_location”.

How can I access the first item in a dictionary without using a key? The
dict looks like this:

`
{'current_location': {'date': '2020-01-27T10:28:24.148Z', 'type_icon':
'partly-cloudy-day', 'description': 'Mostly Cloudy', 'temperature': 68.28,
'wind': {'speed': 10.48, 'bearing': 178, 'gust': 12.47}, 'rain_prob': 0.02,
'latitude': '-33.927407', 'longitude': '18.415747', 'request_id': 31364,
'request_location': 'Current location'}}
`

Kind regards,
- SD

-- 
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/CAH-SnCBnnOsoTURnSzCrqqXsCWF5EEjghm9Q1UTQKrnTBAJ3iA%40mail.gmail.com.


Re: Getting the first item in a dict

2020-01-27 Thread S D
I ended up using `dict[next(iter(dict))]`

I am getting the dict as one of two dicts nested in a list from a weather
service API. I do this using a list comprehension to call the API with
coordinates for each location in another list. A mouthful.

`resp = [fetch_api_data(location, request_id) for location in
REQUEST_LOCATIONS]`

I then cycle through the list and, for each dict, persist a WeatherRequest
instance to db like so:

`
for item in weather_data:
data = item[next(iter(item))]
WeatherRequest(
date=data['date'],
request_id=data['request_id'],
request_location=data['request_location'],
type_icon=data['type_icon'],
description=data['description'],
temperature=data['temperature'],
wind_speed=data['wind']['speed'],
wind_bearing=data['wind']['bearing'],
wind_gust=data['wind']['gust'],
rain_prob=data['rain_prob'],
latitude=data['latitude'],
longitude=data['longitude']
).save()
`

Thanks.


Kind regards,
- SD


On Mon, Jan 27, 2020 at 2:51 PM Bill Freeman  wrote:

> Note that these give the only value.  This won't work if you have more
> than one value in the dict, since you won't know which you will get.  Where
> d is the dict:
>
> list(d.values())[0]
>
> or
>
> for i in d.values():
> # use i here
> print(i)
>
> or
>
> d[list(d)[0]]
>
> I'm sure that there are other ways.  There is certainly at least a way to
> play with the iterator protocol without using "for", but it may be harder
> to read.  You could put break at the end of the loop above to make it more
> apparent that it only runs once.
>
> On Mon, Jan 27, 2020 at 6:58 AM S D  wrote:
>
>> I have a dictionary which contains one item (“current_location”, which is
>> a nested dict) and I would like to access that nested dict. However, I
>> cannot use the key as the code will break if a different key is passed,
>> e.g. “different_location”.
>>
>> How can I access the first item in a dictionary without using a key? The
>> dict looks like this:
>>
>> `
>> {'current_location': {'date': '2020-01-27T10:28:24.148Z', 'type_icon':
>> 'partly-cloudy-day', 'description': 'Mostly Cloudy', 'temperature': 68.28,
>> 'wind': {'speed': 10.48, 'bearing': 178, 'gust': 12.47}, 'rain_prob': 0.02,
>> 'latitude': '-33.927407', 'longitude': '18.415747', 'request_id': 31364,
>> 'request_location': 'Current location'}}
>> `
>>
>> Kind regards,
>> - SD
>>
>> --
>> 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/CAH-SnCBnnOsoTURnSzCrqqXsCWF5EEjghm9Q1UTQKrnTBAJ3iA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAH-SnCBnnOsoTURnSzCrqqXsCWF5EEjghm9Q1UTQKrnTBAJ3iA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CAB%2BAj0tFp_qOtqd3WMvPTfGkGy3q-jCFDwnrgheYjBk8NqP4bQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAB%2BAj0tFp_qOtqd3WMvPTfGkGy3q-jCFDwnrgheYjBk8NqP4bQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAH-SnCBkMAJqVetRU_X46r-pg-HLDZsuTt4iqeYN%2BSpjSmbttA%40mail.gmail.com.