Re: Custom Django Admin Pages

2018-08-21 Thread Jani Tiainen
Hi.

Admin is designed to be datacentric view to your models, namely providing
simple CRUD ops to your data.

If you want something else which involves your business requirements and
logic, generic class based views do help there. But in any case, you should
build your own management console for your business needs.

On Tue, Aug 21, 2018 at 6:40 AM, 'Kyle Mulka' via Django users <
django-users@googlegroups.com> wrote:

> Hi there,
>
> It seems like Django Admin is designed to work with Django models. But,
> I'm wondering what the best way is to create custom admin pages that don't
> revolve around Django models. Like, maybe there's a third party API that I
> want admins to be able to call from the Django admin. What's the best way
> to get custom pages to show up and render in the Django admin?
>
> Thanks,
>
> Kyle
>
> --
> 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/57ccf869-829c-4ed4-881b-3b2031834bee%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

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


Django ModelForm Foreign Key Dropdown passes __str__ but stores fkey_id

2018-08-21 Thread HiMAnsHu
Guys I need quick help.

There are two models and I would like to store a column field from one
model to another model.

models.py:

class Company(models.Model):
   name = ...
 def __str__(self):
 return self.name
class Rate(models.Model):
   company = models.ForeignKey(Company)
   currency = ...
   name = ...

 def __str__(self):
 return self.name + " " + self.currency
class Client(models.Model):
   name = ...
   currency = 
   company = models.ForeignKey(Company)
   base_rate = models.ForeignKey(Rate)

 def __str__(self):
 return self.name

forms.py:

class ClientForm(forms.ModelForm):
class Meta:
model = Client
fields = (
   "name",
   "company",
   "base_rate", )

views.py:

class ClientCreateView(FormView):
template_name = "client/new_package.html"
form_class = ClientForm
success_url = reverse_lazy("home")

def form_valid(self, form):
detail = form.save(commit=False)
base_rate_id = form.cleaned_data['base_rate']
detail.currency = Rate.objects.values_list("currency",
flat=True).filter(base_rate_id=base_rate_id)
detail.save()

if detail is not None:
return redirect('display_package' , detail.id)
else:
return super(ClientCreateView, self).form_valid(form)

Basically, I want selected currency value to be saved in my client model
from Rate model. Any help will be appreciated as from cleaned data I am
getting *str* returned value instead of selected option id value (i.e. *str*
from client model ).


StackOverflow Link:
https://stackoverflow.com/questions/51947018/django-modelform-foreign-key-dropdown-passes-str-but-stores-fkey-id

Regards and Thanks,
Himanshu | hmn...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJz1rM%2BsK6XN_xJVfqbXAos4WgAVOW9VLy-WZjCT3XFNuP%3DZkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Foreign key issue

2018-08-21 Thread Akshay Jain
Hello,

In my Django application, I want to use a foreign key from one db to
another. Is it possible? as I'm able to see the listing in /add endpoint
but when I try to save It says that the table doesn't exist.

Thanks
-- 
Regards,
Akshay Jain

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


Problem in the Django tutorial?

2018-08-21 Thread Alesh Houdek
I'm doing the Django tutorial and got stuck on the static files 
section: 
https://docs.djangoproject.com/en/2.1/intro/tutorial06/#customize-your-app-s-look-and-feel
 

Could not get the style.css file to work despite triple-checking 
everything. 

After much research, I got it to work by adding this to settings.py:

STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),)

-- 
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/f5e58b12-a8d2-4ad2-983b-856895a91eb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Foreign key issue

2018-08-21 Thread Jason
If you think about it, you might see why you could do this, but you'd lose 
everything related to referential integrity.  Nothing stopping you from 
making a router that behind the scenes uses multiple dbs seamlessly, but 
how would you handle changes from the other db in your own if you can't get 
notified of updates or deletes?  THat way, your own data can get very out 
of sync with the other db.


-- 
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/d9623fee-54bd-42d9-adf0-49ae184c3619%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem in the Django tutorial?

2018-08-21 Thread Daniel Hepper
That shouldn't be necessary, as the tutorial has you put the CSS file into
the static directory in your polls app, not your project. Static files in
your polls app should be found with the default settings:

Django’s STATICFILES_FINDERS
> 
>  setting contains a list of finders that know how to discover static
> files from various sources. One of the defaults is AppDirectoriesFinder which
> looks for a “static” subdirectory in each of the INSTALLED_APPS
> ,
> like the one in polls we just created. The admin site uses the same
> directory structure for its static files.


My guess is that you put your CSS file at static/polls/style.css (relative
to BASE_DIR) instead of polls/static/polls/style.css

Hope that helps,
Daniel


On Tue, Aug 21, 2018 at 2:01 PM Alesh Houdek  wrote:

> I'm doing the Django tutorial and got stuck on the static files section:
> https://docs.djangoproject.com/en/2.1/intro/tutorial06/#customize-your-app-s-look-and-feel
>
>
> Could not get the style.css file to work despite triple-checking
> everything.
>
> After much research, I got it to work by adding this to settings.py:
>
> STATICFILES_DIRS = (
> os.path.join(BASE_DIR, "static"),)
>
> --
> 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/f5e58b12-a8d2-4ad2-983b-856895a91eb4%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/CAHEnUVX33dr9di4doSe0_gqzdTEzK%3DsWtujR7%3DiUTJmUK_ysng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: problems with order by month

2018-08-21 Thread Matthew Pava
You can chain the methods.
cardio = Alumno.objects.filter ( fechanacimiento __month = 
now.month).order_by(‘fechanacimiento’)


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Osvaldo Ruso Olea
Sent: Monday, August 20, 2018 9:49 PM
To: django-users@googlegroups.com
Subject: Re: problems with order by month

You are a genius, thank you very much, it worked perfectly, I just made one 
more modification

def cardio (request):
 now = timezone.now ()
 cardio = Alumno.objects.filter ( fechanacimiento __month = now.month)
 context = {'cardio': cardio}
 return render (request, 'cardio.html', context)

