Re: Simple django api

2018-06-05 Thread Django Girls Bauchi
JWT, auto generated user Id(alphanumeric), email, and full name
Thanks

On Wed, Jun 6, 2018, 3:30 AM Satyam Soni  wrote:

> Its simple. Postman is simply a tool. All you need to create an api. What
> kind of data you wanna post as response from api ?
>
> Sent from my iPhone
>
> On 06-Jun-2018, at 7:55 AM, Dylan Reinhold  wrote:
>
> What is your specific question.
>
> On Tue, Jun 5, 2018 at 6:35 PM, Django Girls Bauchi <
> bau...@djangogirls.org> wrote:
>
>> Hello
>> Response pls
>>
>> On Tue, Jun 5, 2018, 10:46 PM Django Girls Bauchi 
>> wrote:
>>
>>> Holla
>>> Wants to create a simple django api, that send specific data(using
>>> postman) and receive response. Yeah its simple, but simple tend hard on me
>>> this days, anyone to help out, urgently.
>>>
>>> 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/CADJBrQ9UX08GgRdB4MR5sFa964Uh086zWDyXaKYxCk3Q7o1R9g%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/CAHtg44B_ByBMNu9Z89%3DfxXVXygkrWADjQw29cpAqXhPLXgezXw%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/4DC1059B-68DA-4FD8-8610-7E1D2C46F873%40livehealth.in
> 
> .
> 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/CADJBrQ889MOVHYq8rxrVZwUXf2wbKz59Gr9%3DNTHy3W55u8accA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple django api

2018-06-05 Thread Satyam Soni
Its simple. Postman is simply a tool. All you need to create an api. What kind 
of data you wanna post as response from api ?

Sent from my iPhone

> On 06-Jun-2018, at 7:55 AM, Dylan Reinhold  wrote:
> 
> What is your specific question. 
> 
>> On Tue, Jun 5, 2018 at 6:35 PM, Django Girls Bauchi  
>> wrote:
>> Hello
>> Response pls
>> 
>>> On Tue, Jun 5, 2018, 10:46 PM Django Girls Bauchi  
>>> wrote:
>>> Holla
>>> Wants to create a simple django api, that send specific data(using postman) 
>>> and receive response. Yeah its simple, but simple tend hard on me this 
>>> days, anyone to help out, urgently.
>>> 
>>> 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/CADJBrQ9UX08GgRdB4MR5sFa964Uh086zWDyXaKYxCk3Q7o1R9g%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/CAHtg44B_ByBMNu9Z89%3DfxXVXygkrWADjQw29cpAqXhPLXgezXw%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/4DC1059B-68DA-4FD8-8610-7E1D2C46F873%40livehealth.in.
For more options, visit https://groups.google.com/d/optout.


Re: Simple django api

2018-06-05 Thread Django Girls Bauchi
Wants to create a simple django api, that accept specific data(using
postman) and send response. Yeah its simple, but simple tend hard on me
this days, anyone to help out, urgently.


On Wed, Jun 6, 2018, 3:26 AM Dylan Reinhold  wrote:

> What is your specific question.
>
> On Tue, Jun 5, 2018 at 6:35 PM, Django Girls Bauchi <
> bau...@djangogirls.org> wrote:
>
>> Hello
>> Response pls
>>
>> On Tue, Jun 5, 2018, 10:46 PM Django Girls Bauchi 
>> wrote:
>>
>>> Holla
>>> Wants to create a simple django api, that send specific data(using
>>> postman) and receive response. Yeah its simple, but simple tend hard on me
>>> this days, anyone to help out, urgently.
>>>
>>> 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/CADJBrQ9UX08GgRdB4MR5sFa964Uh086zWDyXaKYxCk3Q7o1R9g%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/CAHtg44B_ByBMNu9Z89%3DfxXVXygkrWADjQw29cpAqXhPLXgezXw%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/CADJBrQ90jYP8Lid-%2BqKXsHU12U_V-FNLqpt46_cruHjfcYZb-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple django api

2018-06-05 Thread Mike Dewhirst

Take a look at Django REST Framework

http://www.django-rest-framework.org/

Haven't used it myself but I'm planning to one of these days.

Cheers

M

On 6/06/2018 11:35 AM, Django Girls Bauchi wrote:

Hello
Response pls

On Tue, Jun 5, 2018, 10:46 PM Django Girls Bauchi 
mailto:bau...@djangogirls.org>> wrote:


Holla
Wants to create a simple django api, that send specific data(using
postman) and receive response. Yeah its simple, but simple tend
hard on me this days, anyone to help out, urgently.

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/CADJBrQ9UX08GgRdB4MR5sFa964Uh086zWDyXaKYxCk3Q7o1R9g%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/e149e105-0ed5-69e8-9b44-a2e98ab27322%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: App not Defined - Getting Started

2018-06-05 Thread Satyam Soni
Did u registered you app in settings.py file ? This happens when you forget to 
put name of your app in installed apps in settings.py file. 

Sent from my iPhone

> On 05-Jun-2018, at 2:36 AM, Jaime Escobar  wrote:
> 
> Hi, 
> I am a completely beginner in django and also python programming. I am trying 
> to follow the online documentation tutorial in which a poll website is 
> created, but just running the server after created the polls it throws the 
> error "name 'polls' is not defined".
> 
> Can you help me?
> 
> 
> Unhandled exception in thread started by  check_errors..wrapper at 0x7feeeb74ab70>
> Traceback (most recent call last):
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/autoreload.py", 
> line 225, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
>  line 120, in inner_run
> self.check(display_num_errors=True)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/base.py",
>  line 364, in check
> include_deployment_checks=include_deployment_checks,
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/base.py",
>  line 351, in _run_checks
> return checks.run_checks(**kwargs)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/registry.py",
>  line 73, in run_checks
> new_errors = check(app_configs=app_configs)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/urls.py", 
> line 40, in check_url_namespaces_unique
> all_namespaces = _load_all_namespaces(resolver)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/urls.py", 
> line 57, in _load_all_namespaces
> url_patterns = getattr(resolver, 'url_patterns', [])
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/functional.py", 
> line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/urls/resolvers.py", 
> line 540, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns", 
> self.urlconf_module)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/functional.py", 
> line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File 
> "/home/jaime/.local/lib/python3.6/site-packages/django/urls/resolvers.py", 
> line 533, in urlconf_module
> return import_module(self.urlconf_name)
>   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 219, in _call_with_frames_removed
>   File "/home/jaime/Projects/Django/mysite/mysite/urls.py", line 20, in 
> 
> path('polls/',include(polls.urls)),
> NameError: name 'polls' is not defined
> 
> -- 
> 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/df3c68c4-aa2a-498d-a1ed-840a31acf7a2%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/4053A3FE-B231-4B3F-9BCD-A7AAB07BAD1E%40livehealth.in.
For more options, visit https://groups.google.com/d/optout.


Re: Simple django api

2018-06-05 Thread Dylan Reinhold
What is your specific question.

On Tue, Jun 5, 2018 at 6:35 PM, Django Girls Bauchi 
wrote:

> Hello
> Response pls
>
> On Tue, Jun 5, 2018, 10:46 PM Django Girls Bauchi 
> wrote:
>
>> Holla
>> Wants to create a simple django api, that send specific data(using
>> postman) and receive response. Yeah its simple, but simple tend hard on me
>> this days, anyone to help out, urgently.
>>
>> 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/CADJBrQ9UX08GgRdB4MR5sFa964Uh0
> 86zWDyXaKYxCk3Q7o1R9g%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/CAHtg44B_ByBMNu9Z89%3DfxXVXygkrWADjQw29cpAqXhPLXgezXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and aws elastic beanstalk

2018-06-05 Thread Yik San Chan
For requirements.txt, you have to run

> pip freeze > requirements.txt


For the second error, you have to run

> eb config

Then change WSGIPath to point to your wsgi.py file.

On Thursday, July 14, 2016 at 4:32:47 AM UTC-7, 
mat...@vogcalgaryappdeveloper.com wrote:
>
> Hi, I’ve been directed to you for technical support regarding Django. I 
> can get it working on my own computer running on the provided local server 
> however when I follow any tutorial to host it on elastic beanstalk I get 
> one of two of the following errors:
>
> “ERROR: your requirements.txt is invalid.”
>
> “ERROR: WSGIPath refers to a file that does not exist.”
>
>  
>
> I’ve tried everything I can think of but nothing seems to work. 
>
> I look forward to hearing back from you and hope that you can help me with 
> this.
>
>  
>
>  
>
> Matthew Bates
> VOG Calgary Developer Inc - We Are Mobile Development Professionals
> Phone: (403) 399-2519 || Email: mat...@vogcalgaryappdeveloper.com 
> 
> 1900 11 Street SE,Suite 150, Calgary, AB T2G 3G2
>
>  
>

-- 
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/0cd3efa2-b2ec-4234-b29e-a7dbe31486ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple django api

2018-06-05 Thread Django Girls Bauchi
Hello
Response pls

On Tue, Jun 5, 2018, 10:46 PM Django Girls Bauchi 
wrote:

> Holla
> Wants to create a simple django api, that send specific data(using
> postman) and receive response. Yeah its simple, but simple tend hard on me
> this days, anyone to help out, urgently.
>
> 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/CADJBrQ9UX08GgRdB4MR5sFa964Uh086zWDyXaKYxCk3Q7o1R9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: This site can’t be reached 127.0.0.1 refused to connect.

2018-06-05 Thread James Farris
What’s the actual error?

Did you mean ALLOWED_HOSTS? If so you can just add:
ALLOWED_HOSTS=[‘*’]

On Tue, Jun 5, 2018 at 12:55 PM Jamie Roberts 
wrote:

