
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
A Django app for store places with autocomplete function and a related map to the selected place.
Install dj-places
and add it to your installed apps:
$ pip install dj-places
INSTALLED_APPS = (
...
'places',
...
)
Add the following settings and maps api key (read more here):
PLACES_MAPS_API_KEY='YourAwesomeUltraSecretKey'
PLACES_MAP_WIDGET_HEIGHT=480
PLACES_MAP_OPTIONS='{"center": { "lat": 38.971584, "lng": -95.235072 }, "zoom": 10}'
PLACES_MARKER_OPTIONS='{"draggable": true}'
Then use it in a project:
from django.db import models
from places.fields import PlacesField
class MyLocationModel(models.Model):
location = PlacesField()
This enables the following API:
>>> from myapp.models import ModelName
>>> poi = ModelName.objects.get(id=1)
>>> poi.position
Place('Metrocentro, Managua, Nicaragua', 52.522906, 13.41156)
>>> poi.position.place
'Metrocentro, Managua, Nicaragua'
>>> poi.position.latitude
52.522906
>>> poi.position.longitude
13.41156
For using outside the Django Admin:
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
{{ form.media }}
</form>
Remember to add the {{ form.media }}
in your template.
Tools used in rendering this package:
FAQs
A django app for store places using Google Maps API
We found that dj-places demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.