What I can not do is sort the dates from lowest to highest,

Thank you very much

El lun., 20 ago. 2018 a las 19:03, Matthew Pava 
(mailto:matthew.p...@iss.com>>) escribió:
Try this:
cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month)

From: django-users@googlegroups.com 
[mailto:django-users@googlegroups.com] On 
Behalf Of Osvaldo Ruso Olea
Sent: Monday, August 20, 2018 2:58 PM
To: Django users
Subject: problems with order by month

Hi how are you, I have problems filtering and sorting by date, precisely per 
month.
my intention is to filter the database for birthdays in the current month.




def cardio(request):
cardio = Alumno.objects.order_by('fechanacimiento')
contexto = {'cardio':cardio}
return render(request, 'cardio.html', contexto)
--
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/e9f385a8-6b62-4e15-9020-9aa79ee7c48d%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/ae37d6672adc41f8bd4fc4187c27df80%40ISS1.ISS.LOCAL.
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/CAPJtaPDoPie6B4fVUyMKojNMfwYXrJqwU3ZyGm6ny3TdmHg46Q%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/546f450d00ad4d73bf993db6dcb5f2be%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Unable to migrate changes of model in database.

2018-08-21 Thread Roshan Jha
Hi All,

I had created a class based model with attributes.

The first migration went well and I could see the table in database
(postgres).

However, when I modified the model, the migration is unable to pick the
changes.

Any inputs would be highly appreciated.

Thanks,

Roshan | zaaroshan0...@gmail.com

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


Re: Unable to migrate changes of model in database.

2018-08-21 Thread Mikhailo Keda
Please show your code for models and provide more details about changes
that wasn't reflected
Did you have any errors or warnings? What version of Django are you using?

On Tue, Aug 21, 2018 at 4:42 PM Roshan Jha  wrote:

> Hi All,
>
> I had created a class based model with attributes.
>
> The first migration went well and I could see the table in database
> (postgres).
>
> However, when I modified the model, the migration is unable to pick the
> changes.
>
> Any inputs would be highly appreciated.
>
> Thanks,
>
> Roshan | zaaroshan0...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAC-MFAcob1c029EopVLtO3WkTtNnbTq-rOuzpyqog0Bh_pyfSw%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/CAOM-Qa0REUUOrAQkCSwzNY6pXcESsVaF7DJY1mbyrhjtqc4%2Baw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to migrate changes of model in database.

2018-08-21 Thread Mikhailo Keda

Please show your code for models and provide more details about changes 
that wasn't reflected
Did you have any errors or warnings? What version of Django are you using?
>
>

-- 
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/026da085-20cb-4b8f-b2d1-1a85b859ba8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multiple formsets and when posting associating them with an instance

2018-08-21 Thread David
Hi

I don't know if this is a common question, but I couldn't find anything 
resembling my problem.

I have a page called "Case". On this page some basic information is added 
along with the creation of 1 or 2 clients (fixed) Client's are FK to the 
Case model. These are added using inlineformset factory.

On the subsequent page, and the one with the problem, I need to query my 
Client model to see how many clients are associated with the Case. That 
determines how many formsets I should show. ie. 1 for 1 client, or 2 for 2 
clients.

I chose to use modelformset factory, instead of inline as I don't know how 
many clients exist.

Each formset is designed to associate family relatives to each client and 
are therefor FK'd to the Client. eg: Parent model contains FK to Client.

My very rudamentary code below achieves this, however my modelformset 
factories that I am using to generate the forms don't respect the 
"unique_together" constraint. I suspect this is because I am not passing an 
instance to the formset on post. But because for the sake of argument 
"Parent" instance may not exist and instead is being POST'd to create, I 
cannot specify an instance.


@login_required
def create_new_family(request, case_pk):
case = Case.objects.get(pk=case_pk)
clients = Client.objects.filter(case=case_pk)[:2]
formset = {}

for client in clients:
formset[client.pk] = {}
formset[client.pk] = {}

if request.method == 'POST':

for client in clients:
formset[client.pk]['parents'] = ParentsFormset(request.POST, prefix=
'parents_' + str(client.pk),)
formset[client.pk]['siblings'] = SiblingsFormset(request.POST, prefix=
'siblings_' + str(client.pk))
formset[client.pk]['children'] = ChildrenFormset(request.POST, prefix=
'children_' + str(client.pk))
formset[client.pk]['stepchildren'] = StepChildrenFormset(request.POST, 
prefix='stepchildren_' + str(client.pk))

err = 0
for client_id, fs_dict in formset.items():
if not all(form.is_valid() for fs_type, form in fs_dict.items()):
err = err + 1

if err == 0:
for client_id, fs_dict in formset.items(): # a is client_id ## b is formset 
dict
if all(form.is_valid() for fs_type, form in fs_dict.items()):
for idx, fs in fs_dict.items(): # at this point all fs are formset instances
if fs.is_valid():
instances = fs.save(commit=False)
for instance in instances:
instance.client = Client.objects.get(pk=client_id)
instance.save()

return HttpResponseRedirect(reverse('family-create', kwargs={'case_pk': 
case_pk}))
else:
for client in clients:
formset[client.pk]['parents'] = ParentsFormset(prefix='parents_' + 
str(client.pk),
queryset=Parent.objects.filter(client=client))
formset[client.pk]['siblings'] = SiblingsFormset(prefix='siblings_' + 
str(client.pk),
queryset=Sibling.objects.filter(client=client))
formset[client.pk]['children'] = ChildrenFormset(prefix='children_' + 
str(client.pk),
queryset=Children.objects.filter(client=client))
formset[client.pk]['stepchildren'] = StepChildrenFormset(prefix=
'stepchildren_' + str(client.pk),
queryset=StepChildren.objects.filter(client=client))

return render(request, 'clients/client_form.html', {
'formsets': formset,
'clients': clients,
'case': case,
'breadcrumbs': 'Family & Dependants'
})


I appreciate this might be difficult to comprehend, as it is for me to 
explain.

Any help would be much appreciated.