> Hi,
>
> This is from memory and may not be your problem but ... I had to add
> 127.0.0.1 to ALLOWED_USERS in settings.py
>
> Sent from my iPhone
>
> On 5 Jun 2018, at 16:38, Avitab Ayan Sarmah  wrote:
>
> While going through the turolal 7 of the django project, couldn't connect
> to the url.Please comment why my local host refused to connect
>
> --
> 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/e948142e-163f-4a82-bc91-46c16c292c5d%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/93BADF4F-E86D-47B7-9034-1D61408850D6%40gmail.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/CAE-E-_0fGD-7a%3DY4w-%2BjvR%3DZ3Zj6QdyRmZgc9PDWjXuaW_gX2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Simple django api

2018-06-05 Thread Django Girls Bauchi
Holla
Wants to create a simple django api, that send specific data(using postman)
and receive response. Yeah its simple, but simple tend hard on me this
days, anyone to help out, urgently.

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/CADJBrQ9X23OOF0RM7wC7%2BYPMweYNvJft7s0ODx4sY0ZOaj6G%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to work with established postgresql database with multiple schemas in Django?

2018-06-05 Thread G.R. Nobles


I'm trying to develop a django interface for an existing postgresql db, the 
db makes use of various schemas, looking at the literature the following 
example should work, but it only returns the schema defined in the default 
database when I run python manage.py inspectdb. Also when this works, how 
do I define which schema to use when defining the django model?


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'OPTIONS' : {
'options': '-c search_path=public'
},
'NAME': 'gygaia',
'USER':'postgres',
'PASSWORD':'abc',
'HOST':'localhost',
'PORT':'5432',},
'samples': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'OPTIONS' : {
'options': '-c search_path=samples'
},
'NAME': 'gygaia',
'USER':'postgres',
'PASSWORD':'abc',
'HOST':'localhost',
'PORT':'5432',},
'excavation': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'OPTIONS' : {
'options': '-c search_path=excavation'
},
'NAME': 'gygaia',
'USER':'postgres',
'PASSWORD':'abc',
'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/b9cfca9e-11c9-40e8-8e8c-1436cc2fdc1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Inlineformset without foreign key possible?

2018-06-05 Thread HashRocketSyntax
Thank you for pointing me in the right direction =) looks like that class 
is more generic. 



On Tuesday, June 5, 2018 at 9:08:35 PM UTC, Matthew Pava wrote:
>
> I’m not able to wrap my head around your specific application, but if you 
> don’t want to use a ForeignKey on a formset, don’t use an InlineFormset.
>
> Just use a regular BaseFormset.
>
> https://docs.djangoproject.com/en/2.0/topics/forms/formsets/
>

-- 
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/50ce8098-0a00-439a-bdbf-57f340117f20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Inlineformset without foreign key possible?

2018-06-05 Thread Matthew Pava
I’m not able to wrap my head around your specific application, but if you don’t 
want to use a ForeignKey on a formset, don’t use an InlineFormset.
Just use a regular BaseFormset.
https://docs.djangoproject.com/en/2.0/topics/forms/formsets/


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Layne Sadler
Sent: Tuesday, June 5, 2018 4:04 PM
To: Django users
Subject: Inlineformset without foreign key possible?


I'm trying to implement an inline formset for two models in a graph database. 
The problem that I'm running into is that formsets are designed with foreign 
keys in mind.



I'm relating a model to itself through another model. For simplicity sake, 
let's call them a Person model and a FriendRel model:

Person -[FRIENDS_WITH]-> Person

FriendRelFormSet = inlineformset_factory(Person, FriendRel, form=FriendRelForm, 
extra=1)



I've tried setting the fk_name=None argument, but I am still met with the 
following error:



ValueError: 'django_rel.RelationshipMeta' has no ForeignKey to 
'django_node.NodeMeta'.



So now I am looking into the documentation below, but it is a bit abstract for 
my skillset. Am I banging my head against the wall with this, or is it possible 
to avoid the whole foreign key thing?

Overriding methods on an InlineFormSet   
https://docs.djangoproject.com/en/2.0/topics/forms/modelforms/#overriding-methods-on-an-inlineformset
--
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/dcbe2177-6593-4b6d-b0a6-6a9af3813f19%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/c0bc1272ab194885839c717a29977411%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Inlineformset without foreign key possible?

2018-06-05 Thread Layne Sadler


I'm trying to implement an *inline formset for two models in a graph 
database*. The problem that I'm running into is that formsets are designed 
with *foreign keys* in mind.


I'm relating a model to itself through another model. For simplicity sake, 
let's call them a Person model and a FriendRel model:

Person -[FRIENDS_WITH]-> Person

FriendRelFormSet = inlineformset_factory(Person, FriendRel, form=FriendRelForm, 
extra=1)


I've tried setting the fk_name=None argument, but I am still met with the 
following error:


