Deploy django to Windows server

2022-03-14 Thread www.forum-gh.com
hey guys, Please I want to deploy my django app on Windows Server with a
public IP, I don't know how to go about it please someone should guide me
to do this

-- 
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/CALYpPT-Df%3DjR9qBZo8V03wJMUFxOSjYYZTQ9VX4QWDof75tjnA%40mail.gmail.com.


Django and Vue

2020-10-30 Thread www.forum-gh.com
hello family please i need guidance on how to integrate vue and django to:
1. use one url
2. drf and vue

-- 
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/CALYpPT8Ek%2B_6HxGJbW8SCRRrskVDeEx1WVq4_b5nLEuXw3ZY%3Dw%40mail.gmail.com.


api

2020-12-24 Thread www.forum-gh.com
hello family, merry christmas to you all, please i want to develop an app
backend being django and front end being vue,
please can you tell me what i need to do like where the functions will be
since j will be using api and how should i serialize the functions please
help me

thanks

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


Import Export

2021-01-13 Thread www.forum-gh.com
hello, please i have 4 models linked together by foreignkey how do i
perform import using the django import_export package.

Thanks

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


Django and Ajax

2021-01-17 Thread www.forum-gh.com
Hello,
 Please I need your help on this, I am an absolute beginner, how
can I create a filter using ajax for example when the user selects Ghana
from a dropdown then data related to this country will show without
refreshing the page.
Thanks

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


Django Import and Export

2021-02-10 Thread www.forum-gh.com
Hi, I am using the django_import_export package but i am not been able to
import files, the tables are related. Please find the attached
files(models, resources and admin) for your reference.

Please help me

-- 
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/CALYpPT-j0jNMZYm7POFfW94fjjSkATEn_ZAYYn6kZx6Wyc3AfQ%40mail.gmail.com.
from django.db import models
from django.utils import timezone
from django.conf import settings
import decimal
from apps.product.models import *

#  Permit Information Analysis 
class Info(models.Model):

O_PORT = [
('Overland', 'Overland'),
('Ghana', 'Ghana'),
('By Air', 'By Air'),
('By Road', 'By Road'),
('Takoradi', 'Takoradi'),
('Tema', 'Tema'),
]


PAYMENT_TYPE = [
('Cash Against Document', 'Cash Against Document'),
('Bank Draft', 'Bank Draft'),
('Cash Against Document', 'Cash Against Document'),
('Letter of Credit', 'Letter of Credit'),
('Wire Transfer', 'Wire Transfer'),
('PrePaid', 'PrePaid'),
]

exporter = models.CharField(max_length=150)
buyer = models.CharField(max_length=150)
vessel = models.CharField(max_length=150)
date_of_transaction = models.DateField(default=timezone.now, verbose_name="Transaction Date")
originating_port = models.CharField(choices=O_PORT, max_length=8, default="Ghana")
city_destination = models.CharField(max_length=150, verbose_name="City of Destination")
country_destination = models.ForeignKey(Country, on_delete=models.CASCADE, verbose_name="Country of Destination")
contract_number = models.CharField(max_length=150, verbose_name="Contract Number")
a2_form = models.CharField(max_length=50, blank=True, null=True)
payment_type = models.CharField(max_length=100)
negotiating_bank = models.ForeignKey(Bank, on_delete=models.CASCADE)
container_or_vehicle = models.CharField(max_length=50)
driver_name = models.CharField(max_length=150, blank=True)

# records on user
added_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True, blank=True, editable=False, verbose_name="Added By")
updated_by = models.CharField(max_length=50, default='Admin', null=True, blank=True)
date_added = models.DateTimeField(auto_now_add=True)

permit_NUM = models.CharField(max_length=30, unique=True, verbose_name="Permit Number")

class Meta:
verbose_name = "Capture Permit Info"
verbose_name_plural = verbose_name

def __str__(self):
return self.exporter



#  Permit 
class Permit(models.Model):

CONVERSION = [
('1.', '1.'),
('0.0006', '0.0006'),
('0.0007', '0.0007'),
('0.0010', '0.0010'),
('0.0015', '0.0015'),
]

UNITS = [

('m2', 'm2'),
('m3', 'm3'),

]

CURRENCY = [
('USD', 'USD'),
('GHS', 'GHS'),
('CFA', 'CFA'),
('Euro', 'Euro'),

]

product = models.ForeignKey(Product, on_delete=models.CASCADE)
specie = models.ForeignKey(Specie, on_delete=models.CASCADE)
grade = models.ForeignKey(Grade, on_delete=models.CASCADE)
info = models.ForeignKey(Info, on_delete=models.CASCADE)

# volume
volume = models.DecimalField(max_digits=19, decimal_places=3)
conversion_factor = models.CharField(choices=CONVERSION, max_length=8)
units = models.CharField(choices=UNITS, max_length=5, default='m3')
unit_price = models.DecimalField(max_digits=19, decimal_places=2)
currency = models.CharField(max_length=15)
ex_rate = models.DecimalField(max_digits=19, decimal_places=4, verbose_name='Exchange Rate')


def __str__(self):
return self.info.exporter

@property
def my_value(self):
val = self.volume * self.unit_price
val = round(val, 2)
return val

@property
def derived_volume(self):
dv = self.volume * decimal.Decimal(self.conversion_factor)
dv = round(dv, 3)
return dv

@property
def euro_value(self):
ev = self.volume * self.unit_price * self.ex_rate
ev = round(ev, 2)
return ev


from import_export import resources
from apps.permit.models import Permit, Info
from apps.product.models import *
from import_export.fields import Field
from import_export.widgets import ForeignKeyWidget
import decimal


# Resource for import nd export
class PermitResource(resources.ModelResource):
info__exporter = Field(column_name='Exporter', attribute='info',
   widget=ForeignKeyWidget(Info, 'exporter'))

product__name = Field(column_name='Product', attribute='prod

CHOICES

2021-06-13 Thread www.forum-gh.com
Hello friends
please i have: conversion_fqctor = models.charfield(choices=FACTOR)

i want to sum the conversion_factor inside my view.py how do i convert it
to a decimal and use the Sum()

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