What is the difference between virtual environment and normal code in pycharm

2020-03-19 Thread cosmos multi
Hi ravi. 
In pycharm the virtual environment is created according to the project you 
choose, making this a little more automatic, making the installation or 
updating of packages more friendly, while a normal one is you who chooses what 
it should have

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


Re: error en ejercicio de principiante, no se que hacer

2020-03-28 Thread cosmos multi
Um pues la verdad te estas complicando demasiado solo configura los
archivos template en settings.py es lo que te recomiendo.

El sáb., 28 mar. 2020, 4:18 p. m., Federico Gomez 
escribió:

> saludos, tengo un error haciendo una practica en Django con el video Curso
> Django. Plantillas I. Vídeo 5, https://www.youtube.com/watch?v=iQN0z6MDrEY
> .
> Te envio el pantallazo por si puedes identificar el problema. La libreria 
> template
> no la habia descargado el Django 3.8 y lo que hice fue que la copie de la
> web de Django y la coloque en la carpeta, no se si eso tenga que ver con
> el error
>
>
>
> esta es el archivo Wievs
>
> from django.shortcuts import render
> from django.http import HttpResponse
> from django.template import Template, context
>
> # Create your views here.
> def hello(request):
> return HttpResponse("Hola Mi Hermano Para Que Sepas Estoy Mostrando Un 
> Aviso Por La Web ")
> def saludo(request):
> doc_exto=open("D:/django/mytestsite/generar/plantilla.html")
> plt=Template(doc_exto.read())
> doc_exto.close()
> ctx=context()
> docto=plt.render(ctx)
> return HttpResponse(docto)
>
>
> este es el urls
>
>
> from django.contrib import admin
> from django.urls import path
> from generar.views import hello, saludo
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path("",hello),
> path("saludo/",saludo),
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3e903965-bdbb-41fc-b9c4-5d4ce335fdad%40googlegroups.com
> 
> .
>

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


didn't return an HttpResponse

2020-05-08 Thread cosmos multi
I am trying to populate a database, but when I send it it gives me the 
following error didn't return an HttpResponse

this is the form
class ProductForm(forms.ModelForm):
name_product = forms.CharField(
max_length=25,
widget=forms.TextInput(
attrs={
'class': 'form-control',
'id': 'name_product',
}
)
)

def clean_name_product(self):
name_product = self.cleaned_data.get('name_product')
if Product.objects.filter(name_product=name_product).exists():
raise forms.ValidationError('El nombre del producto ya existe')
return name_product

class Meta:
model = Product
fields = (
'name_product', 'description', 'price', 'category', 'state', 'image'
)
labels = {
'name_product': 'Nombre del Producto',
'description': 'Descripcion',
'price': 'Precio',
'category': 'Categoria',
'state': 'Estado',
'image': 'Imagen del Producto',
}
widgets = {
'name_product': forms.TextInput(
attrs={
'class': 'form-control',
'id': 'name_product',
}
),
'description': forms.TextInput(
attrs={
'class': 'form-control',
'id': 'description',
}
),
'price': forms.NumberInput(
attrs={
'class': 'form-control',
'id': 'price',
}
),
'category': forms.SelectMultiple(
attrs={
'class': 'custom-select',
'id': 'category',
}
),
'state': forms.CheckboxInput(),
}
and this is the model

class Product(models.Model):
name_product = models.CharField(max_length=25)
description = models.CharField(max_length=250)
price = models.IntegerField()
category = models.ForeignKey(Category, on_delete=models.CASCADE)
state = models.BooleanField(default=True)
image = models.ImageField(upload_to='products/')
created_at = models.DateField(auto_now=True)

def __str__(self):
return self.name_product

this is the view

class ProductView(View):
template_name = 'products/product.html'
model = Product
form_class = ProductForm

def get_queryset(self):
return self.model.objects.filter(state=True)

def get_context_data(self, **kwargs):
context = {}
context['product'] = self.get_queryset()
context['list_product'] = self.form_class
return context

def get(self, request, *args, **kwargs):
return render(request, self.template_name, self.get_context_data())

def post(self, request, *args, **kwargs):
list_product = self.form_class(request.POST)
if list_product.is_valid():
list_product.save()
return redirect('products:product')

the error is. The views products.views.ProductView didn't return an 
httpresponse object. it returned none instead


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


Re: didn't return an HttpResponse

2020-05-08 Thread cosmos multi
I didn't know that view existed thank you very much, and the error is due
to the misuse of the form, I understand thanks

El vie., 8 may. 2020, 3:11 a. m., Andréas Kühne 
escribió:

> Hi,
>
> A couple of pointers:
>
> 1. If you are using class based views and want a Form, try using the
> FormView - you don't need to write that much code yourself (regarding
> validation of form and so on).
> 2. When you populate your context - you use a form class and not a form
> instance - you should be instantiating the form instance itself in the
> context (or change to a FormView, that will do it automatically).
>
> Now to the program that you are having - the reason you are getting it is
> because you are sending an invalid form to the post method. And the
> method then doesn't return anything,
>
> I would write it as follows:
> def post(self, request, *args, **kwargs):
> list_product = self.form_class(request.POST)
> if list_product.is_valid():
> list_product.save()
> return redirect('products:product')# <- Shouldn't there be an
> ID here for going to the newly created product page?
>
> messages.error(request, "There was an error in the form, please
> correct it below")
> return self.get(request, *args, **kwargs)
>
> Now this is only an example - you will need to handle the fact the the
> form need so be added to returned request as well.
>
> Regards,
>
> Andréas
>
>
> Den fre 8 maj 2020 kl 09:54 skrev cosmos multi :
>
>> I am trying to populate a database, but when I send it it gives me the
>> following error didn't return an HttpResponse
>>
>> this is the form
>> class ProductForm(forms.ModelForm):
>> name_product = forms.CharField(
>> max_length=25,
>> widget=forms.TextInput(
>> attrs={
>> 'class': 'form-control',
>> 'id': 'name_product',
>> }
>> )
>> )
>>
>> def clean_name_product(self):
>> name_product = self.cleaned_data.get('name_product')
>> if Product.objects.filter(name_product=name_product).exists():
>> raise forms.ValidationError('El nombre del producto ya existe')
>> return name_product
>>
>> class Meta:
>> model = Product
>> fields = (
>> 'name_product', 'description', 'price', 'category', 'state', 'image'
>> )
>> labels = {
>> 'name_product': 'Nombre del Producto',
>> 'description': 'Descripcion',
>> 'price': 'Precio',
>> 'category': 'Categoria',
>> 'state': 'Estado',
>> 'image': 'Imagen del Producto',
>> }
>> widgets = {
>> 'name_product': forms.TextInput(
>> attrs={
>> 'class': 'form-control',
>> 'id': 'name_product',
>> }
>> ),
>> 'description': forms.TextInput(
>> attrs={
>> 'class': 'form-control',
>> 'id': 'description',
>> }
>> ),
>> 'price': forms.NumberInput(
>> attrs={
>> 'class': 'form-control',
>> 'id': 'price',
>> }
>> ),
>> 'category': forms.SelectMultiple(
>> attrs={
>> 'class': 'custom-select',
>> 'id': 'category',
>> }
>> ),
>> 'state': forms.CheckboxInput(),
>> }
>> and this is the model
>>
>> class Product(models.Model):
>> name_product = models.CharField(max_length=25)
>> description = models.CharField(max_length=250)
>> price = models.IntegerField()
>> category = models.ForeignKey(Category, on_delete=models.CASCADE)
>> state = models.BooleanField(default=True)
>> image = models.ImageField(upload_to='products/')
>> created_at = models.DateField(auto_now=True)
>>
>> def __str__(self):
>> return self.name_product
>>
>> this is the view
>>
>> class ProductView(View):
>> template_name = 'products/product.html'
>> model = Product
>> form_class = ProductForm
>>
>> def get_queryset(self):
>> return self.model.objects.filter(state=True)
>>
>> def get_context_data(self, **kwargs):
>> context = {}
>> context['product'] = self.get_queryset()
>> context['list_product'] = self.form_class
>> return context
>>
>> def get(self, request, *args, **kwargs):
>> retur

Problems when obtaining an id, sent by a form

2020-05-16 Thread cosmos multi
Good evening, I am trying to get the id of my model Note that is sent by 
means of a form, but when I put form.id it tells me that id is not defined, 
try to get it through the user session but it says that it was not found.
def add_book(request):
template_name = 'books/create_note.html'
book = get_or_create_book(request)
form = NoteForm(request.POST)
if request.method == 'POST' and form.is_valid():
note = Note.objects.get(pk=form.pk)
book.notes.add(note)
form.save()
return redirect('books:book')
return render(request, template_name, {
'form': form,
})


and the form is
class NoteForm(ModelForm):
class Meta:
model = Note
fields = (
'title', 'nota'
)
labels = {
'title': 'Titulo',
'nota': 'Nota',
}

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


Re: Migrar solo una tabla

2020-06-06 Thread cosmos multi
si se puede solo es poner el comando normal y el nombre de la aplicacion

El sáb., 6 jun. 2020 a las 19:32, Gabriel Araya Garcia (<
gabrielaraya2...@gmail.com>) escribió:

> Pregunta:
> Se puede migrar solo una tabla, ya que las otras estan ok. Es decir,
> ¿sepuede:
> python manage.py makemigrations solo para una tabla recién definida en el
> modelo ?
>
> Gracias desde ya
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/db170756-9389-4c3f-aa0c-751dbb2f34ebo%40googlegroups.com
> 
> .
>

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


autocomplete django in visual studio code

2020-06-09 Thread cosmos multi
I am having a problem and it is that since I have a new laptop I 
reinstalled arch linux and visual studio code, but when I reinstalled the 
software the visual studio code autocomplete for django does not work for 
me, for python it does without problems but When working with django, the 
framework options do not work, that is, when I work with views based on 
classes, autocompletion does not generate for me, such as template_name, 
form_class, etc., likewise with models it does not generate the help of 
max_length , and those other things of the framework, I have selected the 
interpreter but it doesn't work for me and also python: build workspace 
symbols and nothing. in advance I appreciate the help.

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


Re: Best Django Rest Framework Tutorial??????

2020-06-10 Thread cosmos multi
on youtube there are very good

El mié., 10 jun. 2020 a las 14:40, chaitanya orakala (<
chaitu.orak...@gmail.com>) escribió:

> Thank you jacklin
>
>
> On Wed, Jun 10, 2020 at 3:00 PM Jack Lin  wrote:
>
>> DOCUMENTATION
>>
>>
>> 在 2020年6月11日 於 上午2:58:42, chaitanya orakala (chaitu.orak...@gmail.com)
>> 寫下:
>>
>> can anyone please respond ??
>>
>> On Wed, Jun 10, 2020 at 9:51 AM Sai  wrote:
>>
>>> Hi djangoians,
>>> I want to learn django rest framework, may i please know which is best
>>> resource in online market or any youtube links or udemy courses???
>>>
>>> Thanks in advance.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.com
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPcTzRYC7UgBAE%3Dm47w74w7kx7JQEtt3ZGZ1naV%2B1tr4jiicYw%40mail.gmail.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAP7OQq11pVJOX6j6fZRHki2YVNiFE8w_yF_BAeFaCGf_mEhZdQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPcTzRameZyEwswkSEvgn_txzHYnir-q%2B80SjeKxDSrqmotPVA%40mail.gmail.com
> 
> .
>

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


advice on role management in django

2020-06-12 Thread cosmos multi
I am trying to work with a role system that allows from the user registry, 
select the role to which you want to belong, the problem is that I do not 
get the best way to do it because when I want to do validations it 
generates many errors, investigating a bit I realized that the groups are 
more efficient in this sense or well I think so, if someone could give me 
some advice and a link to an example of how to handle this I would be very 
grateful.

this is my code
class Usuario(AbstractUser):
is_administrador = models.BooleanField(default=False)
is_satelite = models.BooleanField(default=False)
def get_administrador(self):
administrador = None
if hasattr(self, 'administrador'):
administrador = self.administrador
return administrador
def get_satelite(self):
satelite = None
if hasattr(self, 'satelite'):
satelite = self.satelite
return satelite
def __str__(self):
return '%s %s' % (self.first_name, self.last_name)
class Meta:
db_table = 'auth_user'
class Administrador(models.Model):
usuario = models.OneToOneField(Usuario, on_delete=models.CASCADE)
imagen = models.ImageField(null=True, blank=True)
razon_social = models.CharField(max_length=30)
class Satelite(models.Model):
usuario = models.OneToOneField(Usuario, on_delete=models.CASCADE)
imagen = models.ImageField(null=True, blank=True)
nivel_acadademico = models.CharField(max_length=30)
def __str__(self):
return str(self.usuario)
@receiver(post_save, sender=Usuario)
def asignar_rol(sender, instance, **kwargs):
if kwargs.get('created', False):
if instance.is_administrador:
Administrador.objects.get_or_create(usuario=instance)
elif instance.is_satelite:
Satelite.objects.get_or_create(usuario=instance)

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


Re: How to use session in django??

2020-06-14 Thread cosmos multi
I use sessions more for what shopping carts are, saving information
temporarily.

El dom., 14 jun. 2020, 11:36 p. m., meera gangani 
escribió:

> Hello ,
>  How To use session in django
> Can you please help me out!
>
>
> Thanks in advance
> -Meera Gangani
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANaPPP%2BAoBVbpM9-jwoevd8tVkep8YasFt6VSRD1M2bfP-bjcg%40mail.gmail.com
> 
> .
>

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


Re: http://localhost:8000/admin/ is not working

2020-06-15 Thread cosmos multi
This add in url?

El mar., 16 jun. 2020, 1:47 a. m., Ifeanyi Chielo 
escribió:

> Please can anyone help me resolve this issue. the
> http://localhost:8000/admin/ is not working and returns an error below
>
> TypeError at /admin/Cannot mix str and non-str argumentsRequest Method:
> GETRequest URL:
> http://localhost:8000/admin/Django Version:
> 2.1.5Exception Type:
> TypeErrorException Value:
> Cannot mix str and non-str argumentsException Location:
> C:\Users\IFEANYI
> CHIELO\AppData\Local\Programs\Python\Python37\lib\urllib\parse.py in
> _coerce_args, line 120Python Executable:
> C:\Users\IFEANYI
> CHIELO\AppData\Local\Programs\Python\Python37\python.exePython Version:
> 3.7.2Python Path:
> ['C:\\Users\\IFEANYI CHIELO\\divinerest', 'C:\\Users\\IFEANYI '
> 'CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
> 'C:\\Users\\IFEANYI
> CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
> 'C:\\Users\\IFEANYI
> CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\lib',
> 'C:\\Users\\IFEANYI CHIELO\\AppData\\Local\\Programs\\Python\\Python37',
> 'C:\\Users\\IFEANYI '
> 'CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages']Server
> time:
> Tue, 16 Jun 2020 06:40:44 +
> Traceback Switch to copy-and-paste view 
>
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\exception.py
>  in inner
>1. response = get_response(request) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py
>  in _get_response
>1. response = self.process_exception_by_middleware(e, request) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py
>  in _get_response
>1. response = wrapped_callback(request, *callback_args,
>   **callback_kwargs) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\contrib\admin\sites.py
>  in wrapper
>1. return self.admin_view(view, cacheable)(*args, **kwargs) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\decorators.py
>  in _wrapped_view
>1. response = view_func(request, *args, **kwargs) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\views\decorators\cache.py
>  in _wrapped_view_func
>1. response = view_func(request, *args, **kwargs) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\contrib\admin\sites.py
>  in inner
>1. reverse('admin:login', current_app=self.name) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>
> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\contrib\auth\views.py
>  in redirect_to_login
>1. return HttpResponseRedirect(urlunparse(login_url_parts)) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>CHIELO\AppData\Local\Programs\Python\Python37\lib\urllib\parse.py in 
> urlunparse
>1. _coerce_args(*components)) ...
>▶ Local vars 
>- C:\Users\IFEANYI
>CHIELO\AppData\Local\Programs\Python\Python37\lib\urllib\parse.py in 
> _coerce_args
>1. raise TypeError("Cannot mix str and non-str arguments") ...
>▶ Local vars 
>
> Request informationUSER
>
> AnonymousUser
> GET
>
> No GET data
> POST
>
> No POST data
> FILES
>
> No FILES data
> COOKIES
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f46f8e4c-f716-4b4f-a1a7-c16d5a819e8dn%40googlegroups.com
> 
> .
>

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