ValueError: 'django_rel.RelationshipMeta' has no ForeignKey to 
'django_node.NodeMeta'.


So now I am looking into the documentation below, but it is a bit abstract 
for my skillset. Am I banging my head against the wall with this, or is it 
possible to avoid the whole foreign key thing?

*Overriding methods on an InlineFormSet*   
https://docs.djangoproject.com/en/2.0/topics/forms/modelforms/#overriding-methods-on-an-inlineformset

-- 
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/dcbe2177-6593-4b6d-b0a6-6a9af3813f19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Accessing the model attribute of UpdateView & friends

2018-06-05 Thread Andréas Kühne
Hi,

Have you tried self.model? It should be present in all methods in the class?

Regards,

Andréas

2018-06-05 21:56 GMT+02:00 Mikkel Kromann :

> Dear Django-users.
>
> I'm slowly working towards a Django "data-warehouse" framework, where I
> can easily add a lot of models (each containing a table with data), while
> sticking to only few reusable views.
>
> I've realised that in urls.py, it is possible to specify the model on
> which the UpdateView is going to do its magic.
> This allows me to use a generic UpdateView (which I called ItemUpdateView)
> and template for all my models, which will save me a ton of almost
> identical lines of code.
>
> However, in the generic ItemUpdateView, I of course need to specify the
> fields of the specific model chosen in urls.py.
> As I ideally only want a few generic views (i.e. ItemCreateView,
> ItemUpdateView, ItemDeleteView and ItemListView), I've chosen to place the
> field array in my model definition, hoping to be able to access it from my
> generic Class Based Views
>
> But how do I access the model attribute in (Item)UpdateView
>
>
> thanks, Mikkel
>
> From views.py
> from django.views.generic import CreateView, ListView, UpdateView,
> DeleteView
>
> class ItemUpdateView(UpdateView):
> template_name = "item_form.html"
> # How do I access the model attribute of ItemUpdateView as given in
> urls.py?
> # This line below returns the error "NameError: name 'model' not defined"
> fields = model.fields
>
> From urls.py
> from django.urls import path
> from . views import ItemUpdate
> from . models import Region, Location
>
> # Awesome! I can specify the model to be used by ItemUpdateView
> urlpatterns = [
> path('update/region/',ItemUpdateView.as_view(model=Region),
>   name='region_update'),
> path('update/location/',  ItemUpdateView.as_view(model=Location),
>   name='location_update'),
> ]
>
>
>
> From models.py (Region and Location are only two of my tables, I'd like to
> have say 20 or 30 models
> from django.db import models
>
> # Abstract class for our items including common methods, data and
> definitions
> class ItemModel(models.Model):
>
> fields = [ 'label', 'short', 'descr' ]
> label   = models.CharField(max_length=10)
> short   = models.CharField(max_length=15)
> descr   = models.CharField(max_length=40)
>
> def __str__(self):
> return self.short
>
> class Meta:
> abstract = True
>
> class Region(ItemModel):
> fields  = [ 'label', 'short', 'descr' ]
>
> class Location(ItemModel):
> fields  = [ 'label', 'short', 'descr', 'region' ]
> region  = models.ForeignKey(Region, on_delete=models.CASCADE)
>
> class Plant(ItemModel):
> fields  = [ 'label', 'short', 'descr', 'location', 'capex', 'opex',
> 'capacity' ]
> location= models.ForeignKey(Location, on_delete=models.CASCADE)
> capex   = models.DecimalField(decimal_places=3, max_digits=8)
> opex= models.DecimalField(decimal_places=3, max_digits=8)
> capacity= models.DecimalField(decimal_places=3, max_digits=8)
>
>
> --
> 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/ec4634e5-2279-49a7-9045-21712de87584%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/CAK4qSCejxaTZW1j--Pmtjn1CYvexvNXZ-9YN4wyuiv4jBjcNUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Accessing the model attribute of UpdateView & friends

2018-06-05 Thread Mikkel Kromann
Dear Django-users.

I'm slowly working towards a Django "data-warehouse" framework, where I can 
easily add a lot of models (each containing a table with data), while 
sticking to only few reusable views.

I've realised that in urls.py, it is possible to specify the model on which 
the UpdateView is going to do its magic.
This allows me to use a generic UpdateView (which I called ItemUpdateView) 
and template for all my models, which will save me a ton of almost 
identical lines of code.

However, in the generic ItemUpdateView, I of course need to specify the 
fields of the specific model chosen in urls.py.
As I ideally only want a few generic views (i.e. ItemCreateView, 
ItemUpdateView, ItemDeleteView and ItemListView), I've chosen to place the 
field array in my model definition, hoping to be able to access it from my 
generic Class Based Views

But how do I access the model attribute in (Item)UpdateView


thanks, Mikkel

>From views.py
from django.views.generic import CreateView, ListView, UpdateView, 
DeleteView

class ItemUpdateView(UpdateView):
template_name = "item_form.html"
# How do I access the model attribute of ItemUpdateView as given in urls.py?
# This line below returns the error "NameError: name 'model' not defined"
fields = model.fields

>From urls.py
from django.urls import path
from . views import ItemUpdate
from . models import Region, Location

# Awesome! I can specify the model to be used by ItemUpdateView
urlpatterns = [
path('update/region/',ItemUpdateView.as_view(model=Region), 
name='region_update'),
path('update/location/',  ItemUpdateView.as_view(model=Location),   
name='location_update'),
] 



>From models.py (Region and Location are only two of my tables, I'd like to 
have say 20 or 30 models 
from django.db import models

# Abstract class for our items including common methods, data and 
definitions
class ItemModel(models.Model):

fields = [ 'label', 'short', 'descr' ]
label   = models.CharField(max_length=10)
short   = models.CharField(max_length=15)
descr   = models.CharField(max_length=40)

def __str__(self):
return self.short

class Meta:
abstract = True

class Region(ItemModel):
fields  = [ 'label', 'short', 'descr' ]

class Location(ItemModel):
fields  = [ 'label', 'short', 'descr', 'region' ]
region  = models.ForeignKey(Region, on_delete=models.CASCADE)

class Plant(ItemModel):
fields  = [ 'label', 'short', 'descr', 'location', 'capex', 'opex', 
'capacity' ]
location= models.ForeignKey(Location, on_delete=models.CASCADE)
capex   = models.DecimalField(decimal_places=3, max_digits=8)
opex= models.DecimalField(decimal_places=3, max_digits=8)
capacity= models.DecimalField(decimal_places=3, max_digits=8)


-- 
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/ec4634e5-2279-49a7-9045-21712de87584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: This site can’t be reached 127.0.0.1 refused to connect.

2018-06-05 Thread Jamie Roberts
Hi,

This is from memory and may not be your problem but ... I had to add 127.0.0.1 
to ALLOWED_USERS in settings.py

Sent from my iPhone

> On 5 Jun 2018, at 16:38, Avitab Ayan Sarmah  wrote:
> 
> While going through the turolal 7 of the django project, couldn't connect to 
> the url.Please comment why my local host refused to connect
> -- 
> 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/e948142e-163f-4a82-bc91-46c16c292c5d%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/93BADF4F-E86D-47B7-9034-1D61408850D6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: A calendar booking app

2018-06-05 Thread Kasper Laudrup

Hi Carlos,

On 2018-06-05 18:59, carlos wrote:

Hi, maybe try use

https://github.com/llazzaro/django-scheduler

https://github.com/bitlabstudio/django-booking

or find here
https://djangopackages.org/



I have looked at both these apps and the djangopackages website, but 
admittedly, I haven't actually tried to use anything yet.


Just wanted to know if someone had any experience with anything like 
that, but thanks a lot for your pointers.


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 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/b1856389-c812-0dda-7572-621b767f6607%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: A calendar booking app

2018-06-05 Thread Spence Patrick
I use Google calendar for a booking app that changes events in a public
calendar for everyone to see

On Tue, Jun 5, 2018, 06:33 Kasper Laudrup  wrote:

> Hi fellow Django users,
>
> I'm planning to start up a homepage for my familys summer house.
>
> There are a few ideas of what should be there, user management, possibly
> "blog like" entries, a photo gallery etc. I think I've found some pretty
> good existing Django apps for that, so that shouldn't be a problem to
> integrate them together somehow.
>
> A really cool feature though, would be to have some kind of
> reservation/booking system where any (authenticated) user can see when
> the house has been reserved and when it's available.
>
> Ideally, a non-admin user can request a range of dates, and an admin can
> then accept or decline that request. Naturally, there can only be one
> reservation on a range of dates.
>
> I have found a few calendar/booking like applications, but I'm not sure
> if any of them really fits my purpose.
>
> I could write all the code myself, but it would be a lot easier for me
> if an existing project already supports something similar that I could
> integrate.
>
> Anyone who has any experience with doing something that or could
> recommend where I should look?
>
> Thanks a lot!
>
> 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 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/7c77a814-7416-91ce-25db-1b3f0f22bd03%40stacktrace.dk
> .
> 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/CAD6-5Ci0YMo1HuwLazKHPqCVWdVCdO3%2BzEvgpkMBYF3mHGNt9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: A calendar booking app

2018-06-05 Thread carlos
Hi, maybe try use

https://github.com/llazzaro/django-scheduler

https://github.com/bitlabstudio/django-booking

or find here
https://djangopackages.org/

On Tue, Jun 5, 2018 at 9:34 AM, Dan Tagg  wrote:

> I'm looking for the same thing Kasper -- Django based not PHP.
>
> Dan
>
> On 5 June 2018 at 13:32, Kasper Laudrup  wrote:
>
>> Hi fellow Django users,
>>
>> I'm planning to start up a homepage for my familys summer house.
>>
>> There are a few ideas of what should be there, user management, possibly
>> "blog like" entries, a photo gallery etc. I think I've found some pretty
>> good existing Django apps for that, so that shouldn't be a problem to
>> integrate them together somehow.
>>
>> A really cool feature though, would be to have some kind of
>> reservation/booking system where any (authenticated) user can see when the
>> house has been reserved and when it's available.
>>
>> Ideally, a non-admin user can request a range of dates, and an admin can
>> then accept or decline that request. Naturally, there can only be one
>> reservation on a range of dates.
>>
>> I have found a few calendar/booking like applications, but I'm not sure
>> if any of them really fits my purpose.
>>
>> I could write all the code myself, but it would be a lot easier for me if
>> an existing project already supports something similar that I could
>> integrate.
>>
>> Anyone who has any experience with doing something that or could
>> recommend where I should look?
>>
>> Thanks a lot!
>>
>> 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 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/ms
>> gid/django-users/7c77a814-7416-91ce-25db-1b3f0f22bd03%40stacktrace.dk.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Wildman and Herring Limited, Registered Office: 28 Brock Street, Bath,
> United Kingdom, BA1 2LN
> 
> , Company no: 05766374
>
> --
> 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/CAPZHCY6bO9hKhQNzHuDz_-L6JiWFfCCk6hJr9uxbMhy9%
> 2BWvZnA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
att.
Carlos Rocha

-- 
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/CAM-7rO1QU390%3DPQSG7ByT-S1PdVnW_7Fpiwy%3DyMU7Yznz%2Bwpbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


This site can’t be reached 127.0.0.1 refused to connect.

2018-06-05 Thread Avitab Ayan Sarmah
While going through the turolal 7 of the django project, couldn't connect 
to the url.Please comment why my local host refused to connect

-- 
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/e948142e-163f-4a82-bc91-46c16c292c5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A calendar booking app

2018-06-05 Thread Dan Tagg
I'm looking for the same thing Kasper -- Django based not PHP.

Dan

On 5 June 2018 at 13:32, Kasper Laudrup  wrote:

> Hi fellow Django users,
>
> I'm planning to start up a homepage for my familys summer house.
>
> There are a few ideas of what should be there, user management, possibly
> "blog like" entries, a photo gallery etc. I think I've found some pretty
> good existing Django apps for that, so that shouldn't be a problem to
> integrate them together somehow.
>
> A really cool feature though, would be to have some kind of
> reservation/booking system where any (authenticated) user can see when the
> house has been reserved and when it's available.
>
> Ideally, a non-admin user can request a range of dates, and an admin can
> then accept or decline that request. Naturally, there can only be one
> reservation on a range of dates.
>
> I have found a few calendar/booking like applications, but I'm not sure if
> any of them really fits my purpose.
>
> I could write all the code myself, but it would be a lot easier for me if
> an existing project already supports something similar that I could
> integrate.
>
> Anyone who has any experience with doing something that or could recommend
> where I should look?
>
> Thanks a lot!
>
> 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 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/ms
> gid/django-users/7c77a814-7416-91ce-25db-1b3f0f22bd03%40stacktrace.dk.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Wildman and Herring Limited, Registered Office: 28 Brock Street, Bath,
United Kingdom, BA1 2LN, Company no: 05766374

-- 
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/CAPZHCY6bO9hKhQNzHuDz_-L6JiWFfCCk6hJr9uxbMhy9%2BWvZnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: A calendar booking app

2018-06-05 Thread Kasper Laudrup

On 2018-06-05 14:38, HaatBhaar Developer wrote:
I have an webapp for that. Where you can achieve your requirement, but 
that is in the PHP code. If this is acceptable for you, then we can do 
further communication accordingly.


Hi there,

Thanks for the input, but I really don't want to use PHP for this (or 
anything for that matter :-)), but thanks anyway.


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 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/0c17eb41-e75a-1761-cb41-d6550eea28b8%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: A calendar booking app

