0

I cloned the askbot repo.

To my surprise it was not a django project. It is a command line tool which setsup askbot projects that too importing the askbot views from the askbot package.

I'm used to editing Django projects normally. I'm unable to know where the source is and what I have to do.

1) There is no manage.py in the project src.

2) There seems to be no apps like in a normal django project.

3) There seem to be a lot of .py files everyhere which are put in a python package.

4) If you create a django project using askbot command it directly imports from the askbot python package and doesn't create a app like a normal django project. For example https://github.com/ASKBOT/askbot-devel/blob/master/testproject/testproject/urls.py does

import askbot
if askbot.is_multilingual():
    from django.conf.urls.i18n import i18n_patterns
    urlpatterns = i18n_patterns('',
        (r'%s' % settings.ASKBOT_URL, include('askbot.urls'))
    )
else:
    urlpatterns = patterns('',
        (r'%s' % settings.ASKBOT_URL, include('askbot.urls'))
)

It seems the project imports from askbot as a python package

1) Is it possible to edit askbot as a local django project rather than importing from the pip installed package?

2) Is it mandatory to install askbot as a python package and import from it?

Here is the source https://github.com/ASKBOT/askbot-devel

Wally
  • 432
  • 6
  • 19
  • What do you mean by “not a Django project”? It’s seems to be as much of a Django project as any other project, or maybe even better. Here’s the link https://github.com/ASKBOT/askbot-devel you should probably add it to your question – Taku Jun 24 '17 at 06:31
  • You linked to the inner dir of the “testproject” (emphasis on the name), the actual code is in the link I linked. As for where is the manage.py? It’s in the outer “testproject” dir: https://github.com/ASKBOT/askbot-devel/tree/master/testproject. Fyi, a Django project doesn’t necessary need a manage.py, just as long as it’s properly setuped – Taku Jun 24 '17 at 06:54
  • @abccd Sorry about that. But I still see no apps and source code in that directory. All the source seems to be imported from the Python package that gets created after installing using `pip` or `setup.py` – Wally Jun 24 '17 at 07:28
  • What do you mean.......look closer, deeper, in right inside the askbot nested dir, anyways, if you needed, here’s the *exact* link https://github.com/ASKBOT/askbot-devel/tree/master/askbot thought the previous one would be enough. As a side note, setup.py doesn’t usually creates new files, they are used to properly configure and relocate the existing ones – Taku Jun 24 '17 at 13:05
  • @abccd In https://github.com/ASKBOT/askbot-devel/blob/master/testproject/testproject/urls.py they do `import askbot` and `urlpatterns = i18n_patterns('', (r'%s' % settings.ASKBOT_URL, include('askbot.urls'))` . How would they import askbot if it's in a different folder. My guess is it's cos they install askbot as a moudle using `setup.py`. What if I don't want to install askbot as a module? – Wally Jun 27 '17 at 03:56
  • @abccd My guess is I can just copy the askbot folder and import the urls.py from it instead of installing it as a package. Am I right? – Wally Jun 27 '17 at 04:07
  • The testprojects are ran when setup.py has already been installed properly, alternatively you can do what you previously said – Taku Jun 27 '17 at 04:51
  • @abccd Doesn't setup.py install askbot as a package?(Correct me if I am wrong) The whole point of this question is I don't want to install askbot as a package. – Wally Jun 27 '17 at 05:02
  • *alternatively you can do what you previously said*, you can just copy the askbot folder, from what you said 3 comments ago – Taku Jun 27 '17 at 05:05

0 Answers0