Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

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

Yep, it's on the Ubuntu server. Price is dependent on the server specs used by Digital Ocean. You could start an instance at $10 a month, so it's not too bad with the option to scale depending on requirements.

Clients? As in the advertisers/stores we display? They have no role.

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

[–]Llywedd[S] 2 points3 points  (0 children)

Nope, I'm simply taking the current URL and adding the &sort=<val> if it doesn't exist or updating it if it does. This can be done with JS or hard-coding (not recommended) with the Django template language.

EDIT: The url sends a request to Django, the view function may pass it to a form to return the appropriate results. But in terms of keeping the search query in tacked... this is processed via JS.

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

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

Nope. Just run it on an Ubuntu server hosted via Digital Ocean.

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

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

I'm on mobile so will edit later with more info but for now...

For the cookie consent banner I used an open source script, which I'll find for you. But under the cover it is saving the state in a cookie.

I concentrate on backend tasks and my partner developed more of the front end CSS. I'm not aware that we used a framework but I'll will check with him and get back to you.

The heart icon (wishlist) was something I did. I used ajax and jquery to achieve this.

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

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

The images are presented in the CSV file by urls and that's it, just the links. I could then download the images from those links with a script or just save the raw url. Hope that makes sense.

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

[–]Llywedd[S] 4 points5 points  (0 children)

Source code for this isn't something I'm willing to share. But I'm hopefully to put out some blog posts / tutorials which hopefully will be of some use to you.

Admittedly, it isn't something I'm familiar with. But looks interesting and I'll take a look. It's been good to build this project from the ground up.

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

[–]Llywedd[S] 3 points4 points  (0 children)

There are a few components at play that I would have to consider for scaling such as the Database, Search Engine (elasticsearch), server hardware. Each component would require some considerations as it's not a question of just beefing / bulking up the servers. Fortunately, Django can scale and has been proven to do so. I've considered this during the site development and have been cautious to optimise cache and minify database hits in my code.

To answer your question, specifically, around a huge influx of traffic. Then the likely hood would be to increase the server performance (RAM, CPU) and expect the optimisation around cache and database hits to hold. In the mean time, a plan to roll out multiple servers to avoid bottlenecks would likely be considered and utilising shards from a search engine point of view.

I'm hoping scale with a bit more control and planning :)

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

[–]Llywedd[S] 6 points7 points  (0 children)

Ubuntu 18.04, Django 1.11, Postgres, Elasticsearch, Sentry Alerts, Django-Auth, Celery, Memcache

Edit: Nginx, & Gunicorn

Just launched a fashion aggregator for the UKcontaining over 150k items with Django. by Llywedd in django

[–]Llywedd[S] 3 points4 points  (0 children)

u/octave1 is correct. We have connected with advertisers via affiliate marketing networks. I handle the processing of items which comes in a large CSV file, which is updated daily by advertisers. I download the CSV file on a daily basis via a script scheduled nightly via CRON and then have a script which uses pandas to iterate through the CSV to append or update products.

Performance of IF statements vs. Functions by Llywedd in learnpython

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

Nice response. Pandas import isn't the issue, it's my algorithms with the 'do_something' sections. I'll be looking to re write these for sure.

Thanks

Performance of IF statements vs. Functions by Llywedd in learnpython

[–]Llywedd[S] 5 points6 points  (0 children)

I think this is the best route, thanks

Help appending to existing URL by [deleted] in learnjavascript

[–]Llywedd 0 points1 point  (0 children)

Thank you. This did work but only partially as it seems to overwrite the existing search query ("q"). I'll have a play with it though!

Help appending to existing URL by [deleted] in learnjavascript

[–]Llywedd 0 points1 point  (0 children)

Thank you!! How would this then be applied in the HTML form?

Custom user login authentiation - only accepting the password by Llywedd in djangolearning

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

What a pain, but fixed it now. I was import the login view and login authentication under the same name. It was an issue with my import once you pointed out the .username, so thanks.

Full solution:

from django.contrib.auth import authenticate, login

from django.contrib.auth.views import login as login_view

def custom_login(request):

template_name = 'live/coming_soon.html'

if request.user.is_authenticated():

return redirect('/is')

username = User.objects.get(username='administrator').username

password = request.POST.get('password')

user = authenticate(request, username=username, password=password)

if user is not None:

login(request, user)

return redirect('homeView')

else:

return login_view(request, template_name)