2018-06-05 Thread HaatBhaar Developer
Dude,
I have an webapp for that. Where you can achieve your requirement, but that
is in the PHP code. If this is acceptable for you, then we can do further
communication accordingly.
Hope we will be in the same track.

On 5 June 2018 at 18:02, Kasper Laudrup  wrote:

> Hi fellow Django users,
>
> I'm planning to start up a homepage for my familys summer house.
>
> There are a few ideas of what should be there, user management, possibly
> "blog like" entries, a photo gallery etc. I think I've found some pretty
> good existing Django apps for that, so that shouldn't be a problem to
> integrate them together somehow.
>
> A really cool feature though, would be to have some kind of
> reservation/booking system where any (authenticated) user can see when the
> house has been reserved and when it's available.
>
> Ideally, a non-admin user can request a range of dates, and an admin can
> then accept or decline that request. Naturally, there can only be one
> reservation on a range of dates.
>
> I have found a few calendar/booking like applications, but I'm not sure if
> any of them really fits my purpose.
>
> I could write all the code myself, but it would be a lot easier for me if
> an existing project already supports something similar that I could
> integrate.
>
> Anyone who has any experience with doing something that or could recommend
> where I should look?
>
> Thanks a lot!
>
> 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 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/ms
> gid/django-users/7c77a814-7416-91ce-25db-1b3f0f22bd03%40stacktrace.dk.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Hello,