Re: urgent

2020-06-19 Thread cosmos multi
Is {% load static %} not {% load staticfiles %}

El vie., 19 jun. 2020, 1:32 p. m., Awais Ahmad 
escribió:

> i'm facing this problem and i can't fix it any body please help me or tell
> me about this error
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9441cea9-f6e5-4f2c-a050-e3d8e0f00967o%40googlegroups.com
> 
> .
>

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


Re: Deploy Django Ubuntu

2020-06-19 Thread cosmos multi
https://devcenter.heroku.com/articles/django-app-configuration

El vie., 19 jun. 2020, 6:10 p. m., Perceval Maturure 
escribió:

> Mod_wsgi does it like a charm
>
> https://m.youtube.com/watch?v=Sa_kQheCnds
>
> On Fri, 19 Jun 2020 at 21:10, Julio Cojom 
> wrote:
>
>> nginx + gunicorn.
>>
>>
>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
>>
>>
>>
>>
>> El vie., 19 jun. 2020 a las 12:59, Giovanni Silva ()
>> escribió:
>>
>>> Dears,
>>>
>>> How is the best way to deploy a Django App in the Ubuntu VPS?
>>> Can you get me a tutorial ?
>>>
>>>
>>>
>>> --
>>> *Giovanni Silva*
>>> (31) 9 9532-1877
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CABO2r9c%3DY7u9ETku7eX7fZ2auGsCPCJSQ9kVhZdT7nZP9jTnrA%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHRQUHm%2B_WUhTt0_%2B_B5Bzrj8uJS1f_3EDznxwODNbN5%3DZrqhw%40mail.gmail.com
>> 
>> .
>>
> --
> Sent from Gmail Mobile
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFZtZmDjMsRcHUoNNK-GAjks%2BjCJubpaEuXJK37v%2BXnk1DRHjA%40mail.gmail.com
> 
> .
>

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