Thank you 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/17499d8a-c18f-4a68-9173-216a08649871%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple formsets and when posting associating them with an instance

2018-08-21 Thread David
Changing all modelformset factories to inlineformsets and then specifying 
an instance on both the post and get methods resolved this issue.

-- 
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/8f38004e-fe59-4d9d-b772-88c3b64886a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread Dario Coronel
Hola soy principiante en django y python y yo de Paraguay un país del que 
solo hablamos español y me disculpo por mi ortografía, entonces mi pregunta 
es sobre el MODO DEBUG = VERDADERO porque leí la documentación y entiendo 
que cuando el modo de depuración es cierto es muy importante desactivarlo 
debido a problemas de seguridad, pero cuando llegué a mi settings.py y 
apagué mi modo de depuración y luego voy a la consola y configuro los 
comandos "python manage.py runserver"
él solo mostró un error cuando dijo "Tu más estableces la configuración 
ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando 
apago mi modo de depuración

-- 
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/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread carlos
Hola Dario tenemos un grupo en español django...@googlegroups.com donde
podes hacer las preguntas en español
pero para contestarte pues bien por seguridad cuando vayas a poner en
produccion tu sitio desactiva el debug con falso y en el
alloed_host debes colocar o la ip de tu servidor o mejor el tu dominio ya
sea con www y sin www, si estas en modo desarrollador
nada de eso actives ya que estas en tu pc y con debug en verdadero para ver
depurar los errores

saludos

On Tue, Aug 21, 2018 at 10:26 AM Dario Coronel 
wrote:

> Hola soy principiante en django y python y yo de Paraguay un país del que
> solo hablamos español y me disculpo por mi ortografía, entonces mi pregunta
> es sobre el MODO DEBUG = VERDADERO porque leí la documentación y entiendo
> que cuando el modo de depuración es cierto es muy importante desactivarlo
> debido a problemas de seguridad, pero cuando llegué a mi settings.py y
> apagué mi modo de depuración y luego voy a la consola y configuro los
> comandos "python manage.py runserver"
> él solo mostró un error cuando dijo "Tu más estableces la configuración
> ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando
> apago mi modo de depuración
>
> --
> 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/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%40googlegroups.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-7rO3sSj5VPQgaLKBuatkW1zdpmxZrE%2B6LLHJ_79qRSwkLYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread Franklin Sarmiento
Saludos, el DEBUG  = True es para separar las configuraciones de lo que
sería un despliegue a producción y un ambiente local, el ALLOWED_HOST es un
settings para definir los dominios permitidos cuando estará en modo
producción, ( DEBUG = False practicamente es para ya funcionar en
producción ) si desactivas el DEBUG necesitas un dominio para funcionar, el
DEBUG te permite tener una traza de una excepción o de un error, si lo
desactivas, no tendras nada de eso, si al final no quieres usar el debug (
mala idea si estas desarrollando ) te recomiendo en tu ALLOWED_HOST agregar
el ip de tu maquina ejemplo:

ALLOWED_HOST = ['192.168.0.1']
DEBUG = False

Con eso ya podrías trabajar.

Saludos.

*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mar., 21 ago. 2018 a las 12:05, carlos ()
escribió:

> Hola Dario tenemos un grupo en español django...@googlegroups.com donde
> podes hacer las preguntas en español
> pero para contestarte pues bien por seguridad cuando vayas a poner en
> produccion tu sitio desactiva el debug con falso y en el
> alloed_host debes colocar o la ip de tu servidor o mejor el tu dominio ya
> sea con www y sin www, si estas en modo desarrollador
> nada de eso actives ya que estas en tu pc y con debug en verdadero para
> ver depurar los errores
>
> saludos
>
> On Tue, Aug 21, 2018 at 10:26 AM Dario Coronel 
> wrote:
>
>> Hola soy principiante en django y python y yo de Paraguay un país del que
>> solo hablamos español y me disculpo por mi ortografía, entonces mi pregunta
>> es sobre el MODO DEBUG = VERDADERO porque leí la documentación y entiendo
>> que cuando el modo de depuración es cierto es muy importante desactivarlo
>> debido a problemas de seguridad, pero cuando llegué a mi settings.py y
>> apagué mi modo de depuración y luego voy a la consola y configuro los
>> comandos "python manage.py runserver"
>> él solo mostró un error cuando dijo "Tu más estableces la configuración
>> ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando
>> apago mi modo de depuración
>>
>> --
>> 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/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%40googlegroups.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-7rO3sSj5VPQgaLKBuatkW1zdpmxZrE%2B6LLHJ_79qRSwkLYA%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/CAMsjBKLC_PbCUWtm%3D6b6a_wv39vx5Qo0GbN13aO8ngfDwn6MPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread Franklin Sarmiento
Aparte de eso necesitas agregar otras cosas por ejemplo el comando para
correr en la consola deberia ser asi:

$ python manage.py runserver 192.168.0.1

y en tu navegador cargarlo por ejemplo: http://192.168.0.1:8000

Ya con eso trabajarias con el DEBUG en False.

*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mar., 21 ago. 2018 a las 11:27, Dario Coronel ()
escribió:

> Hola soy principiante en django y python y yo de Paraguay un país del que
> solo hablamos español y me disculpo por mi ortografía, entonces mi pregunta
> es sobre el MODO DEBUG = VERDADERO porque leí la documentación y entiendo
> que cuando el modo de depuración es cierto es muy importante desactivarlo
> debido a problemas de seguridad, pero cuando llegué a mi settings.py y
> apagué mi modo de depuración y luego voy a la consola y configuro los
> comandos "python manage.py runserver"
> él solo mostró un error cuando dijo "Tu más estableces la configuración
> ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando
> apago mi modo de depuración
>
> --
> 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/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%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/CAMsjBK%2BH0i%3DX8Kw2-U2PSid3X-hCvgx0q525bLM0VE3SRAwPYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problems with order by month

2018-08-21 Thread Osvaldo Ruso Olea
I have problems ordering the date per day in ascending order.
thanks to your answer I have managed to filter the list for the current
month, but unfortunately it is sorted by year and not by day in ascending
order