Thanks and Warm Regards
---
HaatBhaar Team | +91-906-708-0040 <(906)%20708-0040>
--
Sabka *HaatBhaar*, Sabka *Udhaar*!

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


Re: Upload video with automatically created thumbnail in Django 2

2018-06-05 Thread HaatBhaar Developer
Hello dude,
I wish I could solved your problem. But right now I don't have that idea.
Hope fully I will find that for you and will give the solution.
May your next problem I can solve.

On 5 June 2018 at 17:40, Pravin Yadav  wrote:

> I want to upload .mp4 and .mov videos in my django website with automatic
> thumbnail generation. Thumbnails should be created in .jpg or .png that
> will be saved in ImageField and also video in FileField.
>
> I'm using Python 3.6.1 and Django 2.0.
>
> Please advise me how to create a video similar to youtube.
>
> Is there any opensource modules/plugins available for this this ?
>
> Kindly, Help me.
>
>
> Thanks,
>
>
> Pravin Yadav
>
>
>
> --
> 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/1713df71-5a64-48dd-9951-e65bf8367cd0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Hello,

Thanks and Warm Regards
---
HaatBhaar Team | +91-906-708-0040 <(906)%20708-0040>
--
Sabka *HaatBhaar*, Sabka *Udhaar*!

-- 
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/CACNYMYqvko%2BNng%2BA%3DPgxDaUpyXAKYshbeo2RoousX6c3xn7M8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: App not Defined - Getting Started