Error trying to switch between different charts

2020-12-18 Thread cosmos multi
I am developing an application which shows the data created in a chartjs 
graph, what I am doing it does well, since all the data is displayed in the 
way I want, but I have a problem and that is that now I am trying to do 
that according to the type of graph that a user wants, this is changed, the 
problem is that the graph is changed but in case of having multiple graphs 
only the first graph is changed, the others continue with the graph by 
default.



var faltante = 100 - {{ project.porcent }};

var data = {
labels: ['{{ project.name }}', 'Falta'],
datasets: [{
data: [{{ project.porcent }}, faltante],
backgroundColor: ['#252850', '#f44611'],
}],
};

var ctx = document.getElementById('{{ project.slug }}').getContext('2d');
var myChart = new Chart(ctx, {
type: 'pie',
data: data
});

var chartType = document.getElementById('chartType');

chartType.addEventListener('change', () => {
myChart.destroy();
myChart = new Chart(ctx, {
type: chartType.value,
data: data
});
});


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


Re: Migrating a code written in flask framework to django.

2021-03-12 Thread cosmos multi
I don't know of any tool that allows you to do a technology migration
automatically, you have to change the code slowly yourself.

El vie, 12 mar 2021 a las 13:50, GEETHANJALI S P (<
geethanjalisp1...@gmail.com>) escribió:

> Hi all,
> Suppose a program is written in flask framework how can we convert it into
> django?
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMKAcOJQZ5jM7vHScUTUhj7iANW2M-v0AJtcfSWnynsCsXpbEA%40mail.gmail.com
> 
> .
>

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