def cardio(request):
now = timezone.now()
cardio =
Alumno.objects.filter(fechanacimiento__month=now.month).order_by("fechanacimiento")
contexto = {'cardio':cardio}
return render(request, 'cardio.html', contexto)

this is the result that I have achieved

Lista

   - *2 Ago. 1943*
* - 15 Ago. 1948- 28 Ago. 1948- 13 Ago. 1959- 21 Ago. 1962- 7 Ago. 1967- 5
   Ago. 1970- 24 Ago. 1970- 27 Ago. 1970- 5 Ago. 1971- 26 Ago. 1971- 2 Ago.
   1973- 4 Ago. 1973- 23 Ago. 1973- 11 Ago. 1977- 3 Ago. 1978- 23 Ago. 1979-
   27 Ago. 1980- 11 Ago. 1981- 8 Ago. 1982- 23 Ago. 1982- 23 Ago. 1982- 15
   Ago. 1983- 20 Ago. 1983- 15 Ago. 1984- 19 Ago. 1985- 8 Ago. 1986- 14 Ago.
   1986- 29 Ago. 1986- 5 Ago. 1988- 25 Ago. 1988- 31 Ago. 1988- 27 Ago. 1990-
   21 Ago. 1991- 22 Ago. 1991- 27 Ago. 1991- 14 Ago. 1992- 6 Ago. 1993- 13
   Ago. 1993*




El mar., 21 ago. 2018 a las 10:14, Matthew Pava ()
escribió:

> You can chain the methods.
>
> cardio = Alumno.objects.filter ( fechanacimiento __month =
> now.month).order_by(‘fechanacimiento’)
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 9:49 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: problems with order by month
>
>
>
> You are a genius, thank you very much, it worked perfectly, I just made
> one more modification
>
>
>
> def cardio (request):
>
>  now = timezone.now ()
>
>  cardio = Alumno.objects.filter ( fechanacimiento __month = now.month)
>
>  context = {'cardio': cardio}
>
>  return render (request, 'cardio.html', context)
>
>
>
> What I can not do is sort the dates from lowest to highest,
>
>
>
> Thank you very much
>
>
>
> El lun., 20 ago. 2018 a las 19:03, Matthew Pava ()
> escribió:
>
> Try this:
>
> cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month)
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 2:58 PM
> *To:* Django users
> *Subject:* problems with order by month
>
>
>
> Hi how are you, I have problems filtering and sorting by date, precisely
> per month.
>
> my intention is to filter the database for birthdays in the current month.
>
>
>
>
>
>
>
>
>
> def cardio(request):
>
> cardio = Alumno.objects.order_by('fechanacimiento')
>
> contexto = {'cardio':cardio}
>
> return render(request, 'cardio.html', contexto)
>
> --
> 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/e9f385a8-6b62-4e15-9020-9aa79ee7c48d%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/ae37d6672adc41f8bd4fc4187c27df80%40ISS1.ISS.LOCAL
> 
> .
> 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/CAPJtaPDoPie6B4fVUyMKojNMfwYXrJqwU3ZyGm6ny3TdmHg46Q%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
> "Djang

Re: problems with order by month

2018-08-21 Thread Franklin Sarmiento
The best solution is:

Alumno.objects.filter().order_by('fechanacimiento__month') if you
want to filter descending so with the "-" before the
"fechanacimiento__month" by example:

Alumno.objects.filter().order_by('-fechanacimiento__month') #
descending
Alumno.objects.filter().order_by('fechanacimiento__month') # by
default ascending.

Good look!.

*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mar., 21 ago. 2018 a las 8:15, Matthew Pava ()
escribió:

> You can chain the methods.
>
> cardio = Alumno.objects.filter ( fechanacimiento __month =
> now.month).order_by(‘fechanacimiento’)
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 9:49 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: problems with order by month
>
>
>
> You are a genius, thank you very much, it worked perfectly, I just made
> one more modification
>
>
>
> def cardio (request):
>
>  now = timezone.now ()
>
>  cardio = Alumno.objects.filter ( fechanacimiento __month = now.month)
>
>  context = {'cardio': cardio}
>
>  return render (request, 'cardio.html', context)
>
>
>
> What I can not do is sort the dates from lowest to highest,
>
>
>
> Thank you very much
>
>
>
> El lun., 20 ago. 2018 a las 19:03, Matthew Pava ()
> escribió:
>
> Try this:
>
> cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month)
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 2:58 PM
> *To:* Django users
> *Subject:* problems with order by month
>
>
>
> Hi how are you, I have problems filtering and sorting by date, precisely
> per month.
>
> my intention is to filter the database for birthdays in the current month.
>
>
>
>
>
>
>
>
>
> def cardio(request):
>
> cardio = Alumno.objects.order_by('fechanacimiento')
>
> contexto = {'cardio':cardio}
>
> return render(request, 'cardio.html', contexto)
>
> --
> 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/e9f385a8-6b62-4e15-9020-9aa79ee7c48d%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/ae37d6672adc41f8bd4fc4187c27df80%40ISS1.ISS.LOCAL
> 
> .
> 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/CAPJtaPDoPie6B4fVUyMKojNMfwYXrJqwU3ZyGm6ny3TdmHg46Q%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/546f

Re: problems with order by month

2018-08-21 Thread Franklin Sarmiento
Try this:

Alumno.objects.filter().order_by('fechanacimiento__month',
'fechanacimiento__day')