2018-06-05 Thread Sadialiou Diallo
you must replace the

> path('polls/',include(polls.
> urls)),
>

by 
path('polls/',include("polls.
urls")),

because the polls is not a variable,it is a name of application

-- 
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/ac653dfe-4cb4-44ee-8050-e49b9d169c9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


A calendar booking app

2018-06-05 Thread Kasper Laudrup

Hi fellow Django users,

I'm planning to start up a homepage for my familys summer house.

There are a few ideas of what should be there, user management, possibly 
"blog like" entries, a photo gallery etc. I think I've found some pretty 
good existing Django apps for that, so that shouldn't be a problem to 
integrate them together somehow.


A really cool feature though, would be to have some kind of 
reservation/booking system where any (authenticated) user can see when 
the house has been reserved and when it's available.


Ideally, a non-admin user can request a range of dates, and an admin can 
then accept or decline that request. Naturally, there can only be one 
reservation on a range of dates.


I have found a few calendar/booking like applications, but I'm not sure 
if any of them really fits my purpose.


I could write all the code myself, but it would be a lot easier for me 
if an existing project already supports something similar that I could 
integrate.


Anyone who has any experience with doing something that or could 
recommend where I should look?


Thanks a lot!

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 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/7c77a814-7416-91ce-25db-1b3f0f22bd03%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Sponsor subdomain pointing to part of our Django site?

2018-06-05 Thread Richard Brockie
Hi James,

On Tue, Jun 5, 2018 at 2:19 PM James Schneider 
wrote:

> On Mon, Jun 4, 2018, 12:37 PM Melvyn Sopacua 
> wrote:
>
>> Aha! Now I get it! This should be solveable at the WSGI layer:
>>
>>
>>
>> PATH_INFO
>>
>> The remainder of the request URL's "path", designating the virtual
>> "location" of the request's target within the application. This may be
>> an empty string, if the request URL targets the application root and does
>> not have a trailing slash.
>>
>>
>>
>> See https://www.python.org/dev/peps/pep-0333/
>>
>>
>>
>> A URL rewrite or proxy at the webserver level should work as well. It may
>> take a bit of experimenting.
>>
>
> Would URL rewrites solve this? How does that affect URL's generated in the
> template?
>

I also don't think this works for the outbound traffic for the html urls.

It sounds like a separate 'site' with the sites framework is needed, along
> with a modified urls.py that does not include the year and slug in the path.
>

I don't think I need to do this: assuming the subdomain.sponsor.url
resolves correctly to include the required path, this is already taken care
of.


> Your might be able to use the existing urls.py by making the year and slug
> optional in the regex. When using the sponsored site, you would pass along
> extra context to the URL dispatcher that includes the year/slug or whatever
> data is being assumed by the usage of the sponsor URL.
>

I think I follow what you're suggesting. However, I think this would
require a wholesale redesign of urls.py and I'm not clear I can see how
this might work given all the other functions that are already in place.
I'll ponder a little more as our urls.py could benefit from a major
scrub/refactor. If we could get this to work in the urls.py, then I think
we are done.

Failing that, I'm now wondering if there is something we can do to call and
modify the output of {% url %} and reverse() ourselves? I think there is
essentially a worked example in django-hosts (
https://github.com/jazzband/django-hosts). Maybe that these functions are
emulated in django-hosts is a hint that urls.py is not the way to go?


> Basically, you need two different paths to the same resource, dependent on
> the domain name or site in question.
>
> Why not just leave the year and slug in and save yourself the extra work?
> Is the vanity path a requirement or just 'nice to have'?
>

If we do implement this, the vanity path is a requirement as
subdomain.sponsor.url essentially duplicates the /year/slug/ part of the
path. There are other parts of our site that we could in future want to
associate with other sponsors in a similar manner, so the /year/slug/ must
go!

Thanks for helping me think this through,
-- 
R.

Richard Brockie

Real-time bicycle race results - www.ontheday.net

-- 
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/CAKv-vOWO0Q7NS8q%3DkfP2RuwnSK-998fdAynKT3q2Jcae0ODMHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: calculate the followers difference/grow by day

2018-06-05 Thread James Farris
I think you can do something like this

stats = Statistics.objects.all().order_by('-last_update')
latest_stat = 0
for stat in stats:
print(abs(latest_stat - stat.followers))
latest_stat = stat.followers

On Mon, Jun 4, 2018 at 11:24 AM, Daniel Germano Travieso <
danielgtravi...@gmail.com> wrote:

> Hello!
> I don't quite understand what you mean by the followers difference by day,
> but as that difference by day is not a property of each model tuple, but a
> property of a specific day, you can write a view to handle that processing.
> Custom model Managers are used to either add manager methods or to
> customize and change the QuerySet your model returns. If you wish to use
> the model manager for this, it could be used to add a field to your model
> that makes a query to the last followers on that day and calculates the
> difference (?). You could also use a @property on your Model class for that
> too.
>
> Hope it helps!
>
> *[]'s*
> *Daniel Germano Travieso*
> *Engenharia da Computação Turma: 013*
> *Unicamp*
>
> On Thu, May 31, 2018 at 11:14 AM, João Paulo 
> wrote:
>
>>
>> Hey guys,
>>
>> I´m using SQLite and trying to calculate the followers difference by day
>>
>> This is my model:
>>
>> class Statistics(models.Model):
>> followers = models.IntegerField()
>> last_update = models.DateTimeField(auto_now_add=True)
>>
>> This are my database rows:
>>
>> "6" "50" "*2018-05-29* 00:25:48.276102"
>> "1" "100" "*2018-05-29* 00:26:48.276102"
>> "3" "200" "*2018-05-30* 00:27:04.178444"
>> "5" "250" "*2018-05-30* 00:30:04.178444"
>> "4" "300" "*2018-05-31* 00:27:04.178444"
>>
>> And the result I´m tryting to achieve is:
>>
>> followers | last_update
>> 150
>> *2018-05-30*50
>>
>> *2018-05-31*
>> *# I´m new to Django and thinking about use a Manager, but don't know
>> if´s doable using a Manager# Does anyone has a suggestion ?*
>>
>> --
>> 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/ms
>> gid/django-users/3196a628-a53f-41ac-bcbf-6cc8b8a66016%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/CABF8kZNYHY8zWYNw3WKTxLMcnsxxD
> U9hPAep4wpzk9i4c-veRg%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/CAE-E-_0j3r6g-DHrhif9P_HhpKHCPDohuS6jn86_XPzcg4zFJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: error: can not import the name 'path'

2018-06-05 Thread James Farris
As the previous reply suggests, what Django version are you using?
Using django.conf.urls is a Django 1.11 and below utility function,

Django 2.x uses this
from django.urls import path

*If you are using Django 1.x* this is what your urls.py should look like:

from django.conf.urls import urlfrom django.contrib import admin
from . import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^index/', views.index, name="index"),]

*If you're using Django 2.x* this is what your urls.py should look like

from django.urls import pathfrom django.contrib import admin
from . import views
urlpatterns = [
path('admin/', admin.site.urls),
path('index/', views.index, name="index"),]









On Mon, Jun 4, 2018 at 3:12 PM, Aphiso Media  wrote:

> Whats version are you using? Im on mobile so i cant open urls.py.
>
> If you're using a version earlier than 2.0 you need to use url instead of
> path.
>
> Do you have from django.urls import path?
>
> On Mon, Jun 4, 2018, 4:29 PM anguboy  wrote:
>
>> i am new in django, so in my first app ,am stack at mapping the URL and I
>> get an error that can not import name 'path' ,,which is in the tmn(my_app)
>> folder , 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/88ca007c-c716-4050-a7ce-7bb1b7214fe0%
>> 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/CAJiup7FSUuROtUXyArQqVgFTfOSnf9oBn-zY6TFWyttib%2B5g-Q%
> 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/CAE-E-_33zTiPH4sDNc1mY1X0N_RD6nmGzTGfWODKDfzeULrytw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.