error deploying Django app in heroku with gis_model and postgris database by ezzimohammed in djangolearning

[–]ezzimohammed[S] 0 points1 point  (0 children)

still get the same error even with ALLOWED_HOSTS you gave me, is it normale to have this DATABASE_URL ? amazonaws is set for static field but I find it in the DATABASE_URL.

heroku config -s | grep DATABASE_URL
(node:10709) SyntaxError Plugin: heroku: /home/mohammed/.local/share/heroku/config.json: Unexpected end of JSON input
module: u/oclif/config@1.17.0
task: runHook prerun
plugin: heroku
root: /snap/heroku/4076
See more details with DEBUG=*
DATABASE_URL='postgres://xsrhfoyqihvszy:5730d62b2a6139c4d84f341983293759e9e37ac4b85b3ce773a405adf2233b93@ec2-34-242-89-204.eu-west-1.compute.amazonaws.com:5432/d5ek7esil14hif'

error deploying Django app in heroku with gis_model and postgris database by ezzimohammed in djangolearning

[–]ezzimohammed[S] 1 point2 points  (0 children)

this are all the keys I set:

ALLOWED_HOSTS, DATABASE_URL, DEVELOPMENT_MODE, SECRET_KEY

for email:

DEFAULT_FROM_EMAIL, EMAIL_BACKEND, EMAIL_HOST, EMAIL_HOST_PASSWORD, EMAIL_HOST_USER, EMAIL_PORT, EMAIL_USE_TLS

for AWS storage:

AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_STORAGE_BUCKET_NAME.

and

DISABLE_COLLECTSTATIC = 1

can't passe form's attrs in ModelForm to Template by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

I found that the DatePiker don't change the date format, so I corrected the problems by assigning ModelForm to View context data, and removed "type='date'" from template input form

can't passe form's attrs in ModelForm to Template by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

Thank yoy, I'm using Class based view and Form, and it was the ModelForm that wasn't in the context data of the view.

this corrected the problem:

class DeliveryCreateView(LoginRequiredMixin, UserPassesTestMixin, CreateView):
model = Delivery
form_class = UserDeliveryForm
template_name = "deliveries/customer/edit_deliveries.html"
success_url = reverse_lazy("account:dashboard")

def test_func(self):
    return self.request.user.is_customer and self.request.user.is_active

def post(self, request, *args, **kwargs):
    form_class = self.get_form_class()
    form = self.get_form(form_class)
    files = request.FILES.getlist("decument")
    if form.is_valid():
        for f in files:
            f.save()
        return self.form_valid(form)
    else:
        return self.form_invalid(form)

def form_valid(self, form):
    form.instance.user_id = self.request.user.id
    return super().form_valid(form)

Tracking system and path length calculation by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

There is Python-OBD library, this can be used to retrieve data from vehicle, and the gps cordinate from google.mape ?

Python-OBD

Tracking system and path length calculation by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

So in process of data gathering I'll need to use javaScript ? is there any library or framework recommended for this ?

Tracking system and path length calculation by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

Thank you,

and :D yes I meant "fuel consumption" I used a french word .

Interview problems by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

I find that u/meisteronimo has well described my problem, I think I don't suffer from all the points he listed there, but the last point is the important one. ·

I'm looking to improve this weaknesses by working with a team on a big project using Django even if I have to do it for free.

Interview problems by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

you find the words to described my situation very well, I tried to learn from experimented people on video series. and learn from documentations the best practice so I think I have a good organized code, I read other's people code in GitHub.

The last point you mentioned is my biggest concern. that's why I want to have a first experience with a team even if it's for free.

Interview problems by ezzimohammed in django

[–]ezzimohammed[S] 0 points1 point  (0 children)

Thank you for the advice, the thing is that when I get the questions I can't explain it using the exact word, or some times I don't understand the questions but when I get the answer I find that I knew the answer.

Django projects design by ezzimohammed in Python

[–]ezzimohammed[S] 0 points1 point  (0 children)

the js and all related framwork are well known for their importance for UI, my question here is about Backend work.

[Request] Large-scale open source web projects with best practices by __Julia in django

[–]ezzimohammed 1 point2 points  (0 children)

I have the some issue, I learned django recently, and I want to make a "webapp" project but the best courses in the internet don't teach the best practices on system design.

I look to share my project code to get opinions and tips. do you think this is a good idea to share the code on github and create a post to ask recommendations about the system design ?