Alumno.objects.filter().order_by('fechanacimiento__month,
fechanacimiento__day')

Alumno.objects.filter().order_by('fechanacimiento__month').order_by('fechanacimiento__day')



*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mar., 21 ago. 2018 a las 12:57, Osvaldo Ruso Olea ()
escribió:

> I have problems ordering the date per day in ascending order.
> thanks to your answer I have managed to filter the list for the current
> month, but unfortunately it is sorted by year and not by day in ascending
> order
>
> def cardio(request):
> now = timezone.now()
> cardio =
> Alumno.objects.filter(fechanacimiento__month=now.month).order_by("fechanacimiento")
> contexto = {'cardio':cardio}
> return render(request, 'cardio.html', contexto)
>
> this is the result that I have achieved
>
> Lista
>
>- *2 Ago. 1943*
> * - 15 Ago. 1948- 28 Ago. 1948- 13 Ago. 1959- 21 Ago. 1962- 7 Ago. 1967- 5
>Ago. 1970- 24 Ago. 1970- 27 Ago. 1970- 5 Ago. 1971- 26 Ago. 1971- 2 Ago.
>1973- 4 Ago. 1973- 23 Ago. 1973- 11 Ago. 1977- 3 Ago. 1978- 23 Ago. 1979-
>27 Ago. 1980- 11 Ago. 1981- 8 Ago. 1982- 23 Ago. 1982- 23 Ago. 1982- 15
>Ago. 1983- 20 Ago. 1983- 15 Ago. 1984- 19 Ago. 1985- 8 Ago. 1986- 14 Ago.
>1986- 29 Ago. 1986- 5 Ago. 1988- 25 Ago. 1988- 31 Ago. 1988- 27 Ago. 1990-
>21 Ago. 1991- 22 Ago. 1991- 27 Ago. 1991- 14 Ago. 1992- 6 Ago. 1993- 13
>Ago. 1993*
>
>
>
>
> El mar., 21 ago. 2018 a las 10:14, Matthew Pava ()
> escribió:
>
>> You can chain the methods.
>>
>> cardio = Alumno.objects.filter ( fechanacimiento __month =
>> now.month).order_by(‘fechanacimiento’)
>>
>>
>>
>>
>>
>> *From:* django-users@googlegroups.com [mailto:
>> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
>> *Sent:* Monday, August 20, 2018 9:49 PM
>> *To:* django-users@googlegroups.com
>> *Subject:* Re: problems with order by month
>>
>>
>>
>> You are a genius, thank you very much, it worked perfectly, I just made
>> one more modification
>>
>>
>>
>> def cardio (request):
>>
>>  now = timezone.now ()
>>
>>  cardio = Alumno.objects.filter ( fechanacimiento __month = now.month)
>>
>>  context = {'cardio': cardio}
>>
>>  return render (request, 'cardio.html', context)
>>
>>
>>
>> What I can not do is sort the dates from lowest to highest,
>>
>>
>>
>> Thank you very much
>>
>>
>>
>> El lun., 20 ago. 2018 a las 19:03, Matthew Pava ()
>> escribió:
>>
>> Try this:
>>
>> cardio =
>> Alumno.objects.filter(fechanacimiento__month=timezone.now().month)
>>
>>
>>
>> *From:* django-users@googlegroups.com [mailto:
>> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
>> *Sent:* Monday, August 20, 2018 2:58 PM
>> *To:* Django users
>> *Subject:* problems with order by month
>>
>>
>>
>> Hi how are you, I have problems filtering and sorting by date, precisely
>> per month.
>>
>> my intention is to filter the database for birthdays in the current month.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> def cardio(request):
>>
>> cardio = Alumno.objects.order_by('fechanacimiento')
>>
>> contexto = {'cardio':cardio}
>>
>> return render(request, 'cardio.html', contexto)
>>
>> --
>> 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/e9f385a8-6b62-4e15-9020-9aa79ee7c48d%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/ae37d6672adc41f8bd4fc4187c27df80%40ISS1.ISS.LOCAL
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> Y

Re: What's the Better approach to do these?

2018-08-21 Thread Simon McConnell
There is some discussion on the topic here:

 
https://www.reddit.com/r/django/comments/8xcbtq/book_announcement_building_multi_tenant/

-- 
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/2704f317-0bf7-4a99-8ef6-264151f928e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread Dario Coronel
Mil gracias enserio!! me sirvio la respuesta ahora ya consegui trabajar 
sobre el me salio el erro 500 creo que ya ahi debo de configurar y crear 
mis directorios y mis views si no me equivoco?, una vez mas mil gracias

El martes, 21 de agosto de 2018, 13:46:17 (UTC-4), Franklin Sarmiento 
escribió:
>
> Aparte de eso necesitas agregar otras cosas por ejemplo el comando para 
> correr en la consola deberia ser asi:
>
> $ python manage.py runserver 192.168.0.1
>
> y en tu navegador cargarlo por ejemplo: http://192.168.0.1:8000 
>
> Ya con eso trabajarias con el DEBUG en False.
> 
> *Franklin Sarmiento*
> *Full-stack developer*
> *skype: franklin.s.dev*
> *Twitter: @franklinitiel*
> *linkedin: Franklin Sarmiento ( frankl...@gmail.com  )*
> *E-mail: frankl...@gmail.com *
> *Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*
>
>
>
> El mar., 21 ago. 2018 a las 11:27, Dario Coronel ( >) escribió:
>
>> Hola soy principiante en django y python y yo de Paraguay un país del que 
>> solo hablamos español y me disculpo por mi ortografía, entonces mi pregunta 
>> es sobre el MODO DEBUG = VERDADERO porque leí la documentación y entiendo 
>> que cuando el modo de depuración es cierto es muy importante desactivarlo 
>> debido a problemas de seguridad, pero cuando llegué a mi settings.py y 
>> apagué mi modo de depuración y luego voy a la consola y configuro los 
>> comandos "python manage.py runserver"
>> él solo mostró un error cuando dijo "Tu más estableces la configuración 
>> ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando 
>> apago mi modo de depuración
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%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/09234ef7-b9a5-4f5e-93e7-804fa65e3bf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread Dario Coronel
Ahora mismo me uniré te agradezco mucho la ayuda amigo

El martes, 21 de agosto de 2018, 13:05:39 (UTC-4), sacrac escribió:
>
> Hola Dario tenemos un grupo en español djan...@googlegroups.com 
>  donde podes hacer las preguntas en español
> pero para contestarte pues bien por seguridad cuando vayas a poner en 
> produccion tu sitio desactiva el debug con falso y en el
> alloed_host debes colocar o la ip de tu servidor o mejor el tu dominio ya 
> sea con www y sin www, si estas en modo desarrollador
> nada de eso actives ya que estas en tu pc y con debug en verdadero para 
> ver depurar los errores
>
> saludos
>
> On Tue, Aug 21, 2018 at 10:26 AM Dario Coronel  > wrote:
>
>> Hola soy principiante en django y python y yo de Paraguay un país del que 
>> solo hablamos español y me disculpo por mi ortografía, entonces mi pregunta 
>> es sobre el MODO DEBUG = VERDADERO porque leí la documentación y entiendo 
>> que cuando el modo de depuración es cierto es muy importante desactivarlo 
>> debido a problemas de seguridad, pero cuando llegué a mi settings.py y 
>> apagué mi modo de depuración y luego voy a la consola y configuro los 
>> comandos "python manage.py runserver"
>> él solo mostró un error cuando dijo "Tu más estableces la configuración 
>> ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando 
>> apago mi modo de depuración
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%40googlegroups.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/22ed4141-a455-49cb-94b7-d5f439962380%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problems with AbstractUser

2018-08-21 Thread Simon McConnell
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53940b17-ef8c-4b81-9509-7705312413cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SwaggerUI template override

2018-08-21 Thread Christian
I got it , it works as it is described, my fault.

Am Sonntag, 19. August 2018 17:57:15 UTC+2 schrieb Christian:
>
> Hi,
>
> I'm trying to use a customized version of index as describe here-
>
> https://django-rest-swagger.readthedocs.io/en/latest/customization/#customization
>
> I tried different places and settings in the TEMPLATE settings.py, but It 
> won't work.
>
>
> Thanks in advance
> Christian
>
>
>

-- 
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/a04b6c7a-e688-4268-a4a4-d111822abcc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MODO DEBUG = TRUE (problema a salir del modo de debu)

2018-08-21 Thread Franklin Sarmiento
Saludos, los views lo creas en una aplicación, con el comando ( ver abajo )
creas la aplicación donde defines tus modelos, tus vistas, tus
funcionalidades y es donde creas lo que va en la base de datos:

$ python manage.py startapp nombre_aplicacion



*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mar., 21 ago. 2018 a las 14:37, Dario Coronel ()
escribió:

> Ahora mismo me uniré te agradezco mucho la ayuda amigo
>
> El martes, 21 de agosto de 2018, 13:05:39 (UTC-4), sacrac escribió:
>>
>> Hola Dario tenemos un grupo en español djan...@googlegroups.com donde
>> podes hacer las preguntas en español
>> pero para contestarte pues bien por seguridad cuando vayas a poner en
>> produccion tu sitio desactiva el debug con falso y en el
>> alloed_host debes colocar o la ip de tu servidor o mejor el tu dominio ya
>> sea con www y sin www, si estas en modo desarrollador
>> nada de eso actives ya que estas en tu pc y con debug en verdadero para
>> ver depurar los errores
>>
>> saludos
>>
>> On Tue, Aug 21, 2018 at 10:26 AM Dario Coronel 
>> wrote:
>>
>>> Hola soy principiante en django y python y yo de Paraguay un país del
>>> que solo hablamos español y me disculpo por mi ortografía, entonces mi
>>> pregunta es sobre el MODO DEBUG = VERDADERO porque leí la documentación y
>>> entiendo que cuando el modo de depuración es cierto es muy importante
>>> desactivarlo debido a problemas de seguridad, pero cuando llegué a mi
>>> settings.py y apagué mi modo de depuración y luego voy a la consola y
>>> configuro los comandos "python manage.py runserver"
>>> él solo mostró un error cuando dijo "Tu más estableces la configuración
>>> ALLOWED_HOSTS si DEBUG es False" por qué no ejecuto mi servidor cuando
>>> apago mi modo de depuración
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/8e7f2ee5-7129-4ab4-8385-e1a6ea82c0a0%40googlegroups.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/22ed4141-a455-49cb-94b7-d5f439962380%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/CAMsjBKJQY68YOC_S-vizYE6FLdxq9VZjVUuC-xSFQNxd3H1hHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problems with order by month

2018-08-21 Thread Osvaldo Ruso Olea
try this but it did not work
Alumno.objects.filter().order_by('fechanacimiento__month') if you
want to filter descending so with the "-" before the
"fechanacimiento__month" by example:

Alumno.objects.filter().order_by('-fechanacimiento__month') #
descending
Alumno.objects.filter().order_by('fechanacimiento__month') # by
default ascending.

and then





Alumno.objects.filter().order_by('fechanacimiento__month',
'fechanacimiento__day')

Alumno.objects.filter().order_by('fechanacimiento__month,
fechanacimiento__day')

Alumno.objects.filter().order_by('fechanacimiento__month').order_by('fechanacimiento__day')



El mar., 21 ago. 2018 a las 14:59, Franklin Sarmiento (<
franklinit...@gmail.com>) escribió:

> Try this:
>
> Alumno.objects.filter().order_by('fechanacimiento__month',
> 'fechanacimiento__day')
>
> Alumno.objects.filter().order_by('fechanacimiento__month,
> fechanacimiento__day')
>
>
> Alumno.objects.filter().order_by('fechanacimiento__month').order_by('fechanacimiento__day')
>
>
> 
> *Franklin Sarmiento*
> *Full-stack developer*
> *skype: franklin.s.dev*
> *Twitter: @franklinitiel*
> *linkedin: Franklin Sarmiento ( franklinit...@gmail.com
>  )*
> *E-mail: franklinit...@gmail.com *
> *Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*
>
>
>
> El mar., 21 ago. 2018 a las 12:57, Osvaldo Ruso Olea (<
> venkotan...@gmail.com>) escribió:
>
>> I have problems ordering the date per day in ascending order.
>> thanks to your answer I have managed to filter the list for the current
>> month, but unfortunately it is sorted by year and not by day in ascending
>> order
>>
>> def cardio(request):
>> now = timezone.now()
>> cardio =
>> Alumno.objects.filter(fechanacimiento__month=now.month).order_by("fechanacimiento")
>> contexto = {'cardio':cardio}
>> return render(request, 'cardio.html', contexto)
>>
>> this is the result that I have achieved
>>
>> Lista
>>
>>- *2 Ago. 1943*
>> * - 15 Ago. 1948- 28 Ago. 1948- 13 Ago. 1959- 21 Ago. 1962- 7 Ago. 1967-
>>5 Ago. 1970- 24 Ago. 1970- 27 Ago. 1970- 5 Ago. 1971- 26 Ago. 1971- 2 Ago.
>>1973- 4 Ago. 1973- 23 Ago. 1973- 11 Ago. 1977- 3 Ago. 1978- 23 Ago. 1979-
>>27 Ago. 1980- 11 Ago. 1981- 8 Ago. 1982- 23 Ago. 1982- 23 Ago. 1982- 15
>>Ago. 1983- 20 Ago. 1983- 15 Ago. 1984- 19 Ago. 1985- 8 Ago. 1986- 14 Ago.
>>1986- 29 Ago. 1986- 5 Ago. 1988- 25 Ago. 1988- 31 Ago. 1988- 27 Ago. 1990-
>>21 Ago. 1991- 22 Ago. 1991- 27 Ago. 1991- 14 Ago. 1992- 6 Ago. 1993- 13
>>Ago. 1993*
>>
>>
>>
>>
>> El mar., 21 ago. 2018 a las 10:14, Matthew Pava ()
>> escribió:
>>
>>> You can chain the methods.
>>>
>>> cardio = Alumno.objects.filter ( fechanacimiento __month =
>>> now.month).order_by(‘fechanacimiento’)
>>>
>>>
>>>
>>>
>>>
>>> *From:* django-users@googlegroups.com [mailto:
>>> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
>>> *Sent:* Monday, August 20, 2018 9:49 PM
>>> *To:* django-users@googlegroups.com
>>> *Subject:* Re: problems with order by month
>>>
>>>
>>>
>>> You are a genius, thank you very much, it worked perfectly, I just made
>>> one more modification
>>>
>>>
>>>
>>> def cardio (request):
>>>
>>>  now = timezone.now ()
>>>
>>>  cardio = Alumno.objects.filter ( fechanacimiento __month =
>>> now.month)
>>>
>>>  context = {'cardio': cardio}
>>>
>>>  return render (request, 'cardio.html', context)
>>>
>>>
>>>
>>> What I can not do is sort the dates from lowest to highest,
>>>
>>>
>>>
>>> Thank you very much
>>>
>>>
>>>
>>> El lun., 20 ago. 2018 a las 19:03, Matthew Pava ()
>>> escribió:
>>>
>>> Try this:
>>>
>>> cardio =
>>> Alumno.objects.filter(fechanacimiento__month=timezone.now().month)
>>>
>>>
>>>
>>> *From:* django-users@googlegroups.com [mailto:
>>> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
>>> *Sent:* Monday, August 20, 2018 2:58 PM
>>> *To:* Django users
>>> *Subject:* problems with order by month
>>>
>>>
>>>
>>> Hi how are you, I have problems filtering and sorting by date, precisely
>>> per month.
>>>
>>> my intention is to filter the database for birthdays in the current
>>> month.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> def cardio(request):
>>>
>>> cardio = Alumno.objects.order_by('fechanacimiento')
>>>
>>> contexto = {'cardio':cardio}
>>>
>>> return render(request, 'cardio.html', contexto)
>>>
>>> --
>>> 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/e9f385a8-6b62-4e15-9020-9aa79ee7c48d%40googlegroups.c

Re: problems with order by month

2018-08-21 Thread Osvaldo Ruso Olea
try this but it does not work, keep ordering by year, and not by day
ascending

cardio = Alumno.objects.filter ( fechanacimiento __month =
now.month).order_by(‘fechanacimiento’)

   - *2 Ago. 1943*











* - 15 Ago. 1948- 28 Ago. 1948- 13 Ago. 1959- 21 Ago. 1962- 7 Ago. 1967- 5
   Ago. 1970- 24 Ago. 1970- 27 Ago. 1970- 5 Ago. 1971- 26 Ago. 1971- 2 Ago.
   1973- 4 Ago. 1973- 23 Ago. 1973- 11 Ago. 1977- 3 Ago. 1978- 23 Ago. 1979-
   27 Ago. 1980- 11 Ago. 1981- 8 Ago. 1982- 23 Ago. 1982- 23 Ago. 1982- 15
   Ago. 1983- 20 Ago. 1983- 15 Ago. 1984- 19 Ago. 1985- 8 Ago. 1986- 14 Ago.
   1986- 29 Ago. 1986- 5 Ago. 1988- 25 Ago. 1988- 31 Ago. 1988- 27 Ago. 1990
   - - try this but it did not
   workAlumno.objects.filter().order_by('fechanacimiento__month') if
   you want to filter descending so with the "-" before the
   "fechanacimiento__month" by example:
   Alumno.objects.filter().order_by('-fechanacimiento__month') #
   descending
   Alumno.objects.filter().order_by('fechanacimiento__month') # by
   default ascending. and then
   Alumno.objects.filter().order_by('fechanacimiento__month',
   'fechanacimiento__day')
   Alumno.objects.filter().order_by('fechanacimiento__month,
   fechanacimiento__day')
   
Alumno.objects.filter().order_by('fechanacimiento__month').order_by('fechanacimiento__day')*


El mar., 21 ago. 2018 a las 10:14, Matthew Pava ()
escribió:

> You can chain the methods.
>
> cardio = Alumno.objects.filter ( fechanacimiento __month =
> now.month).order_by(‘fechanacimiento’)
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 9:49 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: problems with order by month
>
>
>
> You are a genius, thank you very much, it worked perfectly, I just made
> one more modification
>
>
>
> def cardio (request):
>
>  now = timezone.now ()
>
>  cardio = Alumno.objects.filter ( fechanacimiento __month = now.month)
>
>  context = {'cardio': cardio}
>
>  return render (request, 'cardio.html', context)
>
>
>
> What I can not do is sort the dates from lowest to highest,
>
>
>
> Thank you very much
>
>
>
> El lun., 20 ago. 2018 a las 19:03, Matthew Pava ()
> escribió:
>
> Try this:
>
> cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month)
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 2:58 PM
> *To:* Django users
> *Subject:* problems with order by month
>
>
>
> Hi how are you, I have problems filtering and sorting by date, precisely
> per month.
>
> my intention is to filter the database for birthdays in the current month.
>
>
>
>
>
>
>
>
>
> def cardio(request):
>
> cardio = Alumno.objects.order_by('fechanacimiento')
>
> contexto = {'cardio':cardio}
>
> return render(request, 'cardio.html', contexto)
>
> --
> 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/e9f385a8-6b62-4e15-9020-9aa79ee7c48d%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/ae37d6672adc41f8bd4fc4187c27df80%40ISS1.ISS.LOCAL
> 
> .
> 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/CAPJtaPDoPie6B4fVUyMKojNMfwYXrJqwU3ZyGm6ny3TdmHg46Q%40mail.gmail.com
> 

Make an element on a page visible only to logged in users

2018-08-21 Thread chanman
I want to have a page look different for users who are logged in and those 
who aren't. For users that are signed in the page will have a sidebar with 
account management options. For users who aren't signed in, this sidebar 
shouldn't show up. The most obvious way to do this would be to have a 
common layout inherited by the member viewable and outsider viewable pages. 
But is there a way to do this by having some kind of optional component on 
the page?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/88655d5f-e431-4ab6-a957-f0e53097df12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Make an element on a page visible only to logged in users

2018-08-21 Thread Mike Dewhirst

On 22/08/2018 9:05 AM, chanman wrote:
I want to have a page look different for users who are logged in and 
those who aren't.


This is the "normal" way to do things

For users that are signed in the page will have a sidebar with account 
management options. For users who aren't signed in, this sidebar 
shouldn't show up. The most obvious way to do this would be to have a 
common layout inherited by the member viewable and outsider viewable 
pages. But is there a way to do this by having some kind of optional 
component on the page?


In the page you would have something like ...

{% if user.has_usable_password %} display side bar with account 
management options {% endif %}


The question then becomes how do you get user into the page. You 
probably know the answer but in case not, in your view - the first 
argument is always request - you include request.user in the rendering 
context as 'user' ie., context['user'] = request.user


hth

mike


--
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/88655d5f-e431-4ab6-a957-f0e53097df12%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/9cfb0bd6-d2fa-e35b-26b3-56b08fc3c9d7%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: ValueError at /news/ Value: None must be instance of Model:

2018-08-21 Thread Sagar
Hi Mikhailo
I think the problem is with views. Because when I run the API, it is giving 
me the default root view that django provide for API. When I entered the 
values in form and then 
when i post the data, at that time I'm getting this error.
In serializers When I make a small change It is showing me different error 
like this.
"AssertionError at /post/
No exception message supplied"
here is the code for serializers that I modify
serializers.py
from rest_framework import serializers
from models import Post, Comments


class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
fields = '__all__'

class CommentsSerializer(serializers.ModelSerializer):
class Meta:
model = Comments
fields = '__all__'

I'm new to django. Can you tell me how can I debug the code? Should I use 
try-catch?

On Monday, August 20, 2018 at 10:18:56 PM UTC+5:30, Mikhailo Keda wrote:
>
> rest_framework_mongoengine was updated 1 year ago, according to djongo 
> docs they have integration with Django Rest Framework, try to use Django 
> Rest Framework instead of rest_framework_mongoengine.
> And you need debug the error.
>
> понеділок, 20 серпня 2018 р. 14:36:15 UTC+3 користувач Sagar написав:
>>
>> Hi Mikhailo
>> Yes you are right, but I didn't used django-nonrel or djangotoolbox. 
>> Those were totally outdated. I have used djongo which is updated as far as 
>> I know. About MongoDB, I'm working on project in which we used MongoDB. We 
>> want to use NoSQL database insted of SQL database. Did you work with django 
>> and mongodb before?
>>
>

-- 
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/80c3b71c-c613-4474-b513-cf302ef3843f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Custom Django Admin Pages

2018-08-21 Thread Derek
The Django admin is great and will probably provide an 80/20 solution if 
you have a purely internal app, used by people who understand data 
management.  For an externally facing app, used by non-technical people, I 
would recommend a custom design.

The Django admin is not hard to customise quite extensively and it has many 
"hooks" to allow you to do so. (Many blog posts on this topic.)

I don't think there is one preferred way, but typically you would write 
your own views & forms and then have the results displayed in templates, 
which in turn inherit from the Django admin to keep the look-and-feel 
consistent. You can then hook these into the main menu system.  This is my 
approach for creating a set of custom reports for a Django app.  For more 
granular level changes, you can add in custom actions to deal with some of 
the business operations.  As always, try and keep your business logic 
associated with your models.

HTH

On Tuesday, 21 August 2018 06:15:18 UTC+2, me.vineetkothari wrote:
>
> It will be a bad practise you can disable dango admin and create a new app 
> admin but it will require efforts
>
> Sent from my Huawei Mobile
>
>
>  Original Message 
> Subject: Custom Django Admin Pages
> From: 'Kyle Mulka' via Django users 
> To: Django users 
> CC: 
>
>
> Hi there,
>
> It seems like Django Admin is designed to work with Django models. But, 
> I'm wondering what the best way is to create custom admin pages that don't 
> revolve around Django models. Like, maybe there's a third party API that I 
> want admins to be able to call from the Django admin. What's the best way 
> to get custom pages to show up and render in the Django admin?
>
> Thanks,
>
> Kyle
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/57ccf869-829c-4ed4-881b-3b2031834bee%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/e8168803-3ab3-40c0-bc5b-3d2bfd365b96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.