Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to install it #76

Open
asakura42 opened this issue Jul 7, 2021 · 6 comments
Open

Explain how to install it #76

asakura42 opened this issue Jul 7, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@asakura42
Copy link

Please explain how to install it in couple words. I'm new in all that python things and don't know well how to use Django projects.

@f1nnix
Copy link
Owner

f1nnix commented Jul 7, 2021

I'll update README with full process for fresh Django install in a few days.

@asakura42
Copy link
Author

asakura42 commented Jul 9, 2021

I would like to clarify my request: I expect to install your system on a local server, without Ansible or Docker. Therefore, it would be interesting to know at least briefly how to run your code myself. I looked in the v1-stable branch and saw in Ansible rules that the system uses postgresql and redis. Tried to replicate it and it didn't work. So I'm looking forward to at least a quick tutorial.

@f1nnix
Copy link
Owner

f1nnix commented Jul 9, 2021

Yep, I'll try to update README for local install on fresh Django this weekend.

@f1nnix f1nnix added the enhancement New feature or request label Jul 9, 2021
@f1nnix
Copy link
Owner

f1nnix commented Jul 12, 2021

I've updated readme with magplan-specific installation steps. Also, please, take a look at https://docs.djangoproject.com/en/3.2/intro/tutorial01/ — it's great official tutorial which can lead you into Django from very beginning, explaining you basic stuff like how to create a new Django project and setup database (required for magplan).

Feel free to contact, if you have any issues.

@asakura42
Copy link
Author

After number of tryings and digging I finally get the ./manage.py migrate semi-work, but got output:

...
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, dynamic_preferences, dynamic_preferences_users, magplan, sessions, sites
Running migrations:
  Applying magplan.0002_auto_20201115_1140...Traceback (most recent call last):
...
django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [<ModelState: 'magplan.User'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see https://docs.djangoproject.com/en/3.2/topics/migrations/#dependencies for more

What should I do? Tried some tips from stackexchange, but they doesn't work.

@f1nnix
Copy link
Owner

f1nnix commented Jul 17, 2021

Huh, sorry for delay, busy days.

Magplan migrations are heavily realeted on your main app User model: instead of bringing own user, Magplan nicely plays with your's existing one.

One way to make migrations work: for example, you main app is called main. So, in main/models.py define custom user:

from django.contrib.auth.models import AbstractUser

class User(AbstractUser):
	pass

And tell Django to use it. In your settings.py add:

AUTH_USER_MODEL = 'main.User'

Then migrations should work.

If something still goes wrong, drop me a line in this issue, and I finally build a starter project with 100% everything working ;).

~Ilya.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants