Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Admin list_display: Link to filtered model
I want to make a music library app and in the admin/artist page I would like to link to a list with all the albums by the artist. Models look like this: class Artist(models.Model): artistName = models.CharField(max_length=100, blank = False) genre = models.CharField(max_length=100, blank = False) def __str__(self): return self.artistName class Album(models.Model): artist = models.ForeignKey(Artist, on_delete=models.CASCADE) albumName = models.CharField(max_length=500, blank = False) year = models.IntegerField(blank = False) def __str__(self): return self.albumName Now for the admin part, I imagine that I make an ArtistAdmin model and then somehow use list_display to link to a filtered version of the Album model. Can anyone tell me how to do this or suggest a better way of doing it? -
in django html detail template why did .all work, but .all() give an error?
In my html file the following causes an error - error states Could not parse the remainder: '()' from 'project.expenses.all()': {% for expense in project.expenses.all() %} <h1>{{ expense.title}}</h1> {% endfor %} When I use the following code instead everything works well: {% for expense in project.expenses.all %} <h1>{{ expense.title}}</h1> {% endfor %} If it helps with answering this, here is my models.py file: class Project(models.Model): name = models.CharField(max_length=100) slug = models.SlugField(max_length=100, unique=True, blank=True) budget = models.IntegerField() def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Project, self).save(*args, **kwargs) class Category(models.Model): project = models.ForeignKey(Project, on_delete=models.CASCADE) name = models.CharField(max_length=50) class Expense(models.Model): project = models.ForeignKey(Project, on_delete=models.CASCADE, related_name='expenses') title = models.CharField(max_length=100) amount = models.DecimalField(max_digits=8, decimal_places=2) category = models.ForeignKey(Category, on_delete=models.CASCADE) And here is the views.py: from django.views.generic.detail import DetailView from .models import Project #Create your views here. class ProjectDetailView(DetailView): model = Project slug_url_kwarg = "project_slug" template_name = 'budget/project_detail.html' context_object_name = "project" -
Creating Multiple Communicators in Django Channels
I am testing my Chat application built with Django Channels and I am trying to create 2 communicators to model 2 users, but I keep getting psycopg2.InterfaceError: connection already closed in the line where I am instantiating the second communicator. Here's what I have: async def test_chat(self): await self.set_up() communicator = WebsocketCommunicator(application, self.endpoint) await communicator.connect() await communicator.receive_from() communicator2 = WebsocketCommunicator(application, self.endpoint2) await communicator2.connect() await communicator2.receive_from() It works fine with just one communicator, but I need 2 to properly test it. Isn't this possible or am I missing something? -
How to perfom submit of form by clicking on div in Django?
I have an hexagon div and I want to submit a form by clicking on it. I'm using django and I'd rather not use any Ajax/jQuery. so how can I send my post request using that div? <form method="POST" name="qstForm"> {% csrf_token %} <div class="hex-row" value='11'"> <div class="hex"> <div class="left"></div> <div class="middle"></div> <div class="right"></div> </div> </div> </form> -
Not able to run django site on port 80 using runmodwsgi
When I try to follow the instructions from the official mod_wsgi page to get a django site running on port 80, I get an error when running the following command: python manage.py runmodwsgi --setup-only --port=80 --user www-data --group www-data Successfully ran command. Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/base.py", line 316, in run_from_argv self.execute(*args, **cmd_options) File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/base.py", line 353, in execute output = self.handle(*args, **options) File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/mod_wsgi/server/management/commands/runmodwsgi.py", line 134, in handle 'start-server', args, options) File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/mod_wsgi/server/__init__.py", line 3305, in _cmd_setup_server generate_wsgi_handler_script(options) File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/mod_wsgi/server/__init__.py", line 1711, in generate_wsgi_handler_script with open(path, 'w') as fp: FileNotFoundError: [Errno 2] No such file or directory: '/etc/mod_wsgi-express-80/handler.wsgi' The command python manage.py runmodwsgi does work however. It properly shows the website on port 8000. So I presume this means that everything is working as it should, but for some reason it doesn't have the correct file to use port 80. The system is a Raspberry Pi 3 running raspbian stretch. The python code can be found on my github page: https://github.com/midasgossye/KVK/tree/working Any clues would be super helpfull :) -
Updating a queryset does not save the result with no error message
When I try to update my model by updating a queryset. Seems like nothing is being saved. This is my model class modelEmployer(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, employer_zip = models.IntegerField(default=0) employer_city = models.CharField(max_length=20, unique=False,blank=True,null=True,default="") employer_state = models.CharField(max_length=20, unique=False, blank=True, null=True, default="") employer_country = models.CharField(max_length=20, unique=False, blank=True, null=True, default="") This is the dictionary that contains the updated values and this is the code I am using Any suggestions on what I might be doing wrong ? -
Unexpected ModelForm has no class specified error
So I am trying to create a form for a model which specifies extra fields that I added to User. The forms.py from django import forms from .models import Profile class ProfileForm(forms.ModelForm): class meta: model = Profile fields = [ 'company', 'birth_day', ] Models.py from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) company = models.CharField(max_length=500, blank=True) address = models.CharField(max_length=30, blank=True) birth_date = models.DateField(null=True, blank=True) @receiver(post_save, sender=User) def create_user_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) @receiver(post_save, sender=User) def save_user_profile(sender, instance, **kwargs): instance.profile.save() views.py from django.shortcuts import render from .forms import ProfileForm from .models import Profile def profile_settings_view(request): form = ProfileForm(request.POST or None) if form.is_valid(): form.save() context = { 'form' : form } return render(request, 'userinfo/settings.html', context) So my error output is: ValueError at /settings/ ModelForm has no model class specified. But how is that possible, I used model = Profile why do I get this error then? -
i can't see Code Snippet in ckeditor (django app)
I am developing a django application that directed me to a problem with ckeditor text editor I can not see the Code Snippet i have this config in setting.py CKEDITOR_CONFIGS = { 'default': { 'skin': 'moono', # 'skin': 'office2013', 'toolbar_Basic': [ ['Source', '-', 'Bold', 'Italic'] ], 'toolbar_YourCustomToolbarConfig': [ {'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']}, {'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']}, {'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']}, {'name': 'forms', 'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField']}, '/', {'name': 'basicstyles', 'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']}, {'name': 'paragraph', 'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language']}, {'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']}, {'name': 'insert', 'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe', 'CodeSnippet']}, '/', {'name': 'styles', 'items': ['Styles', 'Format', 'Font', 'FontSize']}, {'name': 'colors', 'items': ['TextColor', 'BGColor']}, {'name': 'tools', 'items': ['Maximize', 'ShowBlocks']}, {'name': 'about', 'items': ['About']}, '/', # put this to force next toolbar on new line {'name': 'yourcustomtools', 'items': [ # put the name of your editor.ui.addButton here 'Preview', 'Maximize', ]}, ], 'toolbar': 'YourCustomToolbarConfig', # put selected toolbar config here # 'toolbarGroups': [{ 'name': … -
Best way to dynamic apply css colors based on customer url?
At my work, we currently have a website with three subdomains containing static html info about contact/account manager of our company, they are pretty equal but have different colors, based on the customer logo. I'm challenging myself as a training to make it more dynamic, with domain.com/customer, creating an form to add new customers, without the need to hardcode/create new subdomain everytime. Since i don't know what colors future customers may have, an colorPicker would help me alot in the registration form. I'm using Django for both front and back-end, any ideas in how to make the dynamic load of the css and apply the chosen colors based on the customer url? -
How to set up Django with nginx reverse proxy
I have a Django project that I have up and running with the development server at 127.0.0.1:8888. I'm trying to get it to run on my vps with nginx, so I can see it at example.com/djangoApp. Here's my nginx.conf: server { server_name example.com; location /otherLocation/ { proxy_pass http://127.0.0.1:10000; } location /djangoApp/ { proxy_pass http://127.0.0.1:8888; } When I navigate to example.com/djangoApp, it throws an error: "Using the URLconf defined in djangoApp.urls, Django tried these URL patterns, in this order: /admin The current path, djangoApp/, didn't match any of these." Can I modify the root url in settings.py to mitigate this? -
How can I receive and send data depending on queries that I am not sure about in Django?
Hello everyone I have created a website using Django framework and have a database with four relational tables. The website is some kind of a quizzes website where the user picks a topic out of sixteen, a question type out of three types, the number of questions and finally whether the user wants answers or not. The results will be a Web page with readable questions. I would like to know what kind of queries do I need? And how to receive the users' input and turn it into actual results? For the topics and questions' type! I have used HTML tag and a slider range (10 to 50, 10 steps between each) for the number of questions and checkboxes for the answers, and finally a button to trigger the results. -
How to fix the freezing cv2.imshow(from opencv) in django
What I want to do is when the user click the buttom , django will run the python code and detect people. I use VideoStream from imutils.video but it just popup the window and freeze. It works prefectly when I test for the face recognition but once I put the same code to django. I mean it can still detect people but it only detect the first frame then it will freeze. The VideoStream is from imutils.video and the cv2.imshow is from opencv. Here is the code for the Video Stream. Even I run the Video Stream alone(without the face recognition code), it still freeze. def detect(request): vs = VideoStream("http://192.168.1.109:8080/video").start() while True: frame = vs.read() cv2.imshow("Frame", frame) key = cv2.waitKey(1) & 0xFF if key == ord("q") : break else: time.sleep(30) break cv2.destroyAllWindows() vs.stop() return render(request,"attendance/detect.html") If it cannot be fix ,any recommendation than can do the same thing? Thank you -
Adding GeoDjango to an existing Django project
So, I was wondering if there is a way to implement GeoDjango into an existing Django project Database: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } Since I already did users and a few other stuff, I do not want to change my database, so is there a way to implement the GeoDjango into a basic Django project, and attach? I need the maps so I could link it to several coffee shops on the front end on a basic HTML page. If there is a simpler, easier way to implement the maps, via JavaScript etc, please reply. If there is a guide to doing it, please link it here. Thank you for your replies! -
django - List post in proximity of user
I want to create a list view that will order post based on proximity of the users zip code. Is there a package or api for this? I'm getting the zip codes (for the post and user) but I don't where to go from here. Are there any tuts for this? -
Django Query Return One Model as Another
I couldn't find a similar question (perhaps because I do not know the correct verbiage), but this is my dilemma. I have two models, one showing a relationship of the other. I want to be able to compare the 'user_list' and 'friends_list' in the html template so that I can determine whether to not show a user in the "available users" section if a friend relationship already exists. However, the 'user_list' objects are of the CustomUser model type, and the 'friends_list' objects are of the Friend model type. How can I return the results of the get_friends() method such that I can exclude these friends from the 'user_list' queryset, preferably by pk so I don't have to worry about string comparisons? Thank you! Models.py class CustomUserModel(AbstractBaseUser, PermissionsMixin): # Simplified for brevity username = models.CharFiend(_('username'), unique=True) class Friend(models.Model): user1 = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete.models.CASCADE, related_name='user1') user2 = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete.models.CASCADE, related_name='user2') objects = FriendManager() class Meta: unique_together = ('user1', 'user2') def __str__(self): return str(self.user2) Managers.py class FriendManager(models.Manager): def is_friend(self, user1, user2): if not user1 or not user2: return False return super(FriendManager, self).get_queryset().filter(user1=user1).filter(user2=user2).exists() def get_friends(self, user): return super(FriendManager, self).get_queryset().filter(user1=user) Views.py class UserList(ListView): model = get_user_model() context_object_name = "object_list" template_name = "users.html" def dispatch(self, request, *args, … -
How to show, in Django, more data from a preview after clicking the mouse?
The Database has these fields: id, title, preview, titleWork, fullDescription, each row. I can't find a way to show the full database row after clicking on the preview. I run the loop for showing the previews list contents. When I click on an image from the list, the console.log is always the last element of the database, but I need the id of the element I clicked to show the others data. How can I get the id of the element I clicked on, after clicked it? {% for listing in listings %} <img class="carousel" id="{{ listing.id}}" onclick="idNumber()" src="{{ listing.preview.url }}" alt="{{ listing.titleWork }}" title="{{ listing.titleWork }}"> <script> function idNumber(){ idNumb_ = document.getElementById('{{ listing.id | safe}}') console.log(idNumb_); } </script> {% endfor %} -
Create an option field to Select existing Model object in the object creation form django
I would like to create a django form that creates an object and also has a field with options of existing objects for the user. #models.py class Reciever (models.Model): first_name = models.CharField(max_length=254, blank=False, null=False) last_name = models.CharField(max_length=254, blank=False, null=False) user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) #forms.py class RecieverCreationForm(forms.ModelForm): class Meta(): model = Reciever fields = ( 'first_name','last_name') #view.py class AddReciever(LoginRequiredMixin,generic.CreateView): form_class = RecieverCreationForm template_name = 'AddReciever.html' success_url = reverse_lazy('sendpackage') def form_valid(self, form): form.instance.user = self.request.user return super().form_valid(form) Think of it like this , i would like to add details of a receiver for a delivery but i want to have a field that allows me pick from existing receivers if i don't want to create a new one . -
Django/Selenium: Very simple functional test hangs because of tearDown()
I've got a very simple test going on class NewVisitorTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() def tearDown(self): self.browser.quit() def test_can_see_homepage(self): self.browser.get('http://localhost:8000') self.assertIn('Floppers', self.browser.title) if __name__ == '__main__': unittest.main(warnings='ignore') This test runs completely it seems (the browser opens and closes) but the test hangs and never actually finishes. On the other hand, if I comment out the teardown() method, it runs fine (but I have to manually close the browser). If I run in verbose mode, it looks like the test is hanging on the test_can_see_homepage test. Adding permission 'Permission object (None)' Adding permission 'Permission object (None)' System check identified no issues (0 silenced). test_root_url_resolves_to_splash__view (main.tests.unit.test_splash.SplashPage) ... ok test_can_see_homepage (main.tests.functional.test_splash.NewVisitorTest) ... It'll stay like this indefinitely. If I ctrl + c out of it, then it shows me the results as if it finished. What might be going on here, that having a tearDown() method causes the test itself to stall? If it's relevant, I'm using Arch Linux w/ Awesome-WM (in case there's a signal that's not being sent due to my setup or something). -
How to login Django server using Retrofit in android?
I just created interface as below: public interface UserClient { @POST("login") Call<UserInfo> login(@Body Login login); } UserInfo Class: public class UserInfo { private String token; public String getToken(){ return token; } public void setToken(String token){ this.token = token; } } And here is the main code: Retrofit.Builder builder = new Retrofit.Builder() .baseUrl("http://amirhoseinbidar.pythonanywhere.com/") .addConverterFactory(GsonConverterFactory.create()); Retrofit retrofit = builder.build(); UserClient userClient = retrofit.create(UserClient.class); Login login = new Login("root", "root"); Call<UserInfo> userCall = userClient.login(login); userCall.enqueue(new Callback<UserInfo>() { @Override public void onResponse(Call<UserInfo> call, Response<UserInfo> response) { if (response.isSuccessful()){ Toast.makeText(Main2Activity.this, "connection successful " + response.body().getToken(), Toast.LENGTH_SHORT).show(); }else { textView.setText(response.raw().toString()); } } @Override public void onFailure(Call<UserInfo> call, Throwable t) { Toast.makeText(Main2Activity.this, t.getMessage(), Toast.LENGTH_SHORT).show(); } }); So the problem is response is not successful. Anyone can Help? note: Login class contains two vars (username, password) and a constructor. -
Context_processor does not define a " " class/attribute(error)
I am following a Django course from Antonio's Melle Book, and I need a context_processor to use a cart instance throught the webapp. I constantly get the error, that the context processor does not define a "cart" object attribute. Note: I am using cached sessions, if it matters I tried putting the cart in a try catch statement, I have read the docs, I doesn't sort things out for me context_processors.py from .cart import Cart def cart(request): return {'cart': Cart(request)} settings.py TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ (...) 'cart.context_processors.cart,']} cart.py class Cart(object): def __init__(self, request): self.session = request.session cart = self.session.get(settings.CART_SESSION_ID) if not cart: cart = self.session[settings.CART_SESSION_ID] = {} self.cart = cart -
Django: Is there a way to show validation error message on modal when using modal as a form?
I'm trying to use a form on modal and there's a problem with validation. Modal closes before showing the validation error message on it. I think I can use preventDefault to prevent closing the modal. But how can javascript check if the form data is valid? html <form method="POST" action="{% url 'profile:edit_profile' %}" enctype="multipart/form-data"> <div class="modal fade" id="editProfileModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-body"> {% csrf_token %} <div class="form-group"> {% if profile_form.photo.errors %} <div class="alert alert-danger">{{ profile_form.photo.errors }}</div> {% endif %} <label>{{ profile_form.photo.label }}</label> {{ profile_form.photo }} </div> <div class="form-group"> {% if profile_form.first_name.errors %} <div class="alert alert-danger">{{ profile_form.first_name.errors }}</div> {% endif %} <label>{{ profile_form.first_name.label }}</label> {{ profile_form.first_name|add_class:'form-control' }} </div> <div class="form-group"> <label>{{ profile_form.last_name.label }}</label> {{ profile_form.last_name|add_class:'form-control' }} </div> <div class="form-group"> <label>{{ profile_form.bio.label }}</label> {{ profile_form.bio|add_class:'form-control' }} </div> </div> <div class="modal-footer"> <button type="submit" name="profile_form" class="btn btn-primary">Save</button> <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button> </div> </div> </div> -
Django - Processing form that contains checkboxes with a ManyToMany Relationship
I have been trying to get this to work but I seem to be doing something wrong. What I want to accomplish: I have a model called Venue that has many Amenities: class Venue(TimeStampedModel): owner = models.ForeignKey(User, on_delete=models.CASCADE) name = models.CharField(max_length=250) type = models.ForeignKey(VenueType, on_delete=models.CASCADE) def __str__(self): return self.name class Amenity(TimeStampedModel): category = models.ForeignKey(AmenitiesCategory, on_delete=models.CASCADE) venues = models.ManyToManyField(Venue, blank=True) name = models.CharField(max_length=250) description = models.TextField() def __str__(self): return self.name When a user creates a venue I want them to be able to view all the created amenities and select the ones applicable to their venue. In my template I currently display all the amenity options as follows: What I used first (I prefer this since I can loop through the categories of each amenity first): <div class="ui container"> <h2>Select all that are applicable</h2> <form method="POST" class="ui form"> {% csrf_token %} {% for category in categories %} <h4 class="ui horizontal divider header"> <i class="list icon"></i> {{category.category}} </h4> <p class="ui center aligned text"><u>{{category.description}}</u></p> {% for amenity in category.amenity_set.all %} <div class="inline field"> <div class="ui checkbox"> <input type="checkbox" value="{{amenity.id}}" name="choices"> <label><span data-tooltip="{{amenity.description}}" data-position="top left">{{amenity}}</span></label> </div> </div> {% endfor %} {% endfor %} <button type="submit" name="submit" class="ui button primary">Next</button> </form> What I used after: … -
Django efficient Queryset with Foreign Key Models
I'm trying to find the most efficient way (as less db queries as possible) for the following model structure. In my template I then want to pass all the data from all 3 models because I would have to show the post data as well as looping through the comments to create a comments list and display all the attachments for the different comments. class Post(BaseModel): user = models.ForeignKey('User', blank=True, null=True, title = models.CharField(max_length=128) content = models.TextField() class Comment(BaseModel): post = models.ForeignKey('Post', on_delete=models.CASCADE) user = models.ForeignKey('User', on_delete=models.SET_NULL) text = models.TextField() class CommentAttachment(BaseModel): comment = models.ForeignKey('Comment', on_delete=models.CASCADE) name = models.CharField(max_length=128) Should I fetch all data from CommentAttachment direction or is there a nother way? -
foreign key mismatch - "app_user_groups" referencing "app_user"
I have a User model in models.py - class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(unique=False) username = models.CharField(primary_key=True, max_length=25, unique=True) password = models.CharField(max_length=50) I didn't have a primary_key=True key before, but I added it recently. After adding it, however, I'm getting the error: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 303, in execute return Database.Cursor.execute(self, query, params) sqlite3.OperationalError: foreign key mismatch - "app_user_groups" referencing "app_user" "app" is the name of my application. I've never heard of "app_user_groups" before (there is no model with that name, etc..). After adding the field in models.py, I made sure to run: python3 manage.py makemigrations app python3 manage.py migrate The error occurs when I attempt to signup a new user (I cleared my migrations folder). Specifically, the error is on the line user = form.save() This procedure used to work fine before I added primary_key=True. Does anyone know why I'm suddenly getting this issue and how to fix it? views.py def signup(request): if request.method == 'POST': form = SignUpForm(request.POST) if form.is_valid(): usermodel = get_user_model() username = form.cleaned_data['username'] password = form.cleaned_data['password1'] email = form.cleaned_data['email'] user = form.save() login(request, user) return HttpResponseRedirect('/home') else: form = SignUpForm() return render(request, … -
GeoDjango with OpenStreetMap
I am developing a Django application. As a last step, I would like to add the ability to enter lat long and point of interest name to a database and show those points on OpenStreetMap. I have checked a bit and GeoDjango seems a good choice for the task. I have searched for some tutorials online and there geospatial libraries were mentioned such as GEOS, GDAL, PROJ.4 and GeoIP. Do I need them for such simple task as mine or Django and GeoDjango alone is enough? Thank you very much